Class: ArtikCloud::DevicesSharesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DevicesSharesApi

Returns a new instance of DevicesSharesApi.



18
19
20
# File 'lib/artikcloud/api/devices_shares_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/devices_shares_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#create_share_for_device(device_id, device_share_info, opts = {}) ⇒ DeviceSharingId

Share a device Share a device

Parameters:

  • device_id

    Device ID.

  • device_share_info

    Device object that needs to be added

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/artikcloud/api/devices_shares_api.rb', line 28

def create_share_for_device(device_id, device_share_info, opts = {})
  data, _status_code, _headers = create_share_for_device_with_http_info(device_id, device_share_info, opts)
  return data
end

#create_share_for_device_with_http_info(device_id, device_share_info, opts = {}) ⇒ Array<(DeviceSharingId, Fixnum, Hash)>

Share a device Share a device

Parameters:

  • device_id

    Device ID.

  • device_share_info

    Device object that needs to be added

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

    the optional parameters

Returns:

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

    DeviceSharingId data, response status code and response headers



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
68
69
70
71
72
73
74
75
# File 'lib/artikcloud/api/devices_shares_api.rb', line 39

def create_share_for_device_with_http_info(device_id, device_share_info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesSharesApi.create_share_for_device ..."
  end
  # verify the required parameter 'device_id' is set
  fail ArgumentError, "Missing the required parameter 'device_id' when calling DevicesSharesApi.create_share_for_device" if device_id.nil?
  # verify the required parameter 'device_share_info' is set
  fail ArgumentError, "Missing the required parameter 'device_share_info' when calling DevicesSharesApi.create_share_for_device" if device_share_info.nil?
  # resource path
  local_var_path = "/devices/{deviceId}/shares".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s)

  # 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 = @api_client.object_to_http_body(device_share_info)
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeviceSharingId')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesSharesApi#create_share_for_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_sharing_for_device(device_id, share_id, opts = {}) ⇒ DeviceSharingId

Delete specific share of the given device id Delete specific share of the given device id

Parameters:

  • device_id

    Device ID.

  • share_id

    Share ID.

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

    the optional parameters

Returns:



83
84
85
86
# File 'lib/artikcloud/api/devices_shares_api.rb', line 83

def delete_sharing_for_device(device_id, share_id, opts = {})
  data, _status_code, _headers = delete_sharing_for_device_with_http_info(device_id, share_id, opts)
  return data
end

#delete_sharing_for_device_with_http_info(device_id, share_id, opts = {}) ⇒ Array<(DeviceSharingId, Fixnum, Hash)>

Delete specific share of the given device id Delete specific share of the given device id

Parameters:

  • device_id

    Device ID.

  • share_id

    Share ID.

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

    the optional parameters

Returns:

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

    DeviceSharingId data, response status code and response headers



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
130
# File 'lib/artikcloud/api/devices_shares_api.rb', line 94

def delete_sharing_for_device_with_http_info(device_id, share_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesSharesApi.delete_sharing_for_device ..."
  end
  # verify the required parameter 'device_id' is set
  fail ArgumentError, "Missing the required parameter 'device_id' when calling DevicesSharesApi.delete_sharing_for_device" if device_id.nil?
  # verify the required parameter 'share_id' is set
  fail ArgumentError, "Missing the required parameter 'share_id' when calling DevicesSharesApi.delete_sharing_for_device" if share_id.nil?
  # resource path
  local_var_path = "/devices/{deviceId}/shares/{shareId}".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s).sub('{' + 'shareId' + '}', share_id.to_s)

  # 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(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeviceSharingId')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesSharesApi#delete_sharing_for_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_shares_for_device(device_id, opts = {}) ⇒ DeviceSharingEnvelope

List all shares for the given device id List all shares for the given device id

Parameters:

  • device_id

    Device ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Desired count of items in the result set.

  • :offset (Integer)

    Offset for pagination.

Returns:



139
140
141
142
# File 'lib/artikcloud/api/devices_shares_api.rb', line 139

def get_all_shares_for_device(device_id, opts = {})
  data, _status_code, _headers = get_all_shares_for_device_with_http_info(device_id, opts)
  return data
end

#get_all_shares_for_device_with_http_info(device_id, opts = {}) ⇒ Array<(DeviceSharingEnvelope, Fixnum, Hash)>

List all shares for the given device id List all shares for the given device id

Parameters:

  • device_id

    Device ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Desired count of items in the result set.

  • :offset (Integer)

    Offset for pagination.

Returns:

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

    DeviceSharingEnvelope data, response status code and response headers



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
180
181
182
183
184
185
186
187
# File 'lib/artikcloud/api/devices_shares_api.rb', line 151

def get_all_shares_for_device_with_http_info(device_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesSharesApi.get_all_shares_for_device ..."
  end
  # verify the required parameter 'device_id' is set
  fail ArgumentError, "Missing the required parameter 'device_id' when calling DevicesSharesApi.get_all_shares_for_device" if device_id.nil?
  # resource path
  local_var_path = "/devices/{deviceId}/shares".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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 => 'DeviceSharingEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesSharesApi#get_all_shares_for_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sharing_for_device(device_id, share_id, opts = {}) ⇒ DeviceSharing

Get specific share of the given device id Get specific share of the given device id

Parameters:

  • device_id

    Device ID.

  • share_id

    Share ID.

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

    the optional parameters

Returns:



195
196
197
198
# File 'lib/artikcloud/api/devices_shares_api.rb', line 195

def get_sharing_for_device(device_id, share_id, opts = {})
  data, _status_code, _headers = get_sharing_for_device_with_http_info(device_id, share_id, opts)
  return data
end

#get_sharing_for_device_with_http_info(device_id, share_id, opts = {}) ⇒ Array<(DeviceSharing, Fixnum, Hash)>

Get specific share of the given device id Get specific share of the given device id

Parameters:

  • device_id

    Device ID.

  • share_id

    Share ID.

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

    the optional parameters

Returns:

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

    DeviceSharing data, response status code and response headers



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/artikcloud/api/devices_shares_api.rb', line 206

def get_sharing_for_device_with_http_info(device_id, share_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesSharesApi.get_sharing_for_device ..."
  end
  # verify the required parameter 'device_id' is set
  fail ArgumentError, "Missing the required parameter 'device_id' when calling DevicesSharesApi.get_sharing_for_device" if device_id.nil?
  # verify the required parameter 'share_id' is set
  fail ArgumentError, "Missing the required parameter 'share_id' when calling DevicesSharesApi.get_sharing_for_device" if share_id.nil?
  # resource path
  local_var_path = "/devices/{deviceId}/shares/{shareId}".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s).sub('{' + 'shareId' + '}', share_id.to_s)

  # 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 => 'DeviceSharing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesSharesApi#get_sharing_for_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end