Class: CropwisePlatformSdk::LicensingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cropwise-platform-sdk/api/licensing_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LicensingApi

Returns a new instance of LicensingApi.



19
20
21
# File 'lib/cropwise-platform-sdk/api/licensing_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cropwise-platform-sdk/api/licensing_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_licensingstatus(opts = {}) ⇒ LicensingStatus

Licensing Status The licensing status returned is grouped by app. Often, the "apps" list will just include one object, which is the calling app. In specific cases (like inter-app integrations), other apps may be configured to share their licensing information with other applications. In this case, you will see this information too if you request it (see "apps" parameter). Querystring parameters: - ‘org`: ID of the Organization to be checked. Mutually exclusive with `account`. - `account`: ID of the workspace (not the User). Mutually exclusive with org. Either `org` or `account` must be present. - `apps`: - description: Which apps should have their licensing info included in the response. - acceptable values: - `me` (default): just the calling app - `all`: the calling app, plus all the apps that have agreed to share licensing information with the calling app (if any). This sharing MAY be partial (for example, entitlements are shared but quotas are not). - `fields`: - description: a comma-separated list of strings specifying fields to include - default value: `entitlements` - acceptable values: - `all`: add all available fields - `entitlements`: add entitlements - `quotas`: add quotas and their usages - `meta`: add all metadata (Accounts and Contracts). Clients can set up to 1KB of metadata for each Contract or Account to make it easier to store free-form external info for human consumption or system integrations. - `meta(account)`: add only Account metadata - `meta(contract)`: add only Contract metadata - `notes`: add contract notes to the response

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :org (String)

    Id of the organization

  • :account (String)

    Id of the workspace

  • :apps (String)

    Which apps should have their licensing info included in the response.

  • :fields (Object)

    Which apps should have their licensing info included in the response

  • :include_deleted_contracts (String)

    Sets if the response will return the deleted contracts or not

Returns:



31
32
33
34
# File 'lib/cropwise-platform-sdk/api/licensing_api.rb', line 31

def get_licensingstatus(opts = {})
  data, _status_code, _headers = get_licensingstatus_with_http_info(opts)
  data
end

#get_licensingstatus_with_http_info(opts = {}) ⇒ Array<(LicensingStatus, Integer, Hash)>

Licensing Status The licensing status returned is grouped by app. Often, the &quot;apps&quot; list will just include one object, which is the calling app. In specific cases (like inter-app integrations), other apps may be configured to share their licensing information with other applications. In this case, you will see this information too if you request it (see &quot;apps&quot; parameter). Querystring parameters: - &#x60;org&#x60;: ID of the Organization to be checked. Mutually exclusive with &#x60;account&#x60;. - &#x60;account&#x60;: ID of the workspace (not the User). Mutually exclusive with org. Either &#x60;org&#x60; or &#x60;account&#x60; must be present. - &#x60;apps&#x60;: - description: Which apps should have their licensing info included in the response. - acceptable values: - &#x60;me&#x60; (default): just the calling app - &#x60;all&#x60;: the calling app, plus all the apps that have agreed to share licensing information with the calling app (if any). This sharing MAY be partial (for example, entitlements are shared but quotas are not). - &#x60;fields&#x60;: - description: a comma-separated list of strings specifying fields to include - default value: &#x60;entitlements&#x60; - acceptable values: - &#x60;all&#x60;: add all available fields - &#x60;entitlements&#x60;: add entitlements - &#x60;quotas&#x60;: add quotas and their usages - &#x60;meta&#x60;: add all metadata (Accounts and Contracts). Clients can set up to 1KB of metadata for each Contract or Account to make it easier to store free-form external info for human consumption or system integrations. - &#x60;meta(account)&#x60;: add only Account metadata - &#x60;meta(contract)&#x60;: add only Contract metadata - &#x60;notes&#x60;: add contract notes to the response

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :org (String)

    Id of the organization

  • :account (String)

    Id of the workspace

  • :apps (String)

    Which apps should have their licensing info included in the response.

  • :fields (Object)

    Which apps should have their licensing info included in the response

  • :include_deleted_contracts (String)

    Sets if the response will return the deleted contracts or not

Returns:

  • (Array<(LicensingStatus, Integer, Hash)>)

    LicensingStatus data, response status code and response headers



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/cropwise-platform-sdk/api/licensing_api.rb', line 45

def get_licensingstatus_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LicensingApi.get_licensingstatus ...'
  end
  allowable_values = ["me", "all"]
  if @api_client.config.client_side_validation && opts[:'apps'] && !allowable_values.include?(opts[:'apps'])
    fail ArgumentError, "invalid value for \"apps\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v2/licensing/status'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
  query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
  query_params[:'apps'] = opts[:'apps'] if !opts[:'apps'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'include_deleted_contracts'] = opts[:'include_deleted_contracts'] if !opts[:'include_deleted_contracts'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LicensingStatus'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"LicensingApi.get_licensingstatus",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#get_licensingstatus\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end