Module: Crowdin::ApiResources::Applications

Defined in:
lib/crowdin-api/api_resources/applications.rb

Instance Method Summary collapse

Instance Method Details

#add_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object

Parameters:

  • query (Hash) (defaults to: {}) —

    Request Body

  • application_identifier (String) (defaults to: nil) —

    Identifier of the application

  • path (String) (defaults to: nil) —

    The path is implemented by the application



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/crowdin-api/api_resources/applications.rb', line 45

def add_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  path || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#add_application_kv_record(application_identifier, body = {}) ⇒ Object

Parameters:

  • application_identifier (String) —

    Identifier of the application

  • body (Hash) (defaults to: {}) —

    Request Body



266
267
268
269
270
271
272
273
274
# File 'lib/crowdin-api/api_resources/applications.rb', line 266

def add_application_kv_record(application_identifier, body = {})
  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/applications/#{application_identifier}/storage/kv/records",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

#apply_application_installation_update(identifier, body = {}) ⇒ Object

Parameters:

  • identifier (String) —

    Application Identifier

  • body (Hash) (defaults to: {}) —

    Request Body



238
239
240
241
242
243
244
245
246
# File 'lib/crowdin-api/api_resources/applications.rb', line 238

def apply_application_installation_update(identifier, body = {})
  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/applications/installations/#{identifier}/update",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

Parameters:

  • body (Hash) (defaults to: {}) —

    Request Body



108
109
110
111
112
113
114
115
116
# File 'lib/crowdin-api/api_resources/applications.rb', line 108

def create_application_consent_decision(body = {})
  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/applications/consents",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

Parameters:

  • consent_id (Integer) —

    Consent Decision Identifier



120
121
122
123
124
125
126
127
# File 'lib/crowdin-api/api_resources/applications.rb', line 120

def delete_application_consent_decision(consent_id)
  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/applications/consents/#{consent_id}"
  )
  Web::SendRequest.new(request).perform
end

#delete_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object

Parameters:

  • query (Hash) (defaults to: {}) —

    Request Query Parameters

  • application_identifier (String) (defaults to: nil) —

    Identifier of the application

  • path (String) (defaults to: nil) —

    The path is implemented by the application



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/crowdin-api/api_resources/applications.rb', line 63

def delete_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  path || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#delete_application_installation(identifier, query = {}) ⇒ Object

Parameters:

  • identifier (String) —

    Application Identifier

  • query (Hash) (defaults to: {}) —

    Request Query Parameters



172
173
174
175
176
177
178
179
180
# File 'lib/crowdin-api/api_resources/applications.rb', line 172

def delete_application_installation(identifier, query = {})
  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/applications/installations/#{identifier}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#delete_application_kv_record(application_identifier, key) ⇒ Object

Parameters:

  • application_identifier (String) —

    Identifier of the application

  • key (String) —

    Key of the record



280
281
282
283
284
285
286
287
# File 'lib/crowdin-api/api_resources/applications.rb', line 280

def delete_application_kv_record(application_identifier, key)
  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/applications/#{application_identifier}/storage/kv/records/#{key}"
  )
  Web::SendRequest.new(request).perform
end

Parameters:

  • consent_id (Integer) —

    Consent Decision Identifier

  • body (Array) (defaults to: []) —

    Request Body



132
133
134
135
136
137
138
139
140
# File 'lib/crowdin-api/api_resources/applications.rb', line 132

