azure_mgmt_billing 0.15.1 → 0.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/billing_management_client.rb +1 -3
  3. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/billing_periods.rb +2 -0
  4. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/invoices.rb +2 -0
  5. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/billing_period.rb +8 -0
  6. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/billing_periods_list_result.rb +4 -0
  7. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/download_url.rb +3 -0
  8. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/error_details.rb +4 -0
  9. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/error_response.rb +2 -0
  10. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/invoice.rb +9 -0
  11. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/invoices_list_result.rb +4 -0
  12. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/operation.rb +3 -0
  13. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/operation_display.rb +4 -0
  14. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/operation_list_result.rb +4 -0
  15. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/models/resource.rb +4 -0
  16. data/lib/profiles/latest/billing_latest_profile_client.rb +1 -3
  17. data/lib/version.rb +1 -1
  18. metadata +10 -8
  19. data/lib/2017-04-24-preview/generated/azure_mgmt_billing/version.rb +0 -8
  20. data/lib/profiles/common/configurable.rb +0 -86
  21. data/lib/profiles/common/default.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 213e10ac57035c93c6716e834374b362c71120eb
4
- data.tar.gz: 47eaf242514a30bfbd7f028d9e489dbb17c0cdae
3
+ metadata.gz: 1f25b937c5ef348ed49262e29c43604f22404f01
4
+ data.tar.gz: deb2da20f33c6a78ce14cfa520ecdfc917d79906
5
5
  SHA512:
6
- metadata.gz: c2a9e2948190cf82f390b432030e61f6e0d2489ad94ff55b092a7eeb793a3a50f41183efcf1704738c6f878dca640e9ccb3de4e1b32baf0b460195d301ec9b34
7
- data.tar.gz: 4d0c7b473bef9357b44ef25eb39cf62b07f6e7d8e7f9923d716a949c25fafa1a2f7ffc873e6bf777f06d8692b2951f538ebbddb249caa5e3f4680d8723ed733a
6
+ metadata.gz: 34e8968d85d3c45a531694f5e8a4bc8cc1aa683ff99f01e17f27a2c4de39feb468cf80c18f016e33a1ed0209ecaae72d28c9bd3c67f09414a80746dea2a72c93
7
+ data.tar.gz: a60225fcb84ba3b3ace99b3f00547114b0cd4effc0095a157196bb5854a923f76b5fdf05cdab8636dfb9481860480235bb7786ed548ad2b021d69f7e2957847a
@@ -129,9 +129,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
129
129
  #
130
130
  def add_telemetry
131
131
  sdk_information = 'azure_mgmt_billing'
132
- if defined? Azure::Billing::Mgmt::V2017_04_24_preview::VERSION
133
- sdk_information = "#{sdk_information}/#{Azure::Billing::Mgmt::V2017_04_24_preview::VERSION}"
134
- end
132
+ sdk_information = "#{sdk_information}/0.15.2"
135
133
  add_user_agent_information(sdk_information)
136
134
  end
137
135
  end
@@ -89,6 +89,8 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
89
89
  def list_async(filter = nil, skiptoken = nil, top = nil, custom_headers = nil)
90
90
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
91
91
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
92
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '100'" if !top.nil? && top > 100
93
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
92
94
 
93
95
 
94
96
  request_headers = {}
@@ -107,6 +107,8 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
107
107
  def list_async(expand = nil, filter = nil, skiptoken = nil, top = nil, custom_headers = nil)
108
108
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
109
109
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
110
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '100'" if !top.nil? && top > 100
111
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
110
112
 
111
113
 
112
114
  request_headers = {}
@@ -29,6 +29,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
29
29
  #
30
30
  def self.mapper()
31
31
  {
32
+ client_side_validation: true,
32
33
  required: false,
33
34
  serialized_name: 'BillingPeriod',
34
35
  type: {
@@ -36,6 +37,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
36
37
  class_name: 'BillingPeriod',
37
38
  model_properties: {
38
39
  id: {
40
+ client_side_validation: true,
39
41
  required: false,
40
42
  read_only: true,
41
43
  serialized_name: 'id',
@@ -44,6 +46,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
44
46
  }
45
47
  },
46
48
  name: {
49
+ client_side_validation: true,
47
50
  required: false,
48
51
  read_only: true,
49
52
  serialized_name: 'name',
@@ -52,6 +55,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
52
55
  }
53
56
  },
54
57
  type: {
58
+ client_side_validation: true,
55
59
  required: false,
56
60
  read_only: true,
57
61
  serialized_name: 'type',
@@ -60,6 +64,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
60
64
  }
61
65
  },
62
66
  billing_period_start_date: {
67
+ client_side_validation: true,
63
68
  required: false,
64
69
  read_only: true,
65
70
  serialized_name: 'properties.billingPeriodStartDate',
@@ -68,6 +73,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
68
73
  }
69
74
  },
70
75
  billing_period_end_date: {
76
+ client_side_validation: true,
71
77
  required: false,
72
78
  read_only: true,
73
79
  serialized_name: 'properties.billingPeriodEndDate',
@@ -76,12 +82,14 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
76
82
  }
77
83
  },
78
84
  invoice_ids: {
85
+ client_side_validation: true,
79
86
  required: false,
80
87
  read_only: true,
81
88
  serialized_name: 'properties.invoiceIds',
82
89
  type: {
83
90
  name: 'Sequence',
84
91
  element: {
92
+ client_side_validation: true,
85
93
  required: false,
86
94
  serialized_name: 'StringElementType',
87
95
  type: {
@@ -58,6 +58,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
58
58
  #
59
59
  def self.mapper()
60
60
  {
61
+ client_side_validation: true,
61
62
  required: false,
62
63
  serialized_name: 'BillingPeriodsListResult',
63
64
  type: {
@@ -65,12 +66,14 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
65
66
  class_name: 'BillingPeriodsListResult',
66
67
  model_properties: {
67
68
  value: {
69
+ client_side_validation: true,
68
70
  required: false,
69
71
  read_only: true,
70
72
  serialized_name: 'value',
71
73
  type: {
72
74
  name: 'Sequence',
73
75
  element: {
76
+ client_side_validation: true,
74
77
  required: false,
75
78
  serialized_name: 'BillingPeriodElementType',
76
79
  type: {
@@ -81,6 +84,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
81
84
  }
82
85
  },
83
86
  next_link: {
87
+ client_side_validation: true,
84
88
  required: false,
85
89
  read_only: true,
86
90
  serialized_name: 'nextLink',
@@ -27,6 +27,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
27
27
  #
28
28
  def self.mapper()
29
29
  {
30
+ client_side_validation: true,
30
31
  required: false,
31
32
  serialized_name: 'DownloadUrl',
32
33
  type: {
@@ -34,6 +35,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
34
35
  class_name: 'DownloadUrl',
35
36
  model_properties: {
36
37
  expiry_time: {
38
+ client_side_validation: true,
37
39
  required: false,
38
40
  read_only: true,
39
41
  serialized_name: 'expiryTime',
@@ -42,6 +44,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
42
44
  }
43
45
  },
44
46
  url: {
47
+ client_side_validation: true,
45
48
  required: false,
46
49
  read_only: true,
47
50
  serialized_name: 'url',
@@ -28,6 +28,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
28
28
  #
29
29
  def self.mapper()
30
30
  {
31
+ client_side_validation: true,
31
32
  required: false,
32
33
  serialized_name: 'ErrorDetails',
33
34
  type: {
@@ -35,6 +36,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
35
36
  class_name: 'ErrorDetails',
36
37
  model_properties: {
37
38
  code: {
39
+ client_side_validation: true,
38
40
  required: false,
39
41
  read_only: true,
40
42
  serialized_name: 'code',
@@ -43,6 +45,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
43
45
  }
44
46
  },
45
47
  message: {
48
+ client_side_validation: true,
46
49
  required: false,
47
50
  read_only: true,
48
51
  serialized_name: 'message',
@@ -51,6 +54,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
51
54
  }
52
55
  },
53
56
  target: {
57
+ client_side_validation: true,
54
58
  required: false,
55
59
  read_only: true,
56
60
  serialized_name: 'target',
@@ -23,6 +23,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
23
23
  #
24
24
  def self.mapper()
25
25
  {
26
+ client_side_validation: true,
26
27
  required: false,
27
28
  serialized_name: 'ErrorResponse',
28
29
  type: {
@@ -30,6 +31,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
30
31
  class_name: 'ErrorResponse',
31
32
  model_properties: {
32
33
  error: {
34
+ client_side_validation: true,
33
35
  required: false,
34
36
  serialized_name: 'error',
35
37
  type: {
@@ -33,6 +33,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
33
33
  #
34
34
  def self.mapper()
35
35
  {
36
+ client_side_validation: true,
36
37
  required: false,
37
38
  serialized_name: 'Invoice',
38
39
  type: {
@@ -40,6 +41,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
40
41
  class_name: 'Invoice',
41
42
  model_properties: {
42
43
  id: {
44
+ client_side_validation: true,
43
45
  required: false,
44
46
  read_only: true,
45
47
  serialized_name: 'id',
@@ -48,6 +50,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
48
50
  }
49
51
  },
50
52
  name: {
53
+ client_side_validation: true,
51
54
  required: false,
52
55
  read_only: true,
53
56
  serialized_name: 'name',
@@ -56,6 +59,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
56
59
  }
57
60
  },
58
61
  type: {
62
+ client_side_validation: true,
59
63
  required: false,
60
64
  read_only: true,
61
65
  serialized_name: 'type',
@@ -64,6 +68,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
64
68
  }
65
69
  },
66
70
  download_url: {
71
+ client_side_validation: true,
67
72
  required: false,
68
73
  serialized_name: 'properties.downloadUrl',
69
74
  type: {
@@ -72,6 +77,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
72
77
  }
73
78
  },
74
79
  invoice_period_start_date: {
80
+ client_side_validation: true,
75
81
  required: false,
76
82
  read_only: true,
77
83
  serialized_name: 'properties.invoicePeriodStartDate',
@@ -80,6 +86,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
80
86
  }
81
87
  },
82
88
  invoice_period_end_date: {
89
+ client_side_validation: true,
83
90
  required: false,
84
91
  read_only: true,
85
92
  serialized_name: 'properties.invoicePeriodEndDate',
@@ -88,12 +95,14 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
88
95
  }
89
96
  },
90
97
  billing_period_ids: {
98
+ client_side_validation: true,
91
99
  required: false,
92
100
  read_only: true,
93
101
  serialized_name: 'properties.billingPeriodIds',
94
102
  type: {
95
103
  name: 'Sequence',
96
104
  element: {
105
+ client_side_validation: true,
97
106
  required: false,
98
107
  serialized_name: 'StringElementType',
99
108
  type: {
@@ -58,6 +58,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
58
58
  #
59
59
  def self.mapper()
60
60
  {
61
+ client_side_validation: true,
61
62
  required: false,
62
63
  serialized_name: 'InvoicesListResult',
63
64
  type: {
@@ -65,12 +66,14 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
65
66
  class_name: 'InvoicesListResult',
66
67
  model_properties: {
67
68
  value: {
69
+ client_side_validation: true,
68
70
  required: false,
69
71
  read_only: true,
70
72
  serialized_name: 'value',
71
73
  type: {
72
74
  name: 'Sequence',
73
75
  element: {
76
+ client_side_validation: true,
74
77
  required: false,
75
78
  serialized_name: 'InvoiceElementType',
76
79
  type: {
@@ -81,6 +84,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
81
84
  }
82
85
  },
83
86
  next_link: {
87
+ client_side_validation: true,
84
88
  required: false,
85
89
  read_only: true,
86
90
  serialized_name: 'nextLink',
@@ -25,6 +25,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
25
25
  #
26
26
  def self.mapper()
27
27
  {
28
+ client_side_validation: true,
28
29
  required: false,
29
30
  serialized_name: 'Operation',
30
31
  type: {
@@ -32,6 +33,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
32
33
  class_name: 'Operation',
33
34
  model_properties: {
34
35
  name: {
36
+ client_side_validation: true,
35
37
  required: false,
36
38
  read_only: true,
37
39
  serialized_name: 'name',
@@ -40,6 +42,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
40
42
  }
41
43
  },
42
44
  display: {
45
+ client_side_validation: true,
43
46
  required: false,
44
47
  serialized_name: 'display',
45
48
  type: {
@@ -29,6 +29,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
29
29
  #
30
30
  def self.mapper()
31
31
  {
32
+ client_side_validation: true,
32
33
  required: false,
33
34
  serialized_name: 'Operation_display',
34
35
  type: {
@@ -36,6 +37,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
36
37
  class_name: 'OperationDisplay',
37
38
  model_properties: {
38
39
  provider: {
40
+ client_side_validation: true,
39
41
  required: false,
40
42
  read_only: true,
41
43
  serialized_name: 'provider',
@@ -44,6 +46,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
44
46
  }
45
47
  },
46
48
  resource: {
49
+ client_side_validation: true,
47
50
  required: false,
48
51
  read_only: true,
49
52
  serialized_name: 'resource',
@@ -52,6 +55,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
52
55
  }
53
56
  },
54
57
  operation: {
58
+ client_side_validation: true,
55
59
  required: false,
56
60
  read_only: true,
57
61
  serialized_name: 'operation',
@@ -60,6 +60,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
60
60
  #
61
61
  def self.mapper()
62
62
  {
63
+ client_side_validation: true,
63
64
  required: false,
64
65
  serialized_name: 'OperationListResult',
65
66
  type: {
@@ -67,12 +68,14 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
67
68
  class_name: 'OperationListResult',
68
69
  model_properties: {
69
70
  value: {
71
+ client_side_validation: true,
70
72
  required: false,
71
73
  read_only: true,
72
74
  serialized_name: 'value',
73
75
  type: {
74
76
  name: 'Sequence',
75
77
  element: {
78
+ client_side_validation: true,
76
79
  required: false,
77
80
  serialized_name: 'OperationElementType',
78
81
  type: {
@@ -83,6 +86,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
83
86
  }
84
87
  },
85
88
  next_link: {
89
+ client_side_validation: true,
86
90
  required: false,
87
91
  read_only: true,
88
92
  serialized_name: 'nextLink',
@@ -28,6 +28,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
28
28
  #
29
29
  def self.mapper()
30
30
  {
31
+ client_side_validation: true,
31
32
  required: false,
32
33
  serialized_name: 'Resource',
33
34
  type: {
@@ -35,6 +36,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
35
36
  class_name: 'Resource',
36
37
  model_properties: {
37
38
  id: {
39
+ client_side_validation: true,
38
40
  required: false,
39
41
  read_only: true,
40
42
  serialized_name: 'id',
@@ -43,6 +45,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
43
45
  }
44
46
  },
45
47
  name: {
48
+ client_side_validation: true,
46
49
  required: false,
47
50
  read_only: true,
48
51
  serialized_name: 'name',
@@ -51,6 +54,7 @@ module Azure::Billing::Mgmt::V2017_04_24_preview
51
54
  }
52
55
  },
53
56
  type: {
57
+ client_side_validation: true,
54
58
  required: false,
55
59
  read_only: true,
56
60
  serialized_name: 'type',
@@ -4,15 +4,13 @@
4
4
 
5
5
  require 'profiles/latest/billing_module_definition'
6
6
  require 'profiles/latest/modules/billing_profile_module'
7
- require 'profiles/common/configurable'
8
- require 'profiles/common/default'
9
7
 
10
8
  module Azure::Billing::Profiles::Latest::Mgmt
11
9
  #
12
10
  # Client class for the Latest profile SDK.
13
11
  #
14
12
  class Client < BillingClass
15
- include Azure::Common::Configurable
13
+ include MsRestAzure::Common::Configurable
16
14
 
17
15
 
18
16
  def initialize(options = {})
@@ -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::Billing::Mgmt
6
- VERSION = '0.15.1'
6
+ VERSION = '0.15.2'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.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: 2017-12-19 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.10.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.10.0
83
83
  description: Microsoft Azure Billing Services Library for Ruby
84
84
  email: azrubyteam@microsoft.com
85
85
  executables: []
@@ -104,11 +104,8 @@ files:
104
104
  - lib/2017-04-24-preview/generated/azure_mgmt_billing/models/resource.rb
105
105
  - lib/2017-04-24-preview/generated/azure_mgmt_billing/module_definition.rb
106
106
  - lib/2017-04-24-preview/generated/azure_mgmt_billing/operations.rb
107
- - lib/2017-04-24-preview/generated/azure_mgmt_billing/version.rb
108
107
  - lib/azure_mgmt_billing.rb
109
108
  - lib/module_definition.rb
110
- - lib/profiles/common/configurable.rb
111
- - lib/profiles/common/default.rb
112
109
  - lib/profiles/latest/billing_latest_profile_client.rb
113
110
  - lib/profiles/latest/billing_module_definition.rb
114
111
  - lib/profiles/latest/modules/billing_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_billing
120
122
  post_install_message:
121
123
  rdoc_options: []
122
124
  require_paths:
@@ -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::Billing::Mgmt::V2017_04_24_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