module IBM::Cloud::SDKHTTP::ChildMixin

Access a specific instance by either id or name depending on API.

Public Instance Methods

first_instance() click to toggle source

Return the first_instance returned from a collection get.

# File lib/ibm/cloud/sdk_http/has_child.rb, line 17
def first_instance
  params(limit: 1).all.first
end
instance(id) click to toggle source

Get an instance of the collection object. @param id [String] ID of Name to search on depending on API. @return [] The instance object.

# File lib/ibm/cloud/sdk_http/has_child.rb, line 12
def instance(id)
  @instance.new(self, endpoint: id).refresh
end