Class: ArtikCloud::TagsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/artikcloud/api/tags_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TagsApi

Returns a new instance of TagsApi.



18
19
20
# File 'lib/artikcloud/api/tags_api.rb', line 18

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/artikcloud/api/tags_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#get_tag_categories(opts = {}) ⇒ TagsEnvelope

Get all categories Get all tags marked as categories

Parameters:

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

    the optional parameters

Returns:



26
27
28
29
# File 'lib/artikcloud/api/tags_api.rb', line 26

def get_tag_categories(opts = {})
  data, _status_code, _headers = get_tag_categories_with_http_info(opts)
  return data
end

#get_tag_categories_with_http_info(opts = {}) ⇒ Array<(TagsEnvelope, Fixnum, Hash)>

Get all categories Get all tags marked as categories

Parameters:

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

    the optional parameters

Returns:

  • (Array<(TagsEnvelope, Fixnum, Hash)>)

    TagsEnvelope data, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/artikcloud/api/tags_api.rb', line 35

def get_tag_categories_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TagsApi.get_tag_categories ..."
  end
  # resource path
  local_var_path = "/tags/categories".sub('{format}','json')

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TagsEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TagsApi#get_tag_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_tag_suggestions(opts = {}) ⇒ TagsEnvelope

Get tag suggestions Get tag suggestions for applications, device types that have been most used with a group of tags.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :entity_type (String)

    Entity type name.

  • :tags (String)

    Comma separated list of tags.

  • :name (String)

    Name of tags used for type ahead.

  • :count (Integer)

    Number of results to return. Max 10.

Returns:



77
78
79
80
# File 'lib/artikcloud/api/tags_api.rb', line 77

def get_tag_suggestions(opts = {})
  data, _status_code, _headers = get_tag_suggestions_with_http_info(opts)
  return data
end

#get_tag_suggestions_with_http_info(opts = {}) ⇒ Array<(TagsEnvelope, Fixnum, Hash)>

Get tag suggestions Get tag suggestions for applications, device types that have been most used with a group of tags.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :entity_type (String)

    Entity type name.

  • :tags (String)

    Comma separated list of tags.

  • :name (String)

    Name of tags used for type ahead.

  • :count (Integer)

    Number of results to return. Max 10.

Returns:

  • (Array<(TagsEnvelope, Fixnum, Hash)>)

    TagsEnvelope data, response status code and response headers



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/artikcloud/api/tags_api.rb', line 90

def get_tag_suggestions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TagsApi.get_tag_suggestions ..."
  end
  if opts[:'entity_type'] && !['TAG', 'APPLICATION', 'DEVICE_TYPE'].include?(opts[:'entity_type'])
    fail ArgumentError, 'invalid value for "entity_type", must be one of TAG, APPLICATION, DEVICE_TYPE'
  end
  # resource path
  local_var_path = "/tags/suggestions".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'entity_type'] = opts[:'entity_type'] if !opts[:'entity_type'].nil?
  query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TagsEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TagsApi#get_tag_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_tags_by_categories(opts = {}) ⇒ TagsEnvelope

Get all tags of categories Get all tags related to the list of categories

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :categories (String)

    Comma separated list of categories.

Returns:



136
137
138
139
# File 'lib/artikcloud/api/tags_api.rb', line 136

def get_tags_by_categories(opts = {})
  data, _status_code, _headers = get_tags_by_categories_with_http_info(opts)
  return data
end

#get_tags_by_categories_with_http_info(opts = {}) ⇒ Array<(TagsEnvelope, Fixnum, Hash)>

Get all tags of categories Get all tags related to the list of categories

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :categories (String)

    Comma separated list of categories.

Returns:

  • (Array<(TagsEnvelope, Fixnum, Hash)>)

    TagsEnvelope data, response status code and response headers



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/artikcloud/api/tags_api.rb', line 146

def get_tags_by_categories_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TagsApi.get_tags_by_categories ..."
  end
  # resource path
  local_var_path = "/tags".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'categories'] = opts[:'categories'] if !opts[:'categories'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TagsEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TagsApi#get_tags_by_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end