src/main/java/com/squareup/connect/api/CatalogApi.java
public CompleteResponse<RetrieveCatalogObjectResponse>retrieveCatalogObjectWithHttpInfo(String objectId, Boolean includeRelatedObjects) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'objectId' is set
    if (objectId == null) {
      throw new ApiException(400, "Missing the required parameter 'objectId' when calling retrieveCatalogObject");
    }
    
    // create path and map variables
    String localVarPath = "/v2/catalog/object/{object_id}"
      .replaceAll("\\{" + "object_id" + "\\}", apiClient.escapeString(objectId.toString()));

    // query params
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    localVarHeaderParams.put("Square-Version", "2019-11-20");
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_related_objects", includeRelatedObjects));

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] { "oauth2" };

    GenericType<RetrieveCatalogObjectResponse> localVarReturnType = new GenericType<RetrieveCatalogObjectResponse>() {};
    return (CompleteResponse<RetrieveCatalogObjectResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
/**
   * RetrieveCatalogObject
   * Returns a single [CatalogItem](#type-catalogitem) as a [CatalogObject](#type-catalogobject) based on the provided ID. The returned object includes all of the relevant [CatalogItem](#type-catalogitem) information including: [CatalogItemVariation](#type-catalogitemvariation) children, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
   * @param objectId The object ID of any type of catalog objects to be retrieved. (required)
   * @param includeRelatedObjects If &#x60;true&#x60;, the response will include additional objects that are related to the requested object, as follows:  If the &#x60;object&#x60; field of the response contains a CatalogItem, its associated CatalogCategory, CatalogTax objects, CatalogImages and CatalogModifierLists will be returned in the &#x60;related_objects&#x60; field of the response. If the &#x60;object&#x60; field of the response contains a CatalogItemVariation, its parent CatalogItem will be returned in the &#x60;related_objects&#x60; field of the response.  Default value: &#x60;false&#x60; (optional)
   * @return CompleteResponse<RetrieveCatalogObjectResponse>
   * @throws ApiException if fails to make API call
   */
RetrieveCatalogObject
Returns a single [CatalogItem](#type-catalogitem) as a [CatalogObject](#type-catalogobject) based on the provided ID. The returned object includes all of the relevant [CatalogItem](#type-catalogitem) information including: [CatalogItemVariation](#type-catalogitemvariation) children, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
@param objectId The object ID of any type of catalog objects to be retrieved.
RetrieveCatalogObject Returns a single [ CatalogItem ] ( #type - catalogitem ) as a [ CatalogObject ] ( #type - catalogobject ) based on the provided ID . The returned object includes all of the relevant [ CatalogItem ] ( #type - catalogitem ) information including : [ CatalogItemVariation ] ( #type - catalogitemvariation ) children references to its [ CatalogModifierList ] ( #type - catalogmodifierlist ) objects and the ids of any [ CatalogTax ] ( #type - catalogtax ) objects that apply to it . @param objectId The object ID of any type of catalog objects to be retrieved .
public CompleteResponse<RetrieveCatalogObjectResponse>retrieveCatalogObjectWithHttpInfo(String objectId, Boolean includeRelatedObjects) throws ApiException {
    Object localVarPostBody = null;
    if (objectId == null) {
      throw new ApiException(400, "Missing the required parameter 'objectId' when calling retrieveCatalogObject");
    }
    String localVarPath = "/v2/catalog/object/{object_id}"
      .replaceAll("\\{" + "object_id" + "\\}", apiClient.escapeString(objectId.toString()));
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    localVarHeaderParams.put("Square-Version", "2019-11-20");
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_related_objects", includeRelatedObjects));
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    String[] localVarAuthNames = new String[] { "oauth2" };
    GenericType<RetrieveCatalogObjectResponse> localVarReturnType = new GenericType<RetrieveCatalogObjectResponse>() {};
    return (CompleteResponse<RetrieveCatalogObjectResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
public CompleteResponse < RetrieveCatalogObjectResponse > retrieveCatalogObjectWithHttpInfo ( String objectId , Boolean includeRelatedObjects ) throws ApiException { Object localVarPostBody = null ; if ( objectId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'objectId' when calling retrieveCatalogObject" ) ; } String localVarPath = "/v2/catalog/object/{object_id}" . replaceAll ( "\\{" + "object_id" + "\\}" , apiClient . escapeString ( objectId . toString ( ) ) ) ; List < Pair > localVarQueryParams = new ArrayList < Pair > ( ) ; Map < String , String > localVarHeaderParams = new HashMap < String , String > ( ) ; Map < String , Object > localVarFormParams = new HashMap < String , Object > ( ) ; localVarHeaderParams . put ( "Square-Version" , "2019-11-20" ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "include_related_objects" , includeRelatedObjects ) ) ; final String [ ] localVarAccepts = { "application/json" } ; final String localVarAccept = apiClient . selectHeaderAccept ( localVarAccepts ) ; final String [ ] localVarContentTypes = { "application/json" } ; final String localVarContentType = apiClient . selectHeaderContentType ( localVarContentTypes ) ; String [ ] localVarAuthNames = new String [ ] { "oauth2" } ; GenericType < RetrieveCatalogObjectResponse > localVarReturnType = new GenericType < RetrieveCatalogObjectResponse > ( ) { } ; return ( CompleteResponse < RetrieveCatalogObjectResponse > ) apiClient . invokeAPI ( localVarPath , "GET" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; }
RetrieveCatalogObject
 Returns a single [CatalogItem](#type-catalogitem) as a [CatalogObject](#type-catalogobject) based on the provided ID.
RetrieveCatalogObject Returns a single [ CatalogItem ] ( #type - catalogitem ) as a [ CatalogObject ] ( #type - catalogobject ) based on the provided ID .
// verify the required parameter 'objectId' is set // create path and map variables // query params