azure_mgmt_commerce 0.15.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/error_response.rb +3 -0
  3. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/info_field.rb +2 -0
  4. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/meter_info.rb +13 -0
  5. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/monetary_commitment.rb +7 -0
  6. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/monetary_credit.rb +6 -0
  7. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/offer_term_info.rb +2 -0
  8. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/rate_card_query_parameters.rb +5 -0
  9. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/recurring_charge.rb +4 -0
  10. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/resource_rate_card_info.rb +8 -0
  11. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/usage_aggregation.rb +19 -3
  12. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/models/usage_aggregation_list_result.rb +5 -1
  13. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/rate_card.rb +6 -5
  14. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/usage_aggregates.rb +15 -13
  15. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/usage_management_client.rb +10 -8
  16. data/lib/profiles/latest/commerce_latest_profile_client.rb +28 -11
  17. data/lib/profiles/latest/commerce_module_definition.rb +0 -1
  18. data/lib/profiles/latest/modules/commerce_profile_module.rb +64 -45
  19. data/lib/version.rb +1 -1
  20. metadata +11 -9
  21. data/lib/2015-06-01-preview/generated/azure_mgmt_commerce/version.rb +0 -8
  22. data/lib/profiles/common/configurable.rb +0 -86
  23. data/lib/profiles/common/default.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f5c0c50684e881b1a1e64c0539815f2ac66e0035
4
- data.tar.gz: 57db8044204316ff69b00719f0d7c15244e57637
2
+ SHA256:
3
+ metadata.gz: a53485da459f68b2639568f5112892b3b6aeee453ac8a444f9294f13d6acbe9a
4
+ data.tar.gz: 80ff82d50244ff1304c37ec59f7ef2923a112ec0797ce2905d6fe00737bbf2e7
5
5
  SHA512:
6
- metadata.gz: f364c5c87d81505bb1e9edcfc0f84b5fcd6a8bb73827df636348e6b5a29639c333f6d1c4b1d463761f32fdf7b3d87fc3a525fa35d85befd588c67bb5e6cd1537
7
- data.tar.gz: 77dced3265481ce630394edd18f0fe81ecc84ecfbf7d83d415bbb6a4bc8148fce732e2e3c7c22af50cfd079a56797786433078bc3b828267bfd7a89595d36f89
6
+ metadata.gz: e386455977db43cade2ae880f51362777d33cf55c53377139273850ffea45e1e8906796438ff0ceba94ada3cf9e5c27dd41f51f49361ba20cb68c011d6cde8b6
7
+ data.tar.gz: fbead8402b1888708c1df5cd87d9ef626e027b694fc5dc090199a6df9f000384246db0ac3656eaeb4557bf3e65f39ad5dbdadf4b8342cc080377f5c5bf53d988
@@ -25,6 +25,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
25
25
  #
26
26
  def self.mapper()