def edit_application_consent_decision(consent_id, body = [])
  request = Web::Request.new(
    connection,
    :patch,
    "#{config.target_api_url}/applications/consents/#{consent_id}",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

#edit_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object

Parameters:

  • query (Hash) (defaults to: {}) —

    Request Body

  • application_identifier (String) (defaults to: nil) —

    Identifier of the application

  • path (String) (defaults to: nil) —

    The path is implemented by the application



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/crowdin-api/api_resources/applications.rb', line 81

def edit_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  path || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :patch,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#edit_application_installation(identifier, body = []) ⇒ Object

Parameters:

  • identifier (String) —

    Application Identifier

  • body (Array) (defaults to: []) —

    Request Body



198
199
200
201
202
203
204
205
206
# File 'lib/crowdin-api/api_resources/applications.rb', line 198

def edit_application_installation(identifier, body = [])
  request = Web::Request.new(
    connection,
    :patch,
    "#{config.target_api_url}/applications/installations/#{identifier}",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

#edit_application_kv_record(application_identifier, key, body = []) ⇒ Object

Parameters:

  • application_identifier (String) —

    Identifier of the application

  • key (String) —

    Key of the record

  • body (Array) (defaults to: []) —

    Request Body



307
308
309
310
311
312
313
314
315
# File 'lib/crowdin-api/api_resources/applications.rb', line 307

def edit_application_kv_record(application_identifier, key, body = [])
  request = Web::Request.new(
    connection,
    :patch,
    "#{config.target_api_url}/applications/#{application_identifier}/storage/kv/records/#{key}",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

#get_application_data(application_identifier = nil, path = nil) ⇒ Object

Parameters:

  • application_identifier (String) (defaults to: nil) —

    Identifier of the application

  • path (String) (defaults to: nil) —

    The path is implemented by the application



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/crowdin-api/api_resources/applications.rb', line 10

def get_application_data(application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  path || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}"
  )
  Web::SendRequest.new(request).perform
end

#get_application_installation(identifier) ⇒ Object

Parameters:

  • identifier (String) —

    Application Identifier



185
186
187
188
189
190
191
192
# File 'lib/crowdin-api/api_resources/applications.rb', line 185

def get_application_installation(identifier)
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/installations/#{identifier}"
  )
  Web::SendRequest.new(request).perform
end

#get_application_installation_update(identifier) ⇒ Object

Parameters:

  • identifier (String) —

    Application Identifier



225
226
227
228
229
230
231
232
# File 'lib/crowdin-api/api_resources/applications.rb', line 225

def get_application_installation_update(identifier)
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/installations/#{identifier}/update"
  )
  Web::SendRequest.new(request).perform
end

#get_application_kv_record(application_identifier, key) ⇒ Object

Parameters:

  • application_identifier (String) —

    Identifier of the application

  • key (String) —

    Key of the record



293
294
295
296
297
298
299
300
# File 'lib/crowdin-api/api_resources/applications.rb', line 293

def get_application_kv_record(application_identifier, key)
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/#{application_identifier}/storage/kv/records/#{key}"
  )
  Web::SendRequest.new(request).perform
end

#install_application(body = {}) ⇒ Object

Parameters:

  • body (Hash) (defaults to: {}) —

    Request Body



158
159
160
161
162
163
164
165
166
# File 'lib/crowdin-api/api_resources/applications.rb', line 158

def install_application(body = {})
  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/applications/installations",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end

Parameters:

  • query (Hash) (defaults to: {}) —

    Request Query Parameters



96
97
98
99
100
101
102
103
104
# File 'lib/crowdin-api/api_resources/applications.rb', line 96

def list_application_consent_decisions(query = {})
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/consents",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#list_application_installations(query = {}) ⇒ Object

Parameters:

  • query (Hash) (defaults to: {}) —

    Request Query Parameters



145
146
147
148
149
150
151
152
153
# File 'lib/crowdin-api/api_resources/applications.rb', line 145

def list_application_installations(query = {})
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/installations",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#list_application_kv_records(application_identifier, query = {}) ⇒ Object

Parameters:

  • application_identifier (String) —

    Identifier of the application

  • query (Hash) (defaults to: {}) —

    Request Query Parameters



252
253
254
255
256
257
258
259
260
# File 'lib/crowdin-api/api_resources/applications.rb', line 252

def list_application_kv_records(application_identifier, query = {})
  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/#{application_identifier}/storage/kv/records",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#update_or_restore_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object

Parameters:

  • query (Hash) (defaults to: {}) —

    Request Body

  • application_identifier (String) (defaults to: nil) —

    Identifier of the application

  • path (String) (defaults to: nil) —

    The path is implemented by the application



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/crowdin-api/api_resources/applications.rb', line 27

def update_or_restore_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  path || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :put,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#upload_application_bundle(identifier, body = {}) ⇒ Object

Parameters:

  • identifier (String) —

    Application Identifier

  • body (Hash) (defaults to: {}) —

    Request Body



212
213
214
215
216
217
218
219
220
# File 'lib/crowdin-api/api_resources/applications.rb', line 212

def upload_application_bundle(identifier, body = {})
  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/applications/installations/#{identifier}/bundles",
    { params: body }
  )
  Web::SendRequest.new(request).perform
end