Gets the ``resource _id`` for this authorization.

        return: (osid.id.Id) - the ``Resource Id``
        raise:  IllegalState - ``has_resource()`` is ``false``
        *compliance: mandatory -- This method must be implemented.*
355550
def get_resource_id(self):
        
        # Implemented from template for osid.resource.Resource.get_avatar_id_template
        if not bool(self._my_map['resourceId']):
            raise errors.IllegalState('this Authorization has no resource')
        else:
            return Id(self._my_map['resourceId'])
671124
def get_provider_id(self):
        
        if 'providerId' not in self._my_map or not self._my_map['providerId']:
            raise errors.IllegalState('this sourceable object has no provider set')
        return Id(self._my_map['providerId'])
1222159
def update_resource(id_or_uri, resource, opts = {})
      data, _status_code, _headers = update_resource_with_http_info(id_or_uri, resource, opts)
      return data
    end
642479
def find_resource(id = nil)
      id ||= respond_to?(:params) && params.is_a?(ActionController::Parameters) && params[:id]
      resource_service.find id
    end
1328515
def get_resources_to_check(client_site_url, apikey):
    
    url = client_site_url + u"deadoralive/get_resources_to_check"
    response = requests.get(url, headers=dict(Authorization=apikey))
    if not response.ok:
        raise CouldNotGetResourceIDsError(
            u"Couldn't get resource IDs to check: {code} {reason}".format(
                code=response.status_code, reason=response.reason))
    return response.json()
426493
def get(self, resource_id):
        
        response = self.requester.get(
            '/{endpoint}/{entity}/{id}',
            endpoint=self.endpoint, entity=self.entity, id=resource_id,
            paginate=False
        )
        return response.json()
1147937
def get_id(self):
        """"""

        # Check first to make sure no one else has claimed authority on my object.
        # This will likely occur when an AssessmentSection returns a Question
        # During an AssessmentSession
        if self.my_osid_object._authority != MAGIC_AUTHORITY:
            return self.my_osid_object._item_id
            # raise AttributeError

        # If not, go ahead and build magic Id:
        choices = self.my_osid_object._my_map['choices']
        choice_ids = [c['id'] for c in choices]
        magic_identifier = quote('{0}?{1}'.format(self.my_osid_object._my_map['_id'],
                                                  json.dumps(choice_ids)))
        return Id(namespace='assessment.Item',
                  identifier=magic_identifier,
                  authority=MAGIC_AUTHORITY)
818658
def get_supported_resources(netid):
    
    url = _netid_supported_url(netid)
    response = get_resource(url)
    return _json_to_supported(response)
1375058
def get_id(self):
        
        if self._id is None:
            self._id = graceful_get(self.inspect(refresh=True), "ID")
        return self._id
339434
def _get_resource_id(resource, name, region=None, key=None,
                     keyid=None, profile=None):
    '''
    
    '''

    _id = _cache_id(name, sub_resource=resource,
                    region=region, key=key,
                    keyid=keyid, profile=profile)
    if _id:
        return _id

    r = _get_resource(resource, name=name, region=region, key=key,
                      keyid=keyid, profile=profile)

    if r:
        return r.id
1250183
def ensure_resource_data(self, update_data=False):
        
        # Check for unique identifier in the resource data
        if not any(key in self.data for key in self.UNIQUE_IDENTIFIERS):
            raise exceptions.HPOneViewMissingUniqueIdentifiers(MISSING_UNIQUE_IDENTIFIERS)

        # Returns if data update is not required
        if not update_data:
            return

        resource_data = None

        if 'uri' in self.UNIQUE_IDENTIFIERS and self.data.get('uri'):
            resource_data = self._helper.do_get(self.data['uri'])
        else:
            for identifier in self.UNIQUE_IDENTIFIERS:
                identifier_value = self.data.get(identifier)

                if identifier_value:
                    result = self.get_by(identifier, identifier_value)
                    if result and isinstance(result, list):
                        resource_data = result[0]
                        break

        if resource_data:
            self.data.update(resource_data)
        else:
            raise exceptions.HPOneViewResourceNotFound(RESOURCE_DOES_NOT_EXIST)
1299606
def by_resource_id(cls, resource_id, db_session=None):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.model).filter(
            cls.model.resource_id == int(resource_id)
        )
        return query.first()
92043
def usable_id(cls, id):
        
        try:
            # id is maybe a hostname
            qry_id = cls.from_name(id)
            if not qry_id:
                # id is maybe an ip
                qry_id = cls.from_ip(id)
            if not qry_id:
                qry_id = cls.from_vhost(id)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id
435612
@Override
    public String getResourceId() {
        Preconditions.checkArgument(
                this.urlType == UrlType.RESOURCE,
                "UrlType must be %s but was %s",
                UrlType.RESOURCE,
                this.urlType);
        return this.resourceId;
    }
674875
def requested_by?(resource)
      user = resource.respond_to?(:owner) ? resource.owner : resource
      case
      when current_resource_owner.nil?
        false
      when !user.is_a?(current_resource_owner.class)
        false
      when current_resource_owner.id == user.id
        true
      else
        false
      end
    end
834679
def id
      id_attr = resource[:id]
      return id_attr.to_s if id_attr.present? && id_attr.is_a?(::Valkyrie::ID) && !id_attr.blank?
      return "" unless resource.respond_to?(:alternate_ids)
      resource.alternate_ids.first.to_s
    end
1333156
def get_resource(self, name):
        ''

        if name in self.resources:
            return self.resources[name]
        elif name in self.pushable_resources:
            return self.pushable_resources[name]
        else:
            return False