azure_mgmt_marketplace_ordering 0.17.0 → 0.17.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c12e263a0aaa0d121b24492b3687f92c3f2eb66e
4
- data.tar.gz: 856dfba54a289070d0d6ff96b2d83feddeb390d4
2
+ SHA256:
3
+ metadata.gz: af7fd29f1b23890a5100fbde937360af761efb32f6cca3cbb9006b5ac4fae695
4
+ data.tar.gz: f7397948cef2a84e7aba48f2f4e24e4837009e0445b7b7ae73ce27dc3ff8dbbc
5
5
  SHA512:
6
- metadata.gz: cc1a82fa54246b7520b65c7151b58fe2496b72097452a92ba869855284414c92920521b3119cdc321f24f422660980fe5a955a5ac3d26d9d1bb80789440a65dd
7
- data.tar.gz: 28011e830a2307420b4f33b60462dc17347a6d2ed018751b6046cf1cba669581ab7d83cd4db0e298163633f29efa8d8219188dade51b4e0cef0556b233800f2b
6
+ metadata.gz: 1cc330d7cdfd281489e8e428934897a0745a3a315034c06aa1f12d5be6938ad737f79f92a559b9ea5654616157124b5c7e47ebe57a76e8d6f7106e1b7ccfc414
7
+ data.tar.gz: c22f6750aba5619243fddeaf68abe7cb6ed608c83f6ec32f2e462fda3062642e6da245a58746f3be17e3a01b013b525c1739ed4aa32c3f3519ef59453fabdb91
@@ -235,5 +235,402 @@ module Azure::MarketplaceOrdering::Mgmt::V2015_06_01
235
235
  promise.execute
236
236
  end
237
237
 
