# Class: OrgResourceService

## tibco.objectapi.service.OrgResourceService

#### new OrgResourceService()

### Methods

#### archivedResources(request, callback)

When resources are deleted, a summary of their records are maintained in order to allow process and work-item administration to be completed. This function allows those summary records to be retrieved. The results can be paged, or the entire result set can be returned in one call.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.ArchivedResourcesRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `GetDeletedResourcesResponseType`.

#### createResource(request, callback)

Having retrieved a list of the candidate Resources, this method allows the caller to create resources from the LDAP references returned with each candidate resources. The response returns the GUID assigned to the newly created resources. Each element in the response identifies the candidate to which it relates using the Primary LDAP Source reference and the LDAP Container ID.

If a resource already exists with a given LDAP references, no update is made to that resource and the GUID of the existing resource is returned in the response (along with a boolean attribute "already-present").

For those candidates for which a resource could not be created (due to some logical error, rather than a system failure), the response will include a "failure" element identifying the candidate and giving a reason for the failure. System failures are reported using a Fault response.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.CreateResourceRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `CreateResourceResponseType`.

#### deleteResource(request, callback)

Deletes the resources identified by the given GUIDs. Any associations the resource holds are also deleted. Any interested parties are notified of the deletion before it occurs, but cannot veto the deletion.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.DeleteResourceRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `DeleteResourceResponseType`.

#### findByEntity(request, callback)

Searches for resources by their associated organization model entity. For example, return all resource belonging to an identified position.

The parameter "aDeep" determines whether the search for resources should extend to logical associations (true). This only applies to groups (where sub-groups will also be included) and locations (where associations by positions, organization units, and organizations will be included). For other entity types, this attribute is ignored.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.FindByEntityRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `FindResourcesResponseType`.

#### findByName(request, callback)

Searches for resources by their name. There may be two or more resources that share the same name, so the response may include more than one result for each name provided.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.FindByNameRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `FindResourcesResponseType`.

#### getResource(request, callback)

Returns detailed information for the resources identified by their GUIDs. The model version, in the request, identifies the org-model major version from which the resources' model entity associations are to be taken. The default value of -1 indicates that the latest version should be used.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.GetResourceRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `GetResourceResponseType`.

#### purgeDeletedResources(request, callback)

When resources are deleted, a summary of their records are maintained in order to allow process and work item administration to be completed. This function allows those deletion records to be permanently purged.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.PurgeDeletedResourcesRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `PurgeDeletedResourcesResponseType`.

#### updateResource(request, callback)

Updates the resources identified by their GUIDs. The model version, in the request, identifies the organization model major version from which the resources' model entity associations are to be taken. The default value of -1 indicates that the latest version should be used.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.UpdateResourceRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `UpdateResourceResponseType`.