google-apis-cloudasset_v1p1beta1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module CloudassetV1p1beta1
18
+ # Version of the google-apis-cloudasset_v1p1beta1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201106"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,201 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module CloudassetV1p1beta1
24
+
25
+ class AuditConfig
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AuditLogConfig
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class Binding
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class Explanation
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class Expr
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class IamPolicySearchResult
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Permissions
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Policy
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class SearchAllIamPoliciesResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class SearchAllResourcesResponse
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class StandardResourceMetadata
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class AuditConfig
92
+ # @private
93
+ class Representation < Google::Apis::Core::JsonRepresentation
94
+ collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::CloudassetV1p1beta1::AuditLogConfig, decorator: Google::Apis::CloudassetV1p1beta1::AuditLogConfig::Representation
95
+
96
+ property :service, as: 'service'
97
+ end
98
+ end
99
+
100
+ class AuditLogConfig
101
+ # @private
102
+ class Representation < Google::Apis::Core::JsonRepresentation
103
+ collection :exempted_members, as: 'exemptedMembers'
104
+ property :log_type, as: 'logType'
105
+ end
106
+ end
107
+
108
+ class Binding
109
+ # @private
110
+ class Representation < Google::Apis::Core::JsonRepresentation
111
+ property :condition, as: 'condition', class: Google::Apis::CloudassetV1p1beta1::Expr, decorator: Google::Apis::CloudassetV1p1beta1::Expr::Representation
112
+
113
+ collection :members, as: 'members'
114
+ property :role, as: 'role'
115
+ end
116
+ end
117
+
118
+ class Explanation
119
+ # @private
120
+ class Representation < Google::Apis::Core::JsonRepresentation
121
+ hash :matched_permissions, as: 'matchedPermissions', class: Google::Apis::CloudassetV1p1beta1::Permissions, decorator: Google::Apis::CloudassetV1p1beta1::Permissions::Representation
122
+
123
+ end
124
+ end
125
+
126
+ class Expr
127
+ # @private
128
+ class Representation < Google::Apis::Core::JsonRepresentation
129
+ property :description, as: 'description'
130
+ property :expression, as: 'expression'
131
+ property :location, as: 'location'
132
+ property :title, as: 'title'
133
+ end
134
+ end
135
+
136
+ class IamPolicySearchResult
137
+ # @private
138
+ class Representation < Google::Apis::Core::JsonRepresentation
139
+ property :explanation, as: 'explanation', class: Google::Apis::CloudassetV1p1beta1::Explanation, decorator: Google::Apis::CloudassetV1p1beta1::Explanation::Representation
140
+
141
+ property :policy, as: 'policy', class: Google::Apis::CloudassetV1p1beta1::Policy, decorator: Google::Apis::CloudassetV1p1beta1::Policy::Representation
142
+
143
+ property :project, as: 'project'
144
+ property :resource, as: 'resource'
145
+ end
146
+ end
147
+
148
+ class Permissions
149
+ # @private
150
+ class Representation < Google::Apis::Core::JsonRepresentation
151
+ collection :permissions, as: 'permissions'
152
+ end
153
+ end
154
+
155
+ class Policy
156
+ # @private
157
+ class Representation < Google::Apis::Core::JsonRepresentation
158
+ collection :audit_configs, as: 'auditConfigs', class: Google::Apis::CloudassetV1p1beta1::AuditConfig, decorator: Google::Apis::CloudassetV1p1beta1::AuditConfig::Representation
159
+
160
+ collection :bindings, as: 'bindings', class: Google::Apis::CloudassetV1p1beta1::Binding, decorator: Google::Apis::CloudassetV1p1beta1::Binding::Representation
161
+
162
+ property :etag, :base64 => true, as: 'etag'
163
+ property :version, as: 'version'
164
+ end
165
+ end
166
+
167
+ class SearchAllIamPoliciesResponse
168
+ # @private
169
+ class Representation < Google::Apis::Core::JsonRepresentation
170
+ property :next_page_token, as: 'nextPageToken'
171
+ collection :results, as: 'results', class: Google::Apis::CloudassetV1p1beta1::IamPolicySearchResult, decorator: Google::Apis::CloudassetV1p1beta1::IamPolicySearchResult::Representation
172
+
173
+ end
174
+ end
175
+
176
+ class SearchAllResourcesResponse
177
+ # @private
178
+ class Representation < Google::Apis::Core::JsonRepresentation
179
+ property :next_page_token, as: 'nextPageToken'
180
+ collection :results, as: 'results', class: Google::Apis::CloudassetV1p1beta1::StandardResourceMetadata, decorator: Google::Apis::CloudassetV1p1beta1::StandardResourceMetadata::Representation
181
+
182
+ end
183
+ end
184
+
185
+ class StandardResourceMetadata
186
+ # @private
187
+ class Representation < Google::Apis::Core::JsonRepresentation
188
+ collection :additional_attributes, as: 'additionalAttributes'
189
+ property :asset_type, as: 'assetType'
190
+ property :description, as: 'description'
191
+ property :display_name, as: 'displayName'
192
+ hash :labels, as: 'labels'
193
+ property :location, as: 'location'
194
+ property :name, as: 'name'
195
+ collection :network_tags, as: 'networkTags'
196
+ property :project, as: 'project'
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end
@@ -0,0 +1,178 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CloudassetV1p1beta1
23
+ # Cloud Asset API
24
+ #
25
+ # The cloud asset API manages the history and inventory of cloud resources.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudasset_v1p1beta1'
29
+ #
30
+ # Cloudasset = Google::Apis::CloudassetV1p1beta1 # Alias the module
31
+ # service = Cloudasset::CloudAssetService.new
32
+ #
33
+ # @see https://cloud.google.com/asset-inventory/docs/quickstart
34
+ class CloudAssetService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://cloudasset.googleapis.com/', '',
47
+ client_name: 'google-apis-cloudasset_v1p1beta1',
48
+ client_version: Google::Apis::CloudassetV1p1beta1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Searches all the IAM policies within a given accessible CRM scope (project/
53
+ # folder/organization). This RPC gives callers especially administrators the
54
+ # ability to search all the IAM policies within a scope, even if they don't have
55
+ # `.getIamPolicy` permission of all the IAM policies. Callers should have `cloud.
56
+ # assets.SearchAllIamPolicies` permission on the requested scope, otherwise the
57
+ # request will be rejected.
58
+ # @param [String] scope
59
+ # Required. The relative name of an asset. The search is limited to the
60
+ # resources within the `scope`. The allowed value must be: * Organization number
61
+ # (such as "organizations/123") * Folder number(such as "folders/1234") *
62
+ # Project number (such as "projects/12345") * Project id (such as "projects/abc")
63
+ # @param [Fixnum] page_size
64
+ # Optional. The page size for search result pagination. Page size is capped at
65
+ # 500 even if a larger value is given. If set to zero, server will pick an
66
+ # appropriate default. Returned results may be fewer than requested. When this
67
+ # happens, there could be more results as long as `next_page_token` is returned.
68
+ # @param [String] page_token
69
+ # Optional. If present, retrieve the next batch of results from the preceding
70
+ # call to this method. `page_token` must be the value of `next_page_token` from
71
+ # the previous response. The values of all other method parameters must be
72
+ # identical to those in the previous call.
73
+ # @param [String] query
74
+ # Optional. The query statement. Examples: * "policy:myuser@mydomain.com" * "
75
+ # policy:(myuser@mydomain.com viewer)"
76
+ # @param [String] fields
77
+ # Selector specifying which fields to include in a partial response.
78
+ # @param [String] quota_user
79
+ # Available to use for quota purposes for server-side applications. Can be any
80
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
81
+ # @param [Google::Apis::RequestOptions] options
82
+ # Request-specific options
83
+ #
84
+ # @yield [result, err] Result & error if block supplied
85
+ # @yieldparam result [Google::Apis::CloudassetV1p1beta1::SearchAllIamPoliciesResponse] parsed result object
86
+ # @yieldparam err [StandardError] error object if request failed
87
+ #
88
+ # @return [Google::Apis::CloudassetV1p1beta1::SearchAllIamPoliciesResponse]
89
+ #
90
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
91
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
92
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
93
+ def search_iam_policy_all(scope, page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
94
+ command = make_simple_command(:get, 'v1p1beta1/{+scope}/iamPolicies:searchAll', options)
95
+ command.response_representation = Google::Apis::CloudassetV1p1beta1::SearchAllIamPoliciesResponse::Representation
96
+ command.response_class = Google::Apis::CloudassetV1p1beta1::SearchAllIamPoliciesResponse
97
+ command.params['scope'] = scope unless scope.nil?
98
+ command.query['pageSize'] = page_size unless page_size.nil?
99
+ command.query['pageToken'] = page_token unless page_token.nil?
100
+ command.query['query'] = query unless query.nil?
101
+ command.query['fields'] = fields unless fields.nil?
102
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
103
+ execute_or_queue_command(command, &block)
104
+ end
105
+
106
+ # Searches all the resources within a given accessible CRM scope (project/folder/
107
+ # organization). This RPC gives callers especially administrators the ability to
108
+ # search all the resources within a scope, even if they don't have `.get`
109
+ # permission of all the resources. Callers should have `cloud.assets.
110
+ # SearchAllResources` permission on the requested scope, otherwise the request
111
+ # will be rejected.
112
+ # @param [String] scope
113
+ # Required. The relative name of an asset. The search is limited to the
114
+ # resources within the `scope`. The allowed value must be: * Organization number
115
+ # (such as "organizations/123") * Folder number(such as "folders/1234") *
116
+ # Project number (such as "projects/12345") * Project id (such as "projects/abc")
117
+ # @param [Array<String>, String] asset_types
118
+ # Optional. A list of asset types that this request searches for. If empty, it
119
+ # will search all the supported asset types.
120
+ # @param [String] order_by
121
+ # Optional. A comma separated list of fields specifying the sorting order of the
122
+ # results. The default order is ascending. Add ` DESC` after the field name to
123
+ # indicate descending order. Redundant space characters are ignored. For example,
124
+ # ` location DESC , name `.
125
+ # @param [Fixnum] page_size
126
+ # Optional. The page size for search result pagination. Page size is capped at
127
+ # 500 even if a larger value is given. If set to zero, server will pick an
128
+ # appropriate default. Returned results may be fewer than requested. When this
129
+ # happens, there could be more results as long as `next_page_token` is returned.
130
+ # @param [String] page_token
131
+ # Optional. If present, then retrieve the next batch of results from the
132
+ # preceding call to this method. `page_token` must be the value of `
133
+ # next_page_token` from the previous response. The values of all other method
134
+ # parameters, must be identical to those in the previous call.
135
+ # @param [String] query
136
+ # Optional. The query statement.
137
+ # @param [String] fields
138
+ # Selector specifying which fields to include in a partial response.
139
+ # @param [String] quota_user
140
+ # Available to use for quota purposes for server-side applications. Can be any
141
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
142
+ # @param [Google::Apis::RequestOptions] options
143
+ # Request-specific options
144
+ #
145
+ # @yield [result, err] Result & error if block supplied
146
+ # @yieldparam result [Google::Apis::CloudassetV1p1beta1::SearchAllResourcesResponse] parsed result object
147
+ # @yieldparam err [StandardError] error object if request failed
148
+ #
149
+ # @return [Google::Apis::CloudassetV1p1beta1::SearchAllResourcesResponse]
150
+ #
151
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
152
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
153
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
154
+ def search_resource_all(scope, asset_types: nil, order_by: nil, page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
155
+ command = make_simple_command(:get, 'v1p1beta1/{+scope}/resources:searchAll', options)
156
+ command.response_representation = Google::Apis::CloudassetV1p1beta1::SearchAllResourcesResponse::Representation
157
+ command.response_class = Google::Apis::CloudassetV1p1beta1::SearchAllResourcesResponse
158
+ command.params['scope'] = scope unless scope.nil?
159
+ command.query['assetTypes'] = asset_types unless asset_types.nil?
160
+ command.query['orderBy'] = order_by unless order_by.nil?
161
+ command.query['pageSize'] = page_size unless page_size.nil?
162
+ command.query['pageToken'] = page_token unless page_token.nil?
163
+ command.query['query'] = query unless query.nil?
164
+ command.query['fields'] = fields unless fields.nil?
165
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
166
+ execute_or_queue_command(command, &block)
167
+ end
168
+
169
+ protected
170
+
171
+ def apply_command_defaults(command)
172
+ command.query['key'] = key unless key.nil?
173
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
174
+ end
175
+ end
176
+ end
177
+ end
178
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-cloudasset_v1p1beta1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Cloud Asset API V1p1beta1. Simple
28
+ REST clients are Ruby client libraries that provide access to Google services via
29
+ their HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Cloud Asset API, but note that some services may provide
33
+ a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-cloudasset_v1p1beta1.rb
44
+ - lib/google/apis/cloudasset_v1p1beta1.rb
45
+ - lib/google/apis/cloudasset_v1p1beta1/classes.rb
46
+ - lib/google/apis/cloudasset_v1p1beta1/gem_version.rb
47
+ - lib/google/apis/cloudasset_v1p1beta1/representations.rb
48
+ - lib/google/apis/cloudasset_v1p1beta1/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-cloudasset_v1p1beta1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-cloudasset_v1p1beta1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-cloudasset_v1p1beta1
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Cloud Asset API V1p1beta1
76
+ test_files: []