238
+ #
239
+ # Sign marketplace terms.
240
+ #
241
+ # @param publisher_id [String] Publisher identifier string of image being
242
+ # deployed.
243
+ # @param offer_id [String] Offer identifier string of image being deployed.
244
+ # @param plan_id [String] Plan identifier string of image being deployed.
245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
+ # will be added to the HTTP request.
247
+ #
248
+ # @return [AgreementTerms] operation results.
249
+ #
250
+ def sign(publisher_id, offer_id, plan_id, custom_headers:nil)
251
+ response = sign_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
252
+ response.body unless response.nil?
253
+ end
254
+
255
+ #
256
+ # Sign marketplace terms.
257
+ #
258
+ # @param publisher_id [String] Publisher identifier string of image being
259
+ # deployed.
260
+ # @param offer_id [String] Offer identifier string of image being deployed.
261
+ # @param plan_id [String] Plan identifier string of image being deployed.
262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
263
+ # will be added to the HTTP request.
264
+ #
265
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
266
+ #
267
+ def sign_with_http_info(publisher_id, offer_id, plan_id, custom_headers:nil)
268
+ sign_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
269
+ end
270
+
271
+ #
272
+ # Sign marketplace terms.
273
+ #
274
+ # @param publisher_id [String] Publisher identifier string of image being
275
+ # deployed.
276
+ # @param offer_id [String] Offer identifier string of image being deployed.
277
+ # @param plan_id [String] Plan identifier string of image being deployed.
278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
279
+ # to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
282
+ #
283
+ def sign_async(publisher_id, offer_id, plan_id, custom_headers:nil)
284
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
285
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
286
+ fail ArgumentError, 'publisher_id is nil' if publisher_id.nil?
287
+ fail ArgumentError, 'offer_id is nil' if offer_id.nil?
288
+ fail ArgumentError, 'plan_id is nil' if plan_id.nil?
289
+
290
+
291
+ request_headers = {}
292
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
293
+
294
+ # Set Headers
295
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
296
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
297
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign'
298
+
299
+ request_url = @base_url || @client.base_url
300
+
301
+ options = {
302
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
303
+ path_params: {'subscriptionId' => @client.subscription_id,'publisherId' => publisher_id,'offerId' => offer_id,'planId' => plan_id},
304
+ query_params: {'api-version' => @client.api_version},
305
+ headers: request_headers.merge(custom_headers || {}),
306
+ base_url: request_url
307
+ }
308
+ promise = @client.make_request_async(:post, path_template, options)
309
+
310
+ promise = promise.then do |result|
311
+ http_response = result.response
312
+ status_code = http_response.status
313
+ response_content = http_response.body
314
+ unless status_code == 200
315
+ error_model = JSON.load(response_content)
316
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
317
+ end
318
+
319
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
320
+ # Deserialize Response
321
+ if status_code == 200
322
+ begin
323
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
324
+ result_mapper = Azure::MarketplaceOrdering::Mgmt::V2015_06_01::Models::AgreementTerms.mapper()
325
+ result.body = @client.deserialize(result_mapper, parsed_response)
326
+ rescue Exception => e
327
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
328
+ end
329
+ end
330
+
331
+ result
332
+ end
333
+
334
+ promise.execute
335
+ end
336
+
337
+ #
338
+ # Cancel marketplace terms.
339
+ #
340
+ # @param publisher_id [String] Publisher identifier string of image being
341
+ # deployed.
342
+ # @param offer_id [String] Offer identifier string of image being deployed.
343
+ # @param plan_id [String] Plan identifier string of image being deployed.
344
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
345
+ # will be added to the HTTP request.
346
+ #
347
+ # @return [AgreementTerms] operation results.
348
+ #
349
+ def cancel(publisher_id, offer_id, plan_id, custom_headers:nil)
350
+ response = cancel_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
351
+ response.body unless response.nil?
352
+ end
353
+
354
+ #
355
+ # Cancel marketplace terms.
356
+ #
357
+ # @param publisher_id [String] Publisher identifier string of image being
358
+ # deployed.
359
+ # @param offer_id [String] Offer identifier string of image being deployed.
360
+ # @param plan_id [String] Plan identifier string of image being deployed.
361
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
362
+ # will be added to the HTTP request.
363
+ #
364
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
365
+ #
366
+ def cancel_with_http_info(publisher_id, offer_id, plan_id, custom_headers:nil)
367
+ cancel_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
368
+ end
369
+
370
+ #
371
+ # Cancel marketplace terms.
372
+ #
373
+ # @param publisher_id [String] Publisher identifier string of image being
374
+ # deployed.
375
+ # @param offer_id [String] Offer identifier string of image being deployed.
376
+ # @param plan_id [String] Plan identifier string of image being deployed.
377
+ # @param [Hash{String => String}] A hash of custom headers that will be added
378
+ # to the HTTP request.
379
+ #
380
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
381
+ #
382
+ def cancel_async(publisher_id, offer_id, plan_id, custom_headers:nil)
383
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
384
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
385
+ fail ArgumentError, 'publisher_id is nil' if publisher_id.nil?
386
+ fail ArgumentError, 'offer_id is nil' if offer_id.nil?
387
+ fail ArgumentError, 'plan_id is nil' if plan_id.nil?
388
+
389
+
390
+ request_headers = {}
391
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
392
+
393
+ # Set Headers
394
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
395
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
396
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel'
397
+
398
+ request_url = @base_url || @client.base_url
399
+
400
+ options = {
401
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
402
+ path_params: {'subscriptionId' => @client.subscription_id,'publisherId' => publisher_id,'offerId' => offer_id,'planId' => plan_id},
403
+ query_params: {'api-version' => @client.api_version},
404
+ headers: request_headers.merge(custom_headers || {}),
405
+ base_url: request_url
406
+ }
407
+ promise = @client.make_request_async(:post, path_template, options)
408
+
409
+ promise = promise.then do |result|
410
+ http_response = result.response
411
+ status_code = http_response.status
412
+ response_content = http_response.body
413
+ unless status_code == 200
414
+ error_model = JSON.load(response_content)
415
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
416
+ end
417
+
418
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
419
+ # Deserialize Response
420
+ if status_code == 200
421
+ begin
422
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
423
+ result_mapper = Azure::MarketplaceOrdering::Mgmt::V2015_06_01::Models::AgreementTerms.mapper()
424
+ result.body = @client.deserialize(result_mapper, parsed_response)
425
+ rescue Exception => e
426
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
427
+ end
428
+ end
429
+
430
+ result
431
+ end
432
+
433
+ promise.execute
434
+ end
435
+
436
+ #
437
+ # Get marketplace agreement.
438
+ #
439
+ # @param publisher_id [String] Publisher identifier string of image being
440
+ # deployed.
441
+ # @param offer_id [String] Offer identifier string of image being deployed.
442
+ # @param plan_id [String] Plan identifier string of image being deployed.
443
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
444
+ # will be added to the HTTP request.
445
+ #
446
+ # @return [AgreementTerms] operation results.
447
+ #
448
+ def get_agreement(publisher_id, offer_id, plan_id, custom_headers:nil)
449
+ response = get_agreement_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
450
+ response.body unless response.nil?
451
+ end
452
+
453
+ #
454
+ # Get marketplace agreement.
455
+ #
456
+ # @param publisher_id [String] Publisher identifier string of image being
457
+ # deployed.
458
+ # @param offer_id [String] Offer identifier string of image being deployed.
459
+ # @param plan_id [String] Plan identifier string of image being deployed.
460
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
461
+ # will be added to the HTTP request.
462
+ #
463
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
464
+ #
465
+ def get_agreement_with_http_info(publisher_id, offer_id, plan_id, custom_headers:nil)
466
+ get_agreement_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
467
+ end
468
+
469
+ #
470
+ # Get marketplace agreement.
471
+ #
472
+ # @param publisher_id [String] Publisher identifier string of image being
473
+ # deployed.
474
+ # @param offer_id [String] Offer identifier string of image being deployed.
475
+ # @param plan_id [String] Plan identifier string of image being deployed.
476
+ # @param [Hash{String => String}] A hash of custom headers that will be added
477
+ # to the HTTP request.
478
+ #
479
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
480
+ #
481
+ def get_agreement_async(publisher_id, offer_id, plan_id, custom_headers:nil)
482
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
483
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
484
+ fail ArgumentError, 'publisher_id is nil' if publisher_id.nil?
485
+ fail ArgumentError, 'offer_id is nil' if offer_id.nil?
486
+ fail ArgumentError, 'plan_id is nil' if plan_id.nil?
487
+
488
+
489
+ request_headers = {}
490
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
491
+
492
+ # Set Headers
493
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
494
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
495
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}'
496
+
497
+ request_url = @base_url || @client.base_url
498
+
499
+ options = {
500
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
501
+ path_params: {'subscriptionId' => @client.subscription_id,'publisherId' => publisher_id,'offerId' => offer_id,'planId' => plan_id},
502
+ query_params: {'api-version' => @client.api_version},
503
+ headers: request_headers.merge(custom_headers || {}),
504
+ base_url: request_url
505
+ }
506
+ promise = @client.make_request_async(:get, path_template, options)
507
+
508
+ promise = promise.then do |result|
509
+ http_response = result.response
510
+ status_code = http_response.status
511
+ response_content = http_response.body
512
+ unless status_code == 200
513
+ error_model = JSON.load(response_content)
514
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
515
+ end
516
+
517
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
518
+ # Deserialize Response
519
+ if status_code == 200
520
+ begin
521
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
522
+ result_mapper = Azure::MarketplaceOrdering::Mgmt::V2015_06_01::Models::AgreementTerms.mapper()
523
+ result.body = @client.deserialize(result_mapper, parsed_response)
524
+ rescue Exception => e
525
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
526
+ end
527
+ end
528
+
529
+ result
530
+ end
531
+
532
+ promise.execute
533
+ end
534
+
535
+ #
536
+ # List marketplace agreements in the subscription.
537
+ #
538
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
539
+ # will be added to the HTTP request.
540
+ #
541
+ # @return [Array] operation results.
542
+ #
543
+ def list(custom_headers:nil)
544
+ response = list_async(custom_headers:custom_headers).value!
545
+ response.body unless response.nil?
546
+ end
547
+
548
+ #
549
+ # List marketplace agreements in the subscription.
550
+ #
551
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
552
+ # will be added to the HTTP request.
553
+ #
554
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
555
+ #
556
+ def list_with_http_info(custom_headers:nil)
557
+ list_async(custom_headers:custom_headers).value!
558
+ end
559
+
560
+ #
561
+ # List marketplace agreements in the subscription.
562
+ #
563
+ # @param [Hash{String => String}] A hash of custom headers that will be added
564
+ # to the HTTP request.
565
+ #
566
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
567
+ #
568
+ def list_async(custom_headers:nil)
569
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
570
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
571
+
572
+
573
+ request_headers = {}
574
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
575
+
576
+ # Set Headers
577
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
578
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
579
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements'
580
+
581
+ request_url = @base_url || @client.base_url
582
+
583
+ options = {
584
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
585
+ path_params: {'subscriptionId' => @client.subscription_id},
586
+ query_params: {'api-version' => @client.api_version},
587
+ headers: request_headers.merge(custom_headers || {}),
588
+ base_url: request_url
589
+ }
590
+ promise = @client.make_request_async(:get, path_template, options)
591
+
592
+ promise = promise.then do |result|
593
+ http_response = result.response
594
+ status_code = http_response.status
595
+ response_content = http_response.body
596
+ unless status_code == 200
597
+ error_model = JSON.load(response_content)
598
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
599
+ end
600
+
601
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
602
+ # Deserialize Response
603
+ if status_code == 200
604
+ begin
605
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
606
+ result_mapper = {
607
+ client_side_validation: true,
608
+ required: false,
609
+ serialized_name: 'parsed_response',
610
+ type: {
611
+ name: 'Sequence',
612
+ element: {
613
+ client_side_validation: true,
614
+ required: false,
615
+ serialized_name: 'AgreementTermsElementType',
616
+ type: {
617
+ name: 'Composite',
618
+ class_name: 'AgreementTerms'
619
+ }
620
+ }
621
+ }
622
+ }
623
+ result.body = @client.deserialize(result_mapper, parsed_response)
624
+ rescue Exception => e
625
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
626
+ end
627
+ end
628
+
629
+ result
630
+ end
631
+
632
+ promise.execute
633
+ end
634
+
238
635
  end
239
636
  end
@@ -129,7 +129,7 @@ module Azure::MarketplaceOrdering::Mgmt::V2015_06_01
129
129
  #
130
130
  def add_telemetry
131
131
  sdk_information = 'azure_mgmt_marketplace_ordering'
132
- sdk_information = "#{sdk_information}/0.17.0"
132
+ sdk_information = "#{sdk_information}/0.17.5"
133
133
  add_user_agent_information(sdk_information)
134
134
  end
135
135
  end
@@ -6,8 +6,8 @@
6
6
  module Azure::MarketplaceOrdering::Mgmt::V2015_06_01
7
7
  module Models
8
8
  #
9
- # Error reponse indicates Microsoft.MarketplaceOrdering service is not able
10
- # to process the incoming request. The reason is provided in the error
9
+ # Error response indicates Microsoft.MarketplaceOrdering service is not
10
+ # able to process the incoming request. The reason is provided in the error
11
11
  # message.
12
12
  #
13
13
  class ErrorResponse
@@ -34,7 +34,7 @@ module Azure::MarketplaceOrdering::Mgmt::V2015_06_01
34
34
  def get_all_items
35
35
  items = @value
36
36
  page = self
37
- while page.next_link != nil do
37
+ while page.next_link != nil && !page.next_link.strip.empty? do
38
38
  page = page.get_next_page
39
39
  items.concat(page.value)
40
40
  end
@@ -22,6 +22,15 @@ module Azure::MarketplaceOrdering::Mgmt::V2015_06_01
22
22
  attr_accessor :type
23
23
 
24
24
 
25
+ # @return [String] the name of the resource group of the resource.
26
+ def resource_group
27
+ unless self.id.nil?
28
+ groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/)
29
+ groups.captures[0].strip if groups
30
+ end
31
+ end
32
+
33
+
25
34
  #
26
35
  # Mapper for Resource class as Ruby Hash.
27
36
  # This will be used for serialization/deserialization.
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::MarketplaceOrdering::Mgmt
6
- VERSION = '0.17.0'
6
+ VERSION = '0.17.5'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_marketplace_ordering
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-31 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.11.0
75
+ version: 0.12.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.11.0
82
+ version: 0.12.0
83
83
  description: Microsoft Azure Marketplace Ordering Library for Ruby
84
84
  email: azrubyteam@microsoft.com
85
85
  executables: []
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.5.1
133
+ rubygems_version: 2.7.8
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Official Ruby client library to consume Microsoft Azure Marketplace Ordering.