Class: Google::Apis::SourcerepoV1::CloudSourceRepositoriesService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::SourcerepoV1::CloudSourceRepositoriesService
- Defined in:
- generated/google/apis/sourcerepo_v1/service.rb
Overview
Cloud Source Repositories API
Access source code repositories hosted by Google.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#create_project_repo(parent, repo_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Repo
Creates a repo in the given project with the given name..
-
#delete_project_repo(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Empty
Deletes a repo.
-
#get_project_repo(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Repo
Returns information about a repo.
-
#get_project_repo_iam_policy(resource, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Policy
Gets the access control policy for a resource.
-
#initialize ⇒ CloudSourceRepositoriesService
constructor
A new instance of CloudSourceRepositoriesService.
-
#list_project_repos(name, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::ListReposResponse
Returns all repos belonging to a project.
-
#set_repo_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Policy
Sets the access control policy on the specified resource.
-
#test_repo_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::TestIamPermissionsResponse
Returns permissions that a caller has on the specified resource.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ CloudSourceRepositoriesService
Returns a new instance of CloudSourceRepositoriesService
45 46 47 48 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 45 def initialize super('https://sourcerepo.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
43 44 45 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#create_project_repo(parent, repo_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Repo
Creates a repo in the given project with the given name..
If the named repository already exists, CreateRepo
returns
ALREADY_EXISTS
.
145 146 147 148 149 150 151 152 153 154 155 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 145 def create_project_repo(parent, repo_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/repos', ) command.request_representation = Google::Apis::SourcerepoV1::Repo::Representation command.request_object = repo_object command.response_representation = Google::Apis::SourcerepoV1::Repo::Representation command.response_class = Google::Apis::SourcerepoV1::Repo command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_project_repo(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Empty
Deletes a repo.
71 72 73 74 75 76 77 78 79 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 71 def delete_project_repo(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::SourcerepoV1::Empty::Representation command.response_class = Google::Apis::SourcerepoV1::Empty command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_repo(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Repo
Returns information about a repo.
246 247 248 249 250 251 252 253 254 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 246 def get_project_repo(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::SourcerepoV1::Repo::Representation command.response_class = Google::Apis::SourcerepoV1::Repo command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_repo_iam_policy(resource, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Policy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
215 216 217 218 219 220 221 222 223 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 215 def get_project_repo_iam_policy(resource, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', ) command.response_representation = Google::Apis::SourcerepoV1::Policy::Representation command.response_class = Google::Apis::SourcerepoV1::Policy command.params['resource'] = resource unless resource.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_project_repos(name, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::ListReposResponse
Returns all repos belonging to a project.
109 110 111 112 113 114 115 116 117 118 119 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 109 def list_project_repos(name, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}/repos', ) command.response_representation = Google::Apis::SourcerepoV1::ListReposResponse::Representation command.response_class = Google::Apis::SourcerepoV1::ListReposResponse command.params['name'] = name unless name.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#set_repo_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::Policy
Sets the access control policy on the specified resource. Replaces any existing policy.
180 181 182 183 184 185 186 187 188 189 190 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 180 def set_repo_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', ) command.request_representation = Google::Apis::SourcerepoV1::SetIamPolicyRequest::Representation command.request_object = set_iam_policy_request_object command.response_representation = Google::Apis::SourcerepoV1::Policy::Representation command.response_class = Google::Apis::SourcerepoV1::Policy command.params['resource'] = resource unless resource.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#test_repo_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SourcerepoV1::TestIamPermissionsResponse
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
280 281 282 283 284 285 286 287 288 289 290 |
# File 'generated/google/apis/sourcerepo_v1/service.rb', line 280 def (resource, = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', ) command.request_representation = Google::Apis::SourcerepoV1::TestIamPermissionsRequest::Representation command.request_object = command.response_representation = Google::Apis::SourcerepoV1::TestIamPermissionsResponse::Representation command.response_class = Google::Apis::SourcerepoV1::TestIamPermissionsResponse command.params['resource'] = resource unless resource.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |