azure_mgmt_resourcegraph 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph.rb +47 -0
  4. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/column.rb +59 -0
  5. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/column_data_type.rb +19 -0
  6. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/error.rb +79 -0
  7. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/error_details.rb +77 -0
  8. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/error_response.rb +49 -0
  9. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/facet.rb +60 -0
  10. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/facet_error.rb +79 -0
  11. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/facet_request.rb +59 -0
  12. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/facet_request_options.rb +91 -0
  13. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/facet_result.rb +94 -0
  14. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/facet_sort_order.rb +16 -0
  15. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/operation.rb +70 -0
  16. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/operation_display.rb +79 -0
  17. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/operation_list_result.rb +57 -0
  18. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/query_request.rb +99 -0
  19. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/query_request_options.rb +80 -0
  20. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/query_response.rb +119 -0
  21. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/result_truncated.rb +16 -0
  22. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/models/table.rb +82 -0
  23. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/module_definition.rb +9 -0
  24. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/operations.rb +107 -0
  25. data/lib/2019-04-01/generated/azure_mgmt_resourcegraph/resource_graph_client.rb +224 -0
  26. data/lib/azure_mgmt_resourcegraph.rb +6 -0
  27. data/lib/module_definition.rb +7 -0
  28. data/lib/profiles/latest/modules/resourcegraph_profile_module.rb +137 -0
  29. data/lib/profiles/latest/resourcegraph_latest_profile_client.rb +40 -0
  30. data/lib/profiles/latest/resourcegraph_module_definition.rb +8 -0
  31. data/lib/version.rb +7 -0
  32. metadata +148 -0