27
27
  {
28
+ client_side_validation: true,
28
29
  required: false,
29
30
  serialized_name: 'ErrorResponse',
30
31
  type: {
@@ -32,6 +33,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
32
33
  class_name: 'ErrorResponse',
33
34
  model_properties: {
34
35
  code: {
36
+ client_side_validation: true,
35
37
  required: false,
36
38
  serialized_name: 'code',
37
39
  type: {
@@ -39,6 +41,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
39
41
  }
40
42
  },
41
43
  message: {
44
+ client_side_validation: true,
42
45
  required: false,
43
46
  serialized_name: 'message',
44
47
  type: {
@@ -23,6 +23,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
23
23
  #
24
24
  def self.mapper()
25
25
  {
26
+ client_side_validation: true,
26
27
  required: false,
27
28
  serialized_name: 'InfoField',
28
29
  type: {
@@ -30,6 +31,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
30
31
  class_name: 'InfoField',
31
32
  model_properties: {
32
33
  project: {
34
+ client_side_validation: true,
33
35
  required: false,
34
36
  serialized_name: 'project',
35
37
  type: {
@@ -57,6 +57,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
57
57
  #
58
58
  def self.mapper()
59
59
  {
60
+ client_side_validation: true,
60
61
  required: false,
61
62
  serialized_name: 'MeterInfo',
62
63
  type: {
@@ -64,6 +65,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
64
65
  class_name: 'MeterInfo',
65
66
  model_properties: {
66
67
  meter_id: {
68
+ client_side_validation: true,
67
69
  required: false,
68
70
  serialized_name: 'MeterId',
69
71
  type: {
@@ -71,6 +73,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
71
73
  }
72
74
  },
73
75
  meter_name: {
76
+ client_side_validation: true,
74
77
  required: false,
75
78
  serialized_name: 'MeterName',
76
79
  type: {
@@ -78,6 +81,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
78
81
  }
79
82
  },
80
83
  meter_category: {
84
+ client_side_validation: true,
81
85
  required: false,
82
86
  serialized_name: 'MeterCategory',
83
87
  type: {
@@ -85,6 +89,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
85
89
  }
86
90
  },
87
91
  meter_sub_category: {
92
+ client_side_validation: true,
88
93
  required: false,
89
94
  serialized_name: 'MeterSubCategory',
90
95
  type: {
@@ -92,6 +97,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
92
97
  }
93
98
  },
94
99
  unit: {
100
+ client_side_validation: true,
95
101
  required: false,
96
102
  serialized_name: 'Unit',
97
103
  type: {
@@ -99,11 +105,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
99
105
  }
100
106
  },
101
107
  meter_tags: {
108
+ client_side_validation: true,
102
109
  required: false,
103
110
  serialized_name: 'MeterTags',
104
111
  type: {
105
112
  name: 'Sequence',
106
113
  element: {
114
+ client_side_validation: true,
107
115
  required: false,
108
116
  serialized_name: 'StringElementType',
109
117
  type: {
@@ -113,6 +121,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
113
121
  }
114
122
  },
115
123
  meter_region: {
124
+ client_side_validation: true,
116
125
  required: false,
117
126
  serialized_name: 'MeterRegion',
118
127
  type: {
@@ -120,11 +129,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
120
129
  }
121
130
  },
122
131
  meter_rates: {
132
+ client_side_validation: true,
123
133
  required: false,
124
134
  serialized_name: 'MeterRates',
125
135
  type: {
126
136
  name: 'Dictionary',
127
137
  value: {
138
+ client_side_validation: true,
128
139
  required: false,
129
140
  serialized_name: 'FloatElementType',
130
141
  type: {
@@ -134,6 +145,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
134
145
  }
135
146
  },
136
147
  effective_date: {
148
+ client_side_validation: true,
137
149
  required: false,
138
150
  serialized_name: 'EffectiveDate',
139
151
  type: {
@@ -141,6 +153,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
141
153
  }
142
154
  },
143
155
  included_quantity: {
156
+ client_side_validation: true,
144
157
  required: false,
145
158
  serialized_name: 'IncludedQuantity',
146
159
  type: {
@@ -36,6 +36,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
36
36
  #
37
37
  def self.mapper()
38
38
  {
39
+ client_side_validation: true,
39
40
  required: false,
40
41
  serialized_name: 'Monetary Commitment',
41
42
  type: {
@@ -43,6 +44,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
43
44
  class_name: 'MonetaryCommitment',
44
45
  model_properties: {
45
46
  effective_date: {
47
+ client_side_validation: true,
46
48
  required: false,
47
49
  serialized_name: 'EffectiveDate',
48
50
  type: {
@@ -50,6 +52,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
50
52
  }
51
53
  },
52
54
  Name: {
55
+ client_side_validation: true,
53
56
  required: true,
54
57
  serialized_name: 'Name',
55
58
  type: {
@@ -57,11 +60,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
57
60
  }
58
61
  },
59
62
  tiered_discount: {
63
+ client_side_validation: true,
60
64
  required: false,
61
65
  serialized_name: 'TieredDiscount',
62
66
  type: {
63
67
  name: 'Dictionary',
64
68
  value: {
69
+ client_side_validation: true,
65
70
  required: false,
66
71
  serialized_name: 'FloatElementType',
67
72
  type: {
@@ -71,11 +76,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
71
76
  }
72
77
  },
73
78
  excluded_meter_ids: {
79
+ client_side_validation: true,
74
80
  required: false,
75
81
  serialized_name: 'ExcludedMeterIds',
76
82
  type: {
77
83
  name: 'Sequence',
78
84
  element: {
85
+ client_side_validation: true,
79
86
  required: false,
80
87
  serialized_name: 'UuidElementType',
81
88
  type: {
@@ -34,6 +34,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
34
34
  #
35
35
  def self.mapper()
36
36
  {
37
+ client_side_validation: true,
37
38
  required: false,
38
39
  serialized_name: 'Monetary Credit',
39
40
  type: {
@@ -41,6 +42,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
41
42
  class_name: 'MonetaryCredit',
42
43
  model_properties: {
43
44
  effective_date: {
45
+ client_side_validation: true,
44
46
  required: false,
45
47
  serialized_name: 'EffectiveDate',
46
48
  type: {
@@ -48,6 +50,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
48
50
  }
49
51
  },
50
52
  Name: {
53
+ client_side_validation: true,
51
54
  required: true,
52
55
  serialized_name: 'Name',
53
56
  type: {
@@ -55,6 +58,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
55
58
  }
56
59
  },
57
60
  credit: {
61
+ client_side_validation: true,
58
62
  required: false,
59
63
  serialized_name: 'Credit',
60
64
  type: {
@@ -62,11 +66,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
62
66
  }
63
67
  },
64
68
  excluded_meter_ids: {
69
+ client_side_validation: true,
65
70
  required: false,
66
71
  serialized_name: 'ExcludedMeterIds',
67
72
  type: {
68
73
  name: 'Sequence',
69
74
  element: {
75
+ client_side_validation: true,
70
76
  required: false,
71
77
  serialized_name: 'UuidElementType',
72
78
  type: {
@@ -34,6 +34,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
34
34
  #
35
35
  def self.mapper()
36
36
  {
37
+ client_side_validation: true,
37
38
  required: false,
38
39
  serialized_name: 'OfferTermInfo',
39
40
  type: {
@@ -43,6 +44,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
43
44
  class_name: 'OfferTermInfo',
44
45
  model_properties: {
45
46
  effective_date: {
47
+ client_side_validation: true,
46
48
  required: false,
47
49
  serialized_name: 'EffectiveDate',
48
50
  type: {
@@ -37,6 +37,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
37
37
  #
38
38
  def self.mapper()
39
39
  {
40
+ client_side_validation: true,
40
41
  required: false,
41
42
  serialized_name: 'RateCardQueryParameters',
42
43
  type: {
@@ -44,6 +45,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
44
45
  class_name: 'RateCardQueryParameters',
45
46
  model_properties: {
46
47
  offer_durable_id: {
48
+ client_side_validation: true,
47
49
  required: true,
48
50
  serialized_name: 'OfferDurableId',
49
51
  constraints: {
@@ -54,6 +56,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
54
56
  }
55
57
  },
56
58
  currency: {
59
+ client_side_validation: true,
57
60
  required: true,
58
61
  serialized_name: 'Currency',
59
62
  type: {
@@ -61,6 +64,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
61
64
  }
62
65
  },
63
66
  locale: {
67
+ client_side_validation: true,
64
68
  required: true,
65
69
  serialized_name: 'Locale',
66
70
  type: {
@@ -68,6 +72,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
68
72
  }
69
73
  },
70
74
  region_info: {
75
+ client_side_validation: true,
71
76
  required: true,
72
77
  serialized_name: 'RegionInfo',
73
78
  type: {
@@ -29,6 +29,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
29
29
  #
30
30
  def self.mapper()
31
31
  {
32
+ client_side_validation: true,
32
33
  required: false,
33
34
  serialized_name: 'Recurring Charge',
34
35
  type: {
@@ -36,6 +37,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
36
37
  class_name: 'RecurringCharge',
37
38
  model_properties: {
38
39
  effective_date: {
40
+ client_side_validation: true,
39
41
  required: false,
40
42
  serialized_name: 'EffectiveDate',
41
43
  type: {
@@ -43,6 +45,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
43
45
  }
44
46
  },
45
47
  Name: {
48
+ client_side_validation: true,
46
49
  required: true,
47
50
  serialized_name: 'Name',
48
51
  type: {
@@ -50,6 +53,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
50
53
  }
51
54
  },
52
55
  recurring_charge: {
56
+ client_side_validation: true,
53
57
  required: false,
54
58
  serialized_name: 'RecurringCharge',
55
59
  type: {
@@ -36,6 +36,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
36
36
  #
37
37
  def self.mapper()
38
38
  {
39
+ client_side_validation: true,
39
40
  required: false,
40
41
  serialized_name: 'ResourceRateCardInfo',
41
42
  type: {
@@ -43,6 +44,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
43
44
  class_name: 'ResourceRateCardInfo',
44
45
  model_properties: {
45
46
  currency: {
47
+ client_side_validation: true,
46
48
  required: false,
47
49
  serialized_name: 'Currency',
48
50
  type: {
@@ -50,6 +52,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
50
52
  }
51
53
  },
52
54
  locale: {
55
+ client_side_validation: true,
53
56
  required: false,
54
57
  serialized_name: 'Locale',
55
58
  type: {
@@ -57,6 +60,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
57
60
  }
58
61
  },
59
62
  is_tax_included: {
63
+ client_side_validation: true,
60
64
  required: false,
61
65
  serialized_name: 'IsTaxIncluded',
62
66
  type: {
@@ -64,11 +68,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
64
68
  }
65
69
  },
66
70
  offer_terms: {
71
+ client_side_validation: true,
67
72
  required: false,
68
73
  serialized_name: 'OfferTerms',
69
74
  type: {
70
75
  name: 'Sequence',
71
76
  element: {
77
+ client_side_validation: true,
72
78
  required: false,
73
79
  serialized_name: 'OfferTermInfoElementType',
74
80
  type: {
@@ -81,11 +87,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
81
87
  }
82
88
  },
83
89
  meters: {
90
+ client_side_validation: true,
84
91
  required: false,
85
92
  serialized_name: 'Meters',
86
93
  type: {
87
94
  name: 'Sequence',
88
95
  element: {
96
+ client_side_validation: true,
89
97
  required: false,
90
98
  serialized_name: 'MeterInfoElementType',
91
99
  type: {
@@ -36,8 +36,8 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
36
36
  # usage aggregate belongs.
37
37
  attr_accessor :usage_end_time
38
38
 
39
- # @return The amount of the resource consumption that occurred in this
40
- # time frame.
39
+ # @return [Float] The amount of the resource consumption that occurred in
40
+ # this time frame.
41
41
  attr_accessor :quantity
42
42
 
43
43
  # @return [String] The unit in which the usage for this resource is being
@@ -71,6 +71,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
71
71
  #
72
72
  def self.mapper()
73
73
  {
74
+ client_side_validation: true,
74
75
  required: false,
75
76
  serialized_name: 'UsageAggregation',
76
77
  type: {
@@ -78,6 +79,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
78
79
  class_name: 'UsageAggregation',
79
80
  model_properties: {
80
81
  id: {
82
+ client_side_validation: true,
81
83
  required: false,
82
84
  serialized_name: 'id',
83
85
  type: {
@@ -85,6 +87,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
85
87
  }
86
88
  },
87
89
  name: {
90
+ client_side_validation: true,
88
91
  required: false,
89
92
  serialized_name: 'name',
90
93
  type: {
@@ -92,6 +95,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
92
95
  }
93
96
  },
94
97
  type: {
98
+ client_side_validation: true,
95
99
  required: false,
96
100
  serialized_name: 'type',
97
101
  type: {
@@ -99,6 +103,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
99
103
  }
100
104
  },
101
105
  subscription_id: {
106
+ client_side_validation: true,
102
107
  required: false,
103
108
  serialized_name: 'properties.subscriptionId',
104
109
  type: {
@@ -106,6 +111,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
106
111
  }
107
112
  },
108
113
  meter_id: {
114
+ client_side_validation: true,
109
115
  required: false,
110
116
  serialized_name: 'properties.meterId',
111
117
  type: {
@@ -113,6 +119,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
113
119
  }
114
120
  },
115
121
  usage_start_time: {
122
+ client_side_validation: true,
116
123
  required: false,
117
124
  serialized_name: 'properties.usageStartTime',
118
125
  type: {
@@ -120,6 +127,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
120
127
  }
121
128
  },
122
129
  usage_end_time: {
130
+ client_side_validation: true,
123
131
  required: false,
124
132
  serialized_name: 'properties.usageEndTime',
125
133
  type: {
@@ -127,13 +135,15 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
127
135
  }
128
136
  },
129
137
  quantity: {
138
+ client_side_validation: true,
130
139
  required: false,
131
140
  serialized_name: 'properties.quantity',
132
141
  type: {
133
- name: 'Object'
142
+ name: 'Double'
134
143
  }
135
144
  },
136
145
  unit: {
146
+ client_side_validation: true,
137
147
  required: false,
138
148
  serialized_name: 'properties.unit',
139
149
  type: {
@@ -141,6 +151,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
141
151
  }
142
152
  },
143
153
  meter_name: {
154
+ client_side_validation: true,
144
155
  required: false,
145
156
  serialized_name: 'properties.meterName',
146
157
  type: {
@@ -148,6 +159,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
148
159
  }
149
160
  },
150
161
  meter_category: {
162
+ client_side_validation: true,
151
163
  required: false,
152
164
  serialized_name: 'properties.meterCategory',
153
165
  type: {
@@ -155,6 +167,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
155
167
  }
156
168
  },
157
169
  meter_sub_category: {
170
+ client_side_validation: true,
158
171
  required: false,
159
172
  serialized_name: 'properties.meterSubCategory',
160
173
  type: {
@@ -162,6 +175,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
162
175
  }
163
176
  },
164
177
  meter_region: {
178
+ client_side_validation: true,
165
179
  required: false,
166
180
  serialized_name: 'properties.meterRegion',
167
181
  type: {
@@ -169,6 +183,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
169
183
  }
170
184
  },
171
185
  info_fields: {
186
+ client_side_validation: true,
172
187
  required: false,
173
188
  serialized_name: 'properties.infoFields',
174
189
  type: {
@@ -177,6 +192,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
177
192
  }
178
193
  },
179
194
  instance_data: {
195
+ client_side_validation: true,
180
196
  required: false,
181
197
  serialized_name: 'properties.instanceData',
182
198
  type: {
@@ -31,7 +31,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
31
31
  def get_all_items
32
32
  items = @value
33
33
  page = self
34
- while page.next_link != nil do
34
+ while page.next_link != nil && !page.next_link.strip.empty? do
35
35
  page = page.get_next_page
36
36
  items.concat(page.value)
37
37
  end
@@ -58,6 +58,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
58
58
  #
59
59
  def self.mapper()
60
60
  {
61
+ client_side_validation: true,
61
62
  required: false,
62
63
  serialized_name: 'UsageAggregationListResult',
63
64
  type: {
@@ -65,11 +66,13 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
65
66
  class_name: 'UsageAggregationListResult',
66
67
  model_properties: {
67
68
  value: {
69
+ client_side_validation: true,
68
70
  required: false,
69
71
  serialized_name: 'value',
70
72
  type: {
71
73
  name: 'Sequence',
72
74
  element: {
75
+ client_side_validation: true,
73
76
  required: false,
74
77
  serialized_name: 'UsageAggregationElementType',
75
78
  type: {
@@ -80,6 +83,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
80
83
  }
81
84
  },
82
85
  next_link: {
86
+ client_side_validation: true,
83
87
  required: false,
84
88
  serialized_name: 'nextLink',
85
89
  type: {
@@ -40,8 +40,8 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
40
40
  #
41
41
  # @return [ResourceRateCardInfo] operation results.
42
42
  #
43
- def get(filter, custom_headers = nil)
44
- response = get_async(filter, custom_headers).value!
43
+ def get(filter, custom_headers:nil)
44
+ response = get_async(filter, custom_headers:custom_headers).value!
45
45
  response.body unless response.nil?
46
46
  end
47
47
 
@@ -64,8 +64,8 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
64
64
  #
65
65
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
66
66
  #
67
- def get_with_http_info(filter, custom_headers = nil)
68
- get_async(filter, custom_headers).value!
67
+ def get_with_http_info(filter, custom_headers:nil)
68
+ get_async(filter, custom_headers:custom_headers).value!
69
69
  end
70
70
 
71
71
  #
@@ -87,13 +87,14 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
87
87
  #
88
88
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
89
89
  #
90
- def get_async(filter, custom_headers = nil)
90
+ def get_async(filter, custom_headers:nil)
91
91
  fail ArgumentError, 'filter is nil' if filter.nil?
92
92
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
93
93
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
94
94
 
95
95
 
96
96
  request_headers = {}
97
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
97
98
 
98
99
  # Set Headers
99
100
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -47,8 +47,8 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
47
47
  #
48
48
  # @return [Array<UsageAggregation>] operation results.
49
49
  #
50
- def list(reported_start_time, reported_end_time, show_details = nil, aggregation_granularity = nil, continuation_token = nil, custom_headers = nil)
51
- first_page = list_as_lazy(reported_start_time, reported_end_time, show_details, aggregation_granularity, continuation_token, custom_headers)
50
+ def list(reported_start_time, reported_end_time, show_details:nil, aggregation_granularity:nil, continuation_token:nil, custom_headers:nil)
51
+ first_page = list_as_lazy(reported_start_time, reported_end_time, show_details:show_details, aggregation_granularity:aggregation_granularity, continuation_token:continuation_token, custom_headers:custom_headers)
52
52
  first_page.get_all_items
53
53
  end
54
54
 
@@ -78,8 +78,8 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
78
78
  #
79
79
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
80
80
  #
81
- def list_with_http_info(reported_start_time, reported_end_time, show_details = nil, aggregation_granularity = nil, continuation_token = nil, custom_headers = nil)
82
- list_async(reported_start_time, reported_end_time, show_details, aggregation_granularity, continuation_token, custom_headers).value!
81
+ def list_with_http_info(reported_start_time, reported_end_time, show_details:nil, aggregation_granularity:nil, continuation_token:nil, custom_headers:nil)
82
+ list_async(reported_start_time, reported_end_time, show_details:show_details, aggregation_granularity:aggregation_granularity, continuation_token:continuation_token, custom_headers:custom_headers).value!
83
83
  end
84
84
 
85
85
  #
@@ -108,7 +108,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
108
108
  #
109
109
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
110
110
  #
111
- def list_async(reported_start_time, reported_end_time, show_details = nil, aggregation_granularity = nil, continuation_token = nil, custom_headers = nil)
111
+ def list_async(reported_start_time, reported_end_time, show_details:nil, aggregation_granularity:nil, continuation_token:nil, custom_headers:nil)
112
112
  fail ArgumentError, 'reported_start_time is nil' if reported_start_time.nil?
113
113
  fail ArgumentError, 'reported_end_time is nil' if reported_end_time.nil?
114
114
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -116,6 +116,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
116
116
 
117
117
 
118
118
  request_headers = {}
119
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
119
120
 
120
121
  # Set Headers
121
122
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -170,8 +171,8 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
170
171
  #
171
172
  # @return [UsageAggregationListResult] operation results.
172
173
  #
173
- def list_next(next_page_link, custom_headers = nil)
174
- response = list_next_async(next_page_link, custom_headers).value!
174
+ def list_next(next_page_link, custom_headers:nil)
175
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
175
176
  response.body unless response.nil?
176
177
  end
177
178
 
@@ -185,8 +186,8 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
185
186
  #
186
187
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
187
188
  #
188
- def list_next_with_http_info(next_page_link, custom_headers = nil)
189
- list_next_async(next_page_link, custom_headers).value!
189
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
190
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
190
191
  end
191
192
 
192
193
  #
@@ -199,11 +200,12 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
199
200
  #
200
201
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
201
202
  #
202
- def list_next_async(next_page_link, custom_headers = nil)
203
+ def list_next_async(next_page_link, custom_headers:nil)
203
204
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
204
205
 
205
206
 
206
207
  request_headers = {}
208
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
207
209
 
208
210
  # Set Headers
209
211
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -274,12 +276,12 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
274
276
  # @return [UsageAggregationListResult] which provide lazy access to pages of
275
277
  # the response.
276
278
  #
277
- def list_as_lazy(reported_start_time, reported_end_time, show_details = nil, aggregation_granularity = nil, continuation_token = nil, custom_headers = nil)
278
- response = list_async(reported_start_time, reported_end_time, show_details, aggregation_granularity, continuation_token, custom_headers).value!
279
+ def list_as_lazy(reported_start_time, reported_end_time, show_details:nil, aggregation_granularity:nil, continuation_token:nil, custom_headers:nil)
280
+ response = list_async(reported_start_time, reported_end_time, show_details:show_details, aggregation_granularity:aggregation_granularity, continuation_token:continuation_token, custom_headers:custom_headers).value!
279
281
  unless response.nil?
280
282
  page = response.body
281
283
  page.next_method = Proc.new do |next_page_link|
282
- list_next_async(next_page_link, custom_headers)
284
+ list_next_async(next_page_link, custom_headers:custom_headers)
283
285
  end
284
286
  page
285
287
  end
@@ -24,15 +24,16 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
24
24
  # @return [String] Client Api Version.
25
25
  attr_reader :api_version
26
26
 
27
- # @return [String] Gets or sets the preferred language for the response.
27
+ # @return [String] The preferred language for the response.
28
28
  attr_accessor :accept_language
29
29
 
30
- # @return [Integer] Gets or sets the retry timeout in seconds for Long
31
- # Running Operations. Default value is 30.
30
+ # @return [Integer] The retry timeout in seconds for Long Running
31
+ # Operations. Default value is 30.
32
32
  attr_accessor :long_running_operation_retry_timeout
33
33
 
34
- # @return [Boolean] When set to true a unique x-ms-client-request-id value
35
- # is generated and included in each request. Default is true.
34
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
35
+ # generated. When set to true a unique x-ms-client-request-id value is
36
+ # generated and included in each request. Default is true.
36
37
  attr_accessor :generate_client_request_id
37
38
 
38
39
  # @return [UsageAggregates] usage_aggregates
@@ -109,6 +110,9 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
109
110
  fail ArgumentError, 'path is nil' if path.nil?
110
111
 
111
112
  request_url = options[:base_url] || @base_url
113
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
114
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
115
+ end
112
116
 
113
117
  request_headers = @request_headers
114
118
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
@@ -125,9 +129,7 @@ module Azure::Commerce::Mgmt::V2015_06_01_preview
125
129
  #
126
130
  def add_telemetry
127
131
  sdk_information = 'azure_mgmt_commerce'
128
- if defined? Azure::Commerce::Mgmt::V2015_06_01_preview::VERSION
129
- sdk_information = "#{sdk_information}/#{Azure::Commerce::Mgmt::V2015_06_01_preview::VERSION}"
130
- end
132
+ sdk_information = "#{sdk_information}/0.17.2"
131
133
  add_user_agent_information(sdk_information)
132
134
  end
133
135
  end
@@ -4,20 +4,37 @@
4
4
 
5
5
  require 'profiles/latest/commerce_module_definition'
6
6
  require 'profiles/latest/modules/commerce_profile_module'
7
- require 'profiles/common/configurable'
8
- require 'profiles/common/default'
9
7
 
10
- module Azure::Commerce::Profiles::Latest::Mgmt
11
- #
12
- # Client class for the Latest profile SDK.
13
- #
14
- class Client < CommerceClass
15
- include Azure::Common::Configurable
8
+ module Azure::Commerce::Profiles::Latest
9
+ module Mgmt
10
+ #
11
+ # Client class for the Latest profile SDK.
12
+ #
13
+ class Client < CommerceManagementClass
14
+ include MsRestAzure::Common::Configurable
16
15
 
16
+ #
17
+ # Initializes a new instance of the Client class.
18
+ # @param options [Hash] hash of client options.
19
+ # options = {
20
+ # tenant_id: 'YOUR TENANT ID',
21
+ # client_id: 'YOUR CLIENT ID',
22
+ # client_secret: 'YOUR CLIENT SECRET',
23
+ # subscription_id: 'YOUR SUBSCRIPTION ID',
24
+ # credentials: credentials,
25
+ # active_directory_settings: active_directory_settings,
26
+ # base_url: 'YOUR BASE URL',
27
+ # options: options
28
+ # }
29
+ # 'credentials' are optional and if not passed in the hash, will be obtained
30
+ # from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider.
31
+ #
32
+ # Also, base_url, active_directory_settings & options are optional.
33
+ #
34
+ def initialize(options = {})
35
+ super(options)
36
+ end
17
37
 
18
- def initialize(options = {})
19
- super(options)
20
38
  end
21
-
22
39
  end
23
40
  end
@@ -6,4 +6,3 @@ module Azure end
6
6
  module Azure::Commerce end
7
7
  module Azure::Commerce::Profiles end
8
8
  module Azure::Commerce::Profiles::Latest end
9
- module Azure::Commerce::Profiles::Latest::Mgmt end
@@ -4,7 +4,8 @@
4
4
 
5
5
  require 'azure_mgmt_commerce'
6
6
 
7
- module Azure::Commerce::Profiles::Latest::Mgmt
7
+ module Azure::Commerce::Profiles::Latest
8
+ module Mgmt
8
9
  UsageAggregates = Azure::Commerce::Mgmt::V2015_06_01_preview::UsageAggregates
9
10
  RateCard = Azure::Commerce::Mgmt::V2015_06_01_preview::RateCard
10
11
 
@@ -24,9 +25,9 @@ module Azure::Commerce::Profiles::Latest::Mgmt
24
25
  end
25
26
 
26
27
  #
27
- # Commerce
28
+ # CommerceManagementClass
28
29
  #
29
- class CommerceClass
30
+ class CommerceManagementClass
30
31
  attr_reader :usage_aggregates, :rate_card, :configurable, :base_url, :options, :model_classes
31
32
 
32
33
  def initialize(options = {})
@@ -38,55 +39,73 @@ module Azure::Commerce::Profiles::Latest::Mgmt
38
39
 
39
40
  reset!(options)
40
41
 
41
- @configurable, @base_url, @options = self, nil, nil
42
+ @configurable = self
43
+ @base_url = options[:base_url].nil? ? nil:options[:base_url]
44
+ @options = options[:options].nil? ? nil:options[:options]
42
45
 
43
- client_0 = Azure::Commerce::Mgmt::V2015_06_01_preview::UsageManagementClient.new(configurable.credentials, base_url, options)
44
- if(client_0.respond_to?(:subscription_id))
45
- client_0.subscription_id = configurable.subscription_id
46
+ @client_0 = Azure::Commerce::Mgmt::V2015_06_01_preview::UsageManagementClient.new(configurable.credentials, base_url, options)
47
+ if(@client_0.respond_to?(:subscription_id))
48
+ @client_0.subscription_id = configurable.subscription_id
46
49
  end
47
- @usage_aggregates = client_0.usage_aggregates
48
- @rate_card = client_0.rate_card
50
+ add_telemetry(@client_0)
51
+ @usage_aggregates = @client_0.usage_aggregates
52
+ @rate_card = @client_0.rate_card
49
53
 
50
54
  @model_classes = ModelClasses.new
51
55
  end
52
56
 
53
- class ModelClasses
54
- def meter_info
55
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::MeterInfo
56
- end
57
- def resource_rate_card_info
58
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::ResourceRateCardInfo
59
- end
60
- def usage_aggregation
61
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::UsageAggregation
62
- end
63
- def info_field
64
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::InfoField
65
- end
66
- def usage_aggregation_list_result
67
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::UsageAggregationListResult
68
- end
69
- def offer_term_info
70
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::OfferTermInfo
71
- end
72
- def rate_card_query_parameters
73
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::RateCardQueryParameters
74
- end
75
- def error_response
76
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::ErrorResponse
77
- end
78
- def monetary_credit
79
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::MonetaryCredit
80
- end
81
- def monetary_commitment
82
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::MonetaryCommitment
83
- end
84
- def recurring_charge
85
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::RecurringCharge
86
- end
87
- def aggregation_granularity
88
- Azure::Commerce::Mgmt::V2015_06_01_preview::Models::AggregationGranularity
57
+ def add_telemetry(client)
58
+ profile_information = 'Profiles/Latest/Commerce/Mgmt'
59
+ client.add_user_agent_information(profile_information)
60
+ end
61
+
62
+ def method_missing(method, *args)
63
+ if @client_0.respond_to?method
64
+ @client_0.send(method, *args)
65
+ else
66
+ super
89
67
  end
90
68
  end
69
+
70
+ end
71
+
72
+ class ModelClasses
73
+ def meter_info
74
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::MeterInfo
75
+ end
76
+ def resource_rate_card_info
77
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::ResourceRateCardInfo
78
+ end
79
+ def usage_aggregation
80
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::UsageAggregation
81
+ end
82
+ def info_field
83
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::InfoField
84
+ end
85
+ def usage_aggregation_list_result
86
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::UsageAggregationListResult
87
+ end
88
+ def offer_term_info
89
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::OfferTermInfo
90
+ end
91
+ def rate_card_query_parameters
92
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::RateCardQueryParameters
93
+ end
94
+ def error_response
95
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::ErrorResponse
96
+ end
97
+ def monetary_credit
98
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::MonetaryCredit
99
+ end
100
+ def monetary_commitment
101
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::MonetaryCommitment
102
+ end
103
+ def recurring_charge
104
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::RecurringCharge
105
+ end
106
+ def aggregation_granularity
107
+ Azure::Commerce::Mgmt::V2015_06_01_preview::Models::AggregationGranularity
108
+ end
91
109
  end
110
+ end
92
111
  end
@@ -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::Commerce::Mgmt
6
- VERSION = '0.15.1'
6
+ VERSION = '0.17.2'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_commerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-30 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.9.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.9.0
82
+ version: 0.12.0
83
83
  description: Microsoft Azure Commerce Management Client Library for Ruby
84
84
  email: azrubyteam@microsoft.com
85
85
  executables: []
@@ -104,11 +104,8 @@ files:
104
104
  - lib/2015-06-01-preview/generated/azure_mgmt_commerce/rate_card.rb
105
105
  - lib/2015-06-01-preview/generated/azure_mgmt_commerce/usage_aggregates.rb
106
106
  - lib/2015-06-01-preview/generated/azure_mgmt_commerce/usage_management_client.rb
107
- - lib/2015-06-01-preview/generated/azure_mgmt_commerce/version.rb
108
107
  - lib/azure_mgmt_commerce.rb
109
108
  - lib/module_definition.rb
110
- - lib/profiles/common/configurable.rb
111
- - lib/profiles/common/default.rb
112
109
  - lib/profiles/latest/commerce_latest_profile_client.rb
113
110
  - lib/profiles/latest/commerce_module_definition.rb
114
111
  - lib/profiles/latest/modules/commerce_profile_module.rb
@@ -116,7 +113,12 @@ files:
116
113
  homepage: https://aka.ms/azure-sdk-for-ruby
117
114
  licenses:
118
115
  - MIT
119
- metadata: {}
116
+ metadata:
117
+ bug_tracker_uri: https://github.com/Azure/azure-sdk-for-ruby/issues
118
+ changelog_uri: https://github.com/Azure/azure-sdk-for-ruby/blob/master/ChangeLog.md
119
+ documentation_uri: https://azure.microsoft.com/en-us/develop/ruby/
120
+ homepage_uri: https://aka.ms/azure-sdk-for-ruby
121
+ source_code_uri: https://github.com/Azure/azure-sdk-for-ruby/tree/master/management/azure_mgmt_commerce
120
122
  post_install_message:
121
123
  rdoc_options: []
122
124
  require_paths:
@@ -133,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
135
  version: '0'
134
136
  requirements: []
135
137
  rubyforge_project:
136
- rubygems_version: 2.5.1
138
+ rubygems_version: 2.7.8
137
139
  signing_key:
138
140
  specification_version: 4
139
141
  summary: Official Ruby client library to consume Microsoft Azure Commerce Management
@@ -1,8 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator.
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::Commerce::Mgmt::V2015_06_01_preview
7
- VERSION = '0.15.1'
8
- end
@@ -1,86 +0,0 @@
1
- # encoding: utf-8
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License. See License.txt in the project root for license information.
4
-
5
- module Azure::Common
6
- # The Azure::Common::Configurable module provides basic configuration for Azure activities.
7
- module Configurable
8
- # @return [String] Azure tenant id (also known as domain).
9
- attr_accessor :tenant_id
10
-
11
- # @return [String] Azure client id.
12
- attr_accessor :client_id
13
-
14
- # @return [String] Azure secret key.
15
- attr_accessor :client_secret
16
-
17
- # @return [String] Azure subscription id.
18
- attr_accessor :subscription_id
19
-
20
- # @return [MsRestAzure::ActiveDirectoryServiceSettings] Azure active directory service settings.
21
- attr_accessor :active_directory_settings
22
-
23
- # @return [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
24
- attr_accessor :credentials
25
-
26
- class << self
27
- #
28
- # List of configurable keys for {Azure::Common::Client}.
29
- # @return [Array] of option keys.
30
- #
31
- def keys
32
- @keys ||= [:tenant_id, :client_id, :client_secret, :subscription_id, :active_directory_settings]
33
- end
34
- end
35
-
36
- #
37
- # Set configuration options using a block.
38
- #
39
- def configure
40
- yield self
41
- end
42
-
43
- #
44
- # Resets the configurable options to provided options or defaults.
45
- # This will also creates MsRest::TokenCredentials to be used for subsequent Azure Resource Manager clients.
46
- #
47
- def reset!(options = {})
48
- Azure::Common::Configurable.keys.each do |key|
49
- default_value = Azure::Common::Default.options[key]
50
- instance_variable_set(:"@#{key}", options.fetch(key, default_value))
51
- end
52
-
53
- fail ArgumentError, 'tenant_id is nil' if self.tenant_id.nil?
54
- fail ArgumentError, 'client_id is nil' if self.client_id.nil?
55
- fail ArgumentError, 'client_secret is nil' if self.client_secret.nil?
56
- fail ArgumentError, 'subscription_id is nil' if self.subscription_id.nil?
57
- fail ArgumentError, 'active_directory_settings is nil' if self.active_directory_settings.nil?
58
-
59
- default_value = MsRest::TokenCredentials.new(
60
- MsRestAzure::ApplicationTokenProvider.new(
61
- self.tenant_id, self.client_id, self.client_secret, self.active_directory_settings))
62
-
63
- instance_variable_set(:"@credentials", options.fetch(:credentials, default_value))
64
-
65
- self
66
- end
67
-
68
- def config
69
- self
70
- end
71
-
72
- private
73
-
74
- #
75
- # configures configurable options to default values
76
- #
77
- def setup_default_options
78
- opts = {}
79
- Azure::Common::Configurable.keys.map do |key|
80
- opts[key] = Azure::Common::Default.options[key]
81
- end
82
-
83
- opts
84
- end
85
- end
86
- end
@@ -1,57 +0,0 @@
1
- # encoding: utf-8
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License. See License.txt in the project root for license information.
4
-
5
- module Azure::Common
6
- module Default
7
- class << self
8
- #
9
- # Default Azure Tenant Id.
10
- # @return [String] Azure Tenant Id.
11
- #
12
- def tenant_id
13
- ENV['AZURE_TENANT_ID']
14
- end
15
-
16
- #
17
- # Default Azure Client Id.
18
- # @return [String] Azure Client Id.
19
- #
20
- def client_id
21
- ENV['AZURE_CLIENT_ID']
22
- end
23
-
24
- #
25
- # Default Azure Client Secret.
26
- # @return [String] Azure Client Secret.
27
- #
28
- def client_secret
29
- ENV['AZURE_CLIENT_SECRET']
30
- end
31
-
32
- #
33
- # Default Azure Subscription Id.
34
- # @return [String] Azure Subscription Id.
35
- #
36
- def subscription_id
37
- ENV['AZURE_SUBSCRIPTION_ID']
38
- end
39
-
40
- #
41
- # Default Azure Active Directory Service Settings.
42
- # @return [MsRestAzure::ActiveDirectoryServiceSettings] Azure Active Directory Service Settings.
43
- #
44
- def active_directory_settings
45
- MsRestAzure::ActiveDirectoryServiceSettings.get_azure_settings
46
- end
47
-
48
- #
49
- # Configuration options.
50
- # @return [Hash] Configuration options.
51
- #
52
- def options
53
- Hash[Azure::Common::Configurable.keys.map { |key| [key, send(key)]}]
54
- end
55
- end
56
- end
57
- end