Package com.ads.api.util

# Class AssociationUtil

java.lang.Object
com.ads.api.util.BaseUtil
com.ads.api.util.AssociationUtil

public class AssociationUtil extends com.ads.api.util.BaseUtil
Contains the methods related to perform the associations between the Business Objects etc.

RequestStatus return type methods will result in being returned as either true or false as its status.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.ads.api.util.BaseUtil

  `com.ads.api.util.BaseUtil.TokenType`

- ## Field Summary

  ### Fields inherited from class com.ads.api.util.BaseUtil

  `AUTH_TOKEN, AUTH_TOKEN_TYPE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RequestStatus`
  `createAssociation(Association association)`
  Creates the association for the given association object.
  `String`
  `createAssociationAs(String association, String outputFormat)`
  Creates the association for the given association object.
  `RequestStatus`
  `createAssociations(List<Association> associations)`
  Creates the associations for the given list of association objects.
  `String`
  `createAssociationsAs(String associations, String outputFormat)`
  Creates the associations for the given list of association objects.
  `RequestStatus`
  `deleteAssociation(int associationId)`
  Deletes the association with the specified associationId.
  `String`
  `deleteAssociationAs(int associationId, String outputFormat)`
  Deletes the association with the specified associationId.
  `RequestStatus`
  `deleteAssociations(int objectId, int objectTypeId)`
  Deletes the associations with the specified objectId and objectTypeId.
  `RequestStatus`
  `deleteAssociations(List<Integer> associationIds)`
  Deletes the associations with the specified list of associationIds.
  `String`
  `deleteAssociationsAs(String associationIds, String outputFormat)`
  Deletes the associations with the specified list of associationIds.
  `String`
  `deleteAssociationsByObjectTypeAs(int objectId, int objectTypeId, String outputFormat)`
  Deletes the associations with the specified objectId and objectTypeId.
  `Association`
  `getAssociation(int associationId)`
  Returns the association object for the specified associationId.
  `Association`
  `getAssociation(int associationId, boolean fillInfo)`
  Returns the association object for the specified associationId and fillInfo.
  `String`
  `getAssociationAs(int associationId, boolean fillInfo, String outputFormat)`
  Returns the association object for the specified associationId and fillInfo.
  `String`
  `getAssociationAs(int associationId, String outputFormat)`
  Returns the association object for the specified associationId.
  `List<Association>`
  `getAssociations(int objectId, int objectTypeId)`
  Returns the list association objects for the specified sourceObjectId and sourceObjectTypeId.
  `List<Association>`
  `getAssociations(int objectId, int objectTypeId, boolean fillInfo)`
  Returns the list association objects for the specified objectId, objectTypeId and fillInfo.
  `List<Association>`
  `getAssociations(List<Integer> associationIds)`
  Returns the list association objects for the specified list of associationIds.
  `List<Association>`
  `getAssociations(List<Integer> associationIds, boolean fillInfo)`
  Returns the list association objects for the specified list of associationIds and fillInfo.
  `String`
  `getAssociationsAs(String associationIds, boolean fillInfo, String outputFormat)`
  Returns the list association objects for the specified list of associationIds and fillInfo.
  `String`
  `getAssociationsAs(String associationIds, String outputFormat)`
  Returns the list association objects for the specified list of associationIds.
  `String`
  `getAssociationsByObjectTypeAs(int objectId, int objectTypeId, boolean fillInfo, String outputFormat)`
  Returns the list association objects for the specified objectId, objectTypeId and fillInfo.
  `String`
  `getAssociationsByObjectTypeAs(int objectId, int objectTypeId, String outputFormat)`
  Returns the list association objects for the specified objectId and objectTypeId.
  `RequestStatus`
  `updateAssociation(Association association)`
  Updates the association for the given association object.
  `String`
  `updateAssociationAs(String association, String outputFormat)`
  Updates the association for the given association object.
  `RequestStatus`
  `updateAssociations(List<Association> associations)`
  Updates the associations for the given list of association objects.
  `String`
  `updateAssociationsAs(String associations, String outputFormat)`
  Updates the associations for the given list of association objects.

  ### Methods inherited from class com.ads.api.util.BaseUtil

  `getAccessToken, getAccessTokenType, getTokenType, getUserDetails, permissionDeniedMessage, permissionDeniedStatus, setAccessToken, setAccessTokenType`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### createAssociation

    public RequestStatus createAssociation(Association association)
    Creates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, while creating the association.
    If association is created successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `association` - Association
    Returns:
      RequestStatus object
    Since:
      12.0

  - ### createAssociations

    public RequestStatus createAssociations(List<Association> associations)
    Creates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, while creating the associations.
    If associations are created successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `associations` - List of Association
    Returns:
      RequestStatus object
    Since:
      12.0

  - ### updateAssociation

    public RequestStatus updateAssociation(Association association)
    Updates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, to update the association.
    If association is updated successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `association` - Association
    Returns:
      RequestStatus object
    Since:
      12.0

  - ### updateAssociations

    public RequestStatus updateAssociations(List<Association> associations) throws Exception
    Updates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, to update the associations.
    If associations are updated successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `associations` - List of Association
    Returns:
      RequestStatus object
    Throws:
      `Exception`
    Since:
      12.0

  - ### deleteAssociation

    public RequestStatus deleteAssociation(int associationId)
    Deletes the association with the specified associationId. Specifying the associationId is mandatory to delete a particular association.
    If the association is deleted all its associated data will also be deleted.
    If association is deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `associationId` - int
    Returns:
      RequestStatus object
    Since:
      12.0

  - ### deleteAssociations

    public RequestStatus deleteAssociations(List<Integer> associationIds)
    Deletes the associations with the specified list of associationIds. Specifying the associationIds list is mandatory.
    If the associations are deleted all its associated data will also be deleted.
    If the associations are deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `associationIds` - List of associationIds
    Returns:
      RequestStatus object
    Since:
      12.0

  - ### deleteAssociations

    public RequestStatus deleteAssociations(int objectId, int objectTypeId)
    Deletes the associations with the specified objectId and objectTypeId. Specifying the objectId and objectTypeId are mandatory.
    If the associations are deleted all its associated data will also be deleted.
    If the associations are deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `objectId` - int
      `objectTypeId` - int
    Returns:
      RequestStatus object
    Since:
      12.0

  - ### getAssociation

    public Association getAssociation(int associationId) throws Exception
    Returns the association object for the specified associationId. Specifying the associationId is mandatory.
    It returns all the details like association name, description, auditHistory details etc..
    Parameters:
      `associationId` - int
    Returns:
      Association object
    Throws:
      `Exception`
    Since:
      12.0

  - ### getAssociations

    public List<Association> getAssociations(List<Integer> associationIds) throws Exception
    Returns the list association objects for the specified list of associationIds. Specifying the list of associationIds is mandatory.
    It returns all the details like association name, description, auditHistory details etc..
    Parameters:
      `associationIds` - List
    Returns:
      List of Association objects
    Throws:
      `Exception`
    Since:
      12.0

  - ### getAssociations

    public List<Association> getAssociations(int objectId, int objectTypeId) throws Exception
    Returns the list association objects for the specified sourceObjectId and sourceObjectTypeId. Specifying the sourceObjectId and sourceObjectTypeId is mandatory.
    It returns all the details like association name, description, auditHistory details etc..
    Parameters:
      `objectId` - int
      `objectTypeId` - int
    Returns:
      List of Association objects
    Throws:
      `Exception`
    Since:
      12.0

  - ### createAssociationAs

    public String createAssociationAs(String association, String outputFormat)
    Creates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, while creating the association.
    Here relationshipType has values FORWARD, REVERSE and BOTH.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `association` - String
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - If association is created successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'Association' JSON :
      {
      "id": 0,
      "sourceObjectId": 0,
      "sourceObjectTypeId": 0,
      "targetObjectId": 0,
      "targetObjectTypeId": 0,
      "qualifierObjectId": 0,
      "qualifierObjectTypeId": 0,
      "fields": {},
      "relationship":{
      "id": "",
      "masterId": "",
      "titleForward": "",
      "titleReverse": "",
      "description":"",
      "definedBy": "SYSTEM",
      "relationshipType": "FORWARD"
      }
      }

    Since:
      12.0

  - ### createAssociationsAs

    public String createAssociationsAs(String associations, String outputFormat)
    Creates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, while creating the associations.
    Here relationshipType has values FORWARD, REVERSE and BOTH.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associations` - String
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - If associations are created successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'Associations' JSON :
      [
      {
      "id": 0,
      "sourceObjectId": 0,
      "sourceObjectTypeId": 0,
      "targetObjectId": 0,
      "targetObjectTypeId": 0,
      "qualifierObjectId": 0,
      "qualifierObjectTypeId": 0,
      "fields": {},
      "relationship":{
      "id": "",
      "masterId": "",
      "titleForward": "",
      "titleReverse": "",
      "description":"",
      "definedBy": "SYSTEM",
      "relationshipType": "FORWARD"
      }
      },
      {
      " id": 0,
      "sourceObjectId": 0,
      "sourceObjectTypeId": 0,
      "targetObjectId": 0,
      "targetObjectTypeId": 0,
      "qualifierObjectId": 0,
      "qualifierObjectTypeId": 0,
      "fields": {},
      "relationship":{
      "id": "",
      "masterId": "",
      "titleForward": "",
      "titleReverse": "",
      "description":"",
      "definedBy": "SYSTEM",
      "relationshipType": "FORWARD"
      }
      }
      ]

    Since:
      12.0

  - ### updateAssociationAs

    public String updateAssociationAs(String association, String outputFormat)
    Updates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, to update the association.
    Here relationshipType has values FORWARD, REVERSE and BOTH.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `association` - String
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - If association is updated successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'Association' JSON :
      {
      "id": 0,
      "sourceObjectId": 0,
      "sourceObjectTypeId": 0,
      "targetObjectId": 0,
      "targetObjectTypeId": 0,
      "qualifierObjectId": 0,
      "qualifierObjectTypeId": 0,
      "fields": {},
      "relationship":{
      "id": "",
      "masterId": "",
      "titleForward": "",
      "titleReverse": "",
      "description":"",
      "definedBy": "SYSTEM",
      "relationshipType": "FORWARD"
      }
      }

    Since:
      12.0

  - ### updateAssociationsAs

    public String updateAssociationsAs(String associations, String outputFormat)
    Updates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, to update the associations.
    Here relationshipType has values FORWARD, REVERSE and BOTH.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associations` - String - List of association objects
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - If associations are updated successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'Associations' JSON :
      [
      {
      "id": 0,
      "sourceObjectId": 0,
      "sourceObjectTypeId": 0,
      "targetObjectId": 0,
      "targetObjectTypeId": 0,
      "qualifierObjectId": 0,
      "qualifierObjectTypeId": 0,
      "fields": {},
      "relationship":{
      "id": "",
      "masterId": "",
      "titleForward": "",
      "titleReverse": "",
      "description":"",
      "definedBy": "SYSTEM",
      "relationshipType": "FORWARD"
      }
      },
      {
      " id": 0,
      "sourceObjectId": 0,
      "sourceObjectTypeId": 0,
      "targetObjectId": 0,
      "targetObjectTypeId": 0,
      "qualifierObjectId": 0,
      "qualifierObjectTypeId": 0,
      "fields": {},
      "relationship":{
      "id": "",
      "masterId": "",
      "titleForward": "",
      "titleReverse": "",
      "description":"",
      "definedBy": "SYSTEM",
      "relationshipType": "FORWARD"
      }
      }
      ]

    Since:
      12.0

  - ### deleteAssociationAs

    public String deleteAssociationAs(int associationId, String outputFormat)
    Deletes the association with the specified associationId. Specifying the associationId is mandatory to delete a particular association.
    If the association is deleted all its associated data will also be deleted.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associationId` - int
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - If association is deleted successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.
    Since:
      12.0

  - ### deleteAssociationsAs

    public String deleteAssociationsAs(String associationIds, String outputFormat)
    Deletes the associations with the specified list of associationIds. Specifying the associationIds list is mandatory.
    If the associations are deleted all its associated data will also be deleted.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associationIds` - String
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - If association is deleted successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.
    Since:
      12.0

  - ### deleteAssociationsByObjectTypeAs

    public String deleteAssociationsByObjectTypeAs(int objectId, int objectTypeId, String outputFormat)
    Deletes the associations with the specified objectId and objectTypeId. Specifying the objectId and objectTypeId are mandatory.
    If the associations are deleted all its associated data will also be deleted.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectId` - int
      `objectTypeId` - int
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - If associations are deleted successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.
    Since:
      12.0

  - ### getAssociationAs

    public String getAssociationAs(int associationId, String outputFormat)
    Returns the association object for the specified associationId. Specifying the associationId is mandatory.
    It returns all the details like association name, description, auditHistory details etc..
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associationId` - int
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - Association object in the form of JSON or XML.
    Since:
      12.0

  - ### getAssociationsAs

    public String getAssociationsAs(String associationIds, String outputFormat)
    Returns the list association objects for the specified list of associationIds. Specifying the list of associationIds is mandatory.
    It returns all the details like association name, description, auditHistory details etc..
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associationIds` - String
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - List of Association objects in the form of JSON or XML.
    Since:
      12.0

  - ### getAssociationsByObjectTypeAs

    public String getAssociationsByObjectTypeAs(int objectId, int objectTypeId, String outputFormat)
    Returns the list association objects for the specified objectId and objectTypeId. Specifying the objectId and objectTypeId is mandatory.
    It returns all the details like association name, description, auditHistory details etc..
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectId` -
      `objectTypeId` -
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String - List of Association objects in the form of JSON or XML.
    Since:
      12.0

  - ### getAssociation

    public Association getAssociation(int associationId, boolean fillInfo) throws Exception
    Returns the association object for the specified associationId and fillInfo. Specifying the associationId is mandatory.
    FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
    Parameters:
      `associationId` - int
      `fillInfo` - boolean
    Returns:
      Association object in the form of JSON or XML.
    Throws:
      `Exception`
    Since:
      12.1

  - ### getAssociations

    public List<Association> getAssociations(List<Integer> associationIds, boolean fillInfo) throws Exception
    Returns the list association objects for the specified list of associationIds and fillInfo. Specifying the associationIds list is mandatory.
    FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
    Parameters:
      `associationIds` - List
      `fillInfo` - boolean
    Returns:
      List of Association objects in the form of JSON or XML.
    Throws:
      `Exception`
    Since:
      12.1

  - ### getAssociations

    public List<Association> getAssociations(int objectId, int objectTypeId, boolean fillInfo) throws Exception
    Returns the list association objects for the specified objectId, objectTypeId and fillInfo. Specifying the objectId and objectTypeId is mandatory.
    FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
    Parameters:
      `objectId` - int
      `objectTypeId` - int
      `fillInfo` - boolean
    Returns:
      String
    Throws:
      `Exception`
    Since:
      12.1

  - ### getAssociationAs

    public String getAssociationAs(int associationId, boolean fillInfo, String outputFormat)
    Returns the association object for the specified associationId and fillInfo. Specifying the associationId is mandatory.
    FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associationId` - int
      `fillInfo` - boolean
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String
    Since:
      12.1

  - ### getAssociationsAs

    public String getAssociationsAs(String associationIds, boolean fillInfo, String outputFormat)
    Returns the list association objects for the specified list of associationIds and fillInfo. Specifying the associationIds list is mandatory.
    FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `associationIds` - String
      `fillInfo` - boolean
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String
    Since:
      12.1

  - ### getAssociationsByObjectTypeAs

    public String getAssociationsByObjectTypeAs(int objectId, int objectTypeId, boolean fillInfo, String outputFormat)
    Returns the list association objects for the specified objectId, objectTypeId and fillInfo. Specifying the objectId and objectTypeId is mandatory.
    FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
    OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectId` - int
      `objectTypeId` - int
      `fillInfo` - boolean
      `outputFormat` - String- Valid values: JSON or XML
    Returns:
      String
    Since:
      12.1