@@ -0,0 +1,99 @@
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::ResourceGraph::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # Describes a query to be executed.
10
+ #
11
+ class QueryRequest
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<String>] Azure subscriptions against which to execute
16
+ # the query.
17
+ attr_accessor :subscriptions
18
+
19
+ # @return [String] The resources query.
20
+ attr_accessor :query
21
+
22
+ # @return [QueryRequestOptions] The query evaluation options
23
+ attr_accessor :options
24
+
25
+ # @return [Array<FacetRequest>] An array of facet requests to be computed
26
+ # against the query result.
27
+ attr_accessor :facets
28
+
29
+
30
+ #
31
+ # Mapper for QueryRequest class as Ruby Hash.
32
+ # This will be used for serialization/deserialization.
33
+ #
34
+ def self.mapper()
35
+ {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'QueryRequest',
39
+ type: {
40
+ name: 'Composite',
41
+ class_name: 'QueryRequest',
42
+ model_properties: {
43
+ subscriptions: {
44
+ client_side_validation: true,
45
+ required: true,
46
+ serialized_name: 'subscriptions',
47
+ type: {
48
+ name: 'Sequence',
49
+ element: {
50
+ client_side_validation: true,
51
+ required: false,
52
+ serialized_name: 'StringElementType',
53
+ type: {
54
+ name: 'String'
55
+ }
56
+ }
57
+ }
58
+ },
59
+ query: {
60
+ client_side_validation: true,
61
+ required: true,
62
+ serialized_name: 'query',
63
+ type: {
64
+ name: 'String'
65
+ }
66
+ },
67
+ options: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ serialized_name: 'options',
71
+ type: {
72
+ name: 'Composite',
73
+ class_name: 'QueryRequestOptions'
74
+ }
75
+ },
76
+ facets: {
77
+ client_side_validation: true,
78
+ required: false,
79
+ serialized_name: 'facets',
80
+ type: {
81
+ name: 'Sequence',
82
+ element: {
83
+ client_side_validation: true,
84
+ required: false,
85
+ serialized_name: 'FacetRequestElementType',
86
+ type: {
87
+ name: 'Composite',
88
+ class_name: 'FacetRequest'
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,80 @@
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::ResourceGraph::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # The options for query evaluation
10
+ #
11
+ class QueryRequestOptions
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Continuation token for pagination, capturing the next
16
+ # page size and offset, as well as the context of the query.
17
+ attr_accessor :skip_token
18
+
19
+ # @return [Integer] The maximum number of rows that the query should
20
+ # return. Overrides the page size when ```$skipToken``` property is
21
+ # present.
22
+ attr_accessor :top
23
+
24
+ # @return [Integer] The number of rows to skip from the beginning of the
25
+ # results. Overrides the next page offset when ```$skipToken``` property
26
+ # is present.
27
+ attr_accessor :skip
28
+
29
+
30
+ #
31
+ # Mapper for QueryRequestOptions class as Ruby Hash.
32
+ # This will be used for serialization/deserialization.
33
+ #
34
+ def self.mapper()
35
+ {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'QueryRequestOptions',
39
+ type: {
40
+ name: 'Composite',
41
+ class_name: 'QueryRequestOptions',
42
+ model_properties: {
43
+ skip_token: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: '$skipToken',
47
+ type: {
48
+ name: 'String'
49
+ }
50
+ },
51
+ top: {
52
+ client_side_validation: true,
53
+ required: false,
54
+ serialized_name: '$top',
55
+ constraints: {
56
+ InclusiveMaximum: 1000,
57
+ InclusiveMinimum: 1
58
+ },
59
+ type: {
60
+ name: 'Number'
61
+ }
62
+ },
63
+ skip: {
64
+ client_side_validation: true,
65
+ required: false,
66
+ serialized_name: '$skip',
67
+ constraints: {
68
+ InclusiveMinimum: 0
69
+ },
70
+ type: {
71
+ name: 'Number'
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,119 @@
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::ResourceGraph::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # Query result.
10
+ #
11
+ class QueryResponse
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Integer] Number of total records matching the query.
16
+ attr_accessor :total_records
17
+
18
+ # @return [Integer] Number of records returned in the current response.
19
+ # In the case of paging, this is the number of records in the current
20
+ # page.
21
+ attr_accessor :count
22
+
23
+ # @return [ResultTruncated] Indicates whether the query results are
24
+ # truncated. Possible values include: 'true', 'false'
25
+ attr_accessor :result_truncated
26
+
27
+ # @return [String] When present, the value can be passed to a subsequent
28
+ # query call (together with the same query and subscriptions used in the
29
+ # current request) to retrieve the next page of data.
30
+ attr_accessor :skip_token
31
+
32
+ # @return [Table] Query output in tabular format.
33
+ attr_accessor :data
34
+
35
+ # @return [Array<Facet>] Query facets.
36
+ attr_accessor :facets
37
+
38
+
39
+ #
40
+ # Mapper for QueryResponse class as Ruby Hash.
41
+ # This will be used for serialization/deserialization.
42
+ #
43
+ def self.mapper()
44
+ {
45
+ client_side_validation: true,
46
+ required: false,
47
+ serialized_name: 'QueryResponse',
48
+ type: {
49
+ name: 'Composite',
50
+ class_name: 'QueryResponse',
51
+ model_properties: {
52
+ total_records: {
53
+ client_side_validation: true,
54
+ required: true,
55
+ serialized_name: 'totalRecords',
56
+ type: {
57
+ name: 'Number'
58
+ }
59
+ },
60
+ count: {
61
+ client_side_validation: true,
62
+ required: true,
63
+ serialized_name: 'count',
64
+ type: {
65
+ name: 'Number'
66
+ }
67
+ },
68
+ result_truncated: {
69
+ client_side_validation: true,
70
+ required: true,
71
+ serialized_name: 'resultTruncated',
72
+ type: {
73
+ name: 'Enum',
74
+ module: 'ResultTruncated'
75
+ }
76
+ },
77
+ skip_token: {
78
+ client_side_validation: true,
79
+ required: false,
80
+ serialized_name: '$skipToken',
81
+ type: {
82
+ name: 'String'
83
+ }
84
+ },
85
+ data: {
86
+ client_side_validation: true,
87
+ required: true,
88
+ serialized_name: 'data',
89
+ type: {
90
+ name: 'Composite',
91
+ class_name: 'Table'
92
+ }
93
+ },
94
+ facets: {
95
+ client_side_validation: true,
96
+ required: false,
97
+ serialized_name: 'facets',
98
+ type: {
99
+ name: 'Sequence',
100
+ element: {
101
+ client_side_validation: true,
102
+ required: false,
103
+ serialized_name: 'FacetElementType',
104
+ type: {
105
+ name: 'Composite',
106
+ polymorphic_discriminator: 'resultType',
107
+ uber_parent: 'Facet',
108
+ class_name: 'Facet'
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ end
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,16 @@
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::ResourceGraph::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # Defines values for ResultTruncated
10
+ #
11
+ module ResultTruncated
12
+ True = "true"
13
+ False = "false"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,82 @@
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::ResourceGraph::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # Query output in tabular format.
10
+ #
11
+ class Table
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<Column>] Query result column descriptors.
16
+ attr_accessor :columns
17
+
18
+ # @return Query result rows.
19
+ attr_accessor :rows
20
+
21
+
22
+ #
23
+ # Mapper for Table class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'Table',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'Table',
34
+ model_properties: {
35
+ columns: {
36
+ client_side_validation: true,
37
+ required: true,
38
+ serialized_name: 'columns',
39
+ type: {
40
+ name: 'Sequence',
41
+ element: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ serialized_name: 'ColumnElementType',
45
+ type: {
46
+ name: 'Composite',
47
+ class_name: 'Column'
48
+ }
49
+ }
50
+ }
51
+ },
52
+ rows: {
53
+ client_side_validation: true,
54
+ required: true,
55
+ serialized_name: 'rows',
56
+ type: {
57
+ name: 'Sequence',
58
+ element: {
59
+ client_side_validation: true,
60
+ required: false,
61
+ serialized_name: 'ArrayElementType',
62
+ type: {
63
+ name: 'Sequence',
64
+ element: {
65
+ client_side_validation: true,
66
+ required: false,
67
+ serialized_name: 'ObjectElementType',
68
+ type: {
69
+ name: 'Object'
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::ResourceGraph end
8
+ module Azure::ResourceGraph::Mgmt end
9
+ module Azure::ResourceGraph::Mgmt::V2019_04_01 end
@@ -0,0 +1,107 @@
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::ResourceGraph::Mgmt::V2019_04_01
7
+ #
8
+ # Azure Resource Graph API Reference
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceGraphClient] reference to the ResourceGraphClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all of the available REST API operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [OperationListResult] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ response = list_async(custom_headers:custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Lists all of the available REST API operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the available REST API operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'providers/Microsoft.ResourceGraph/operations'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ query_params: {'api-version' => @client.api_version},
74
+ headers: request_headers.merge(custom_headers || {}),
75
+ base_url: request_url
76
+ }
77
+ promise = @client.make_request_async(:get, path_template, options)
78
+
79
+ promise = promise.then do |result|
80
+ http_response = result.response
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless status_code == 200
84
+ error_model = JSON.load(response_content)
85
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
86
+ end
87
+
88
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ # Deserialize Response
90
+ if status_code == 200
91
+ begin
92
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
93
+ result_mapper = Azure::ResourceGraph::Mgmt::V2019_04_01::Models::OperationListResult.mapper()
94
+ result.body = @client.deserialize(result_mapper, parsed_response)
95
+ rescue Exception => e
96
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
97
+ end
98
+ end
99
+
100
+ result
101
+ end
102
+
103
+ promise.execute
104
+ end
105
+
106
+ end
107
+ end