1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package privateca provides access to the Certificate Authority API. 8// 9// For product documentation, see: https://cloud.google.com/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/privateca/v1beta1" 16// ... 17// ctx := context.Background() 18// privatecaService, err := privateca.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// privatecaService, err := privateca.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// privatecaService, err := privateca.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package privateca // import "google.golang.org/api/privateca/v1beta1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "privateca:v1beta1" 75const apiName = "privateca" 76const apiVersion = "v1beta1" 77const basePath = "https://privateca.googleapis.com/" 78const mtlsBasePath = "https://privateca.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, edit, configure, and delete your Google Cloud Platform data 83 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/cloud-platform", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Projects = NewProjectsService(s) 120 return s, nil 121} 122 123type Service struct { 124 client *http.Client 125 BasePath string // API endpoint base URL 126 UserAgent string // optional additional User-Agent fragment 127 128 Projects *ProjectsService 129} 130 131func (s *Service) userAgent() string { 132 if s.UserAgent == "" { 133 return googleapi.UserAgent 134 } 135 return googleapi.UserAgent + " " + s.UserAgent 136} 137 138func NewProjectsService(s *Service) *ProjectsService { 139 rs := &ProjectsService{s: s} 140 rs.Locations = NewProjectsLocationsService(s) 141 return rs 142} 143 144type ProjectsService struct { 145 s *Service 146 147 Locations *ProjectsLocationsService 148} 149 150func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 151 rs := &ProjectsLocationsService{s: s} 152 rs.CertificateAuthorities = NewProjectsLocationsCertificateAuthoritiesService(s) 153 rs.Operations = NewProjectsLocationsOperationsService(s) 154 rs.ReusableConfigs = NewProjectsLocationsReusableConfigsService(s) 155 return rs 156} 157 158type ProjectsLocationsService struct { 159 s *Service 160 161 CertificateAuthorities *ProjectsLocationsCertificateAuthoritiesService 162 163 Operations *ProjectsLocationsOperationsService 164 165 ReusableConfigs *ProjectsLocationsReusableConfigsService 166} 167 168func NewProjectsLocationsCertificateAuthoritiesService(s *Service) *ProjectsLocationsCertificateAuthoritiesService { 169 rs := &ProjectsLocationsCertificateAuthoritiesService{s: s} 170 rs.CertificateRevocationLists = NewProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService(s) 171 rs.Certificates = NewProjectsLocationsCertificateAuthoritiesCertificatesService(s) 172 return rs 173} 174 175type ProjectsLocationsCertificateAuthoritiesService struct { 176 s *Service 177 178 CertificateRevocationLists *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService 179 180 Certificates *ProjectsLocationsCertificateAuthoritiesCertificatesService 181} 182 183func NewProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService(s *Service) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService { 184 rs := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService{s: s} 185 return rs 186} 187 188type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService struct { 189 s *Service 190} 191 192func NewProjectsLocationsCertificateAuthoritiesCertificatesService(s *Service) *ProjectsLocationsCertificateAuthoritiesCertificatesService { 193 rs := &ProjectsLocationsCertificateAuthoritiesCertificatesService{s: s} 194 return rs 195} 196 197type ProjectsLocationsCertificateAuthoritiesCertificatesService struct { 198 s *Service 199} 200 201func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 202 rs := &ProjectsLocationsOperationsService{s: s} 203 return rs 204} 205 206type ProjectsLocationsOperationsService struct { 207 s *Service 208} 209 210func NewProjectsLocationsReusableConfigsService(s *Service) *ProjectsLocationsReusableConfigsService { 211 rs := &ProjectsLocationsReusableConfigsService{s: s} 212 return rs 213} 214 215type ProjectsLocationsReusableConfigsService struct { 216 s *Service 217} 218 219// AccessUrls: URLs where a CertificateAuthority will publish content. 220type AccessUrls struct { 221 // CaCertificateAccessUrl: The URL where this CertificateAuthority's CA 222 // certificate is published. This will only be set for CAs that have 223 // been activated. 224 CaCertificateAccessUrl string `json:"caCertificateAccessUrl,omitempty"` 225 226 // CrlAccessUrl: The URL where this CertificateAuthority's CRLs are 227 // published. This will only be set for CAs that have been activated. 228 CrlAccessUrl string `json:"crlAccessUrl,omitempty"` 229 230 // ForceSendFields is a list of field names (e.g. 231 // "CaCertificateAccessUrl") to unconditionally include in API requests. 232 // By default, fields with empty values are omitted from API requests. 233 // However, any non-pointer, non-interface field appearing in 234 // ForceSendFields will be sent to the server regardless of whether the 235 // field is empty or not. This may be used to include empty fields in 236 // Patch requests. 237 ForceSendFields []string `json:"-"` 238 239 // NullFields is a list of field names (e.g. "CaCertificateAccessUrl") 240 // to include in API requests with the JSON null value. By default, 241 // fields with empty values are omitted from API requests. However, any 242 // field with an empty value appearing in NullFields will be sent to the 243 // server as null. It is an error if a field in this list has a 244 // non-empty value. This may be used to include null fields in Patch 245 // requests. 246 NullFields []string `json:"-"` 247} 248 249func (s *AccessUrls) MarshalJSON() ([]byte, error) { 250 type NoMethod AccessUrls 251 raw := NoMethod(*s) 252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 253} 254 255// ActivateCertificateAuthorityRequest: Request message for 256// CertificateAuthorityService.ActivateCertificateAuthority. 257type ActivateCertificateAuthorityRequest struct { 258 // PemCaCertificate: Required. The signed CA certificate issued from 259 // FetchCertificateAuthorityCsrResponse.pem_csr. 260 PemCaCertificate string `json:"pemCaCertificate,omitempty"` 261 262 // RequestId: Optional. An ID to identify requests. Specify a unique 263 // request ID so that if you must retry your request, the server will 264 // know to ignore the request if it has already been completed. The 265 // server will guarantee that for at least 60 minutes since the first 266 // request. For example, consider a situation where you make an initial 267 // request and t he request times out. If you make the request again 268 // with the same request ID, the server can check if original operation 269 // with the same request ID was received, and if so, will ignore the 270 // second request. This prevents clients from accidentally creating 271 // duplicate commitments. The request ID must be a valid UUID with the 272 // exception that zero UUID is not supported 273 // (00000000-0000-0000-0000-000000000000). 274 RequestId string `json:"requestId,omitempty"` 275 276 // SubordinateConfig: Required. Must include information about the 277 // issuer of 'pem_ca_certificate', and any further issuers until the 278 // self-signed CA. 279 SubordinateConfig *SubordinateConfig `json:"subordinateConfig,omitempty"` 280 281 // ForceSendFields is a list of field names (e.g. "PemCaCertificate") to 282 // unconditionally include in API requests. By default, fields with 283 // empty values are omitted from API requests. However, any non-pointer, 284 // non-interface field appearing in ForceSendFields will be sent to the 285 // server regardless of whether the field is empty or not. This may be 286 // used to include empty fields in Patch requests. 287 ForceSendFields []string `json:"-"` 288 289 // NullFields is a list of field names (e.g. "PemCaCertificate") to 290 // include in API requests with the JSON null value. By default, fields 291 // with empty values are omitted from API requests. However, any field 292 // with an empty value appearing in NullFields will be sent to the 293 // server as null. It is an error if a field in this list has a 294 // non-empty value. This may be used to include null fields in Patch 295 // requests. 296 NullFields []string `json:"-"` 297} 298 299func (s *ActivateCertificateAuthorityRequest) MarshalJSON() ([]byte, error) { 300 type NoMethod ActivateCertificateAuthorityRequest 301 raw := NoMethod(*s) 302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 303} 304 305type AllowedConfigList struct { 306 // AllowedConfigValues: Required. All Certificates issued by the 307 // CertificateAuthority must match at least one listed 308 // ReusableConfigWrapper. If a ReusableConfigWrapper has an empty field, 309 // any value will be allowed for that field. 310 AllowedConfigValues []*ReusableConfigWrapper `json:"allowedConfigValues,omitempty"` 311 312 // ForceSendFields is a list of field names (e.g. "AllowedConfigValues") 313 // to unconditionally include in API requests. By default, fields with 314 // empty values are omitted from API requests. However, any non-pointer, 315 // non-interface field appearing in ForceSendFields will be sent to the 316 // server regardless of whether the field is empty or not. This may be 317 // used to include empty fields in Patch requests. 318 ForceSendFields []string `json:"-"` 319 320 // NullFields is a list of field names (e.g. "AllowedConfigValues") to 321 // include in API requests with the JSON null value. By default, fields 322 // with empty values are omitted from API requests. However, any field 323 // with an empty value appearing in NullFields will be sent to the 324 // server as null. It is an error if a field in this list has a 325 // non-empty value. This may be used to include null fields in Patch 326 // requests. 327 NullFields []string `json:"-"` 328} 329 330func (s *AllowedConfigList) MarshalJSON() ([]byte, error) { 331 type NoMethod AllowedConfigList 332 raw := NoMethod(*s) 333 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 334} 335 336// AllowedSubjectAltNames: AllowedSubjectAltNames specifies the allowed 337// values for SubjectAltNames by the CertificateAuthority when issuing 338// Certificates. 339type AllowedSubjectAltNames struct { 340 // AllowCustomSans: Optional. Specifies if to allow custom X509Extension 341 // values. 342 AllowCustomSans bool `json:"allowCustomSans,omitempty"` 343 344 // AllowGlobbingDnsWildcards: Optional. Specifies if glob patterns used 345 // for allowed_dns_names allow wildcard certificates. If this is set, 346 // certificate requests with wildcard domains will be permitted to match 347 // a glob pattern specified in allowed_dns_names. Otherwise, certificate 348 // requests with wildcard domains will be permitted only if 349 // allowed_dns_names contains a literal wildcard. 350 AllowGlobbingDnsWildcards bool `json:"allowGlobbingDnsWildcards,omitempty"` 351 352 // AllowedDnsNames: Optional. Contains valid, fully-qualified host 353 // names. Glob patterns are also supported. To allow an explicit 354 // wildcard certificate, escape with backlash (i.e. "\*"). E.g. for 355 // globbed entries: '*bar.com' will allow 'foo.bar.com', but not 356 // '*.bar.com', unless the allow_globbing_dns_wildcards field is set. 357 // E.g. for wildcard entries: '\*.bar.com' will allow '*.bar.com', but 358 // not 'foo.bar.com'. 359 AllowedDnsNames []string `json:"allowedDnsNames,omitempty"` 360 361 // AllowedEmailAddresses: Optional. Contains valid RFC 2822 E-mail 362 // addresses. Glob patterns are also supported. 363 AllowedEmailAddresses []string `json:"allowedEmailAddresses,omitempty"` 364 365 // AllowedIps: Optional. Contains valid 32-bit IPv4 addresses and subnet 366 // ranges or RFC 4291 IPv6 addresses and subnet ranges. Subnet ranges 367 // are specified using the '/' notation (e.g. 10.0.0.0/8, 368 // 2001:700:300:1800::/64). Glob patterns are supported only for ip 369 // address entries (i.e. not for subnet ranges). 370 AllowedIps []string `json:"allowedIps,omitempty"` 371 372 // AllowedUris: Optional. Contains valid RFC 3986 URIs. Glob patterns 373 // are also supported. To match across path seperators (i.e. '/') use 374 // the double star glob pattern (i.e. '**'). 375 AllowedUris []string `json:"allowedUris,omitempty"` 376 377 // ForceSendFields is a list of field names (e.g. "AllowCustomSans") to 378 // unconditionally include in API requests. By default, fields with 379 // empty values are omitted from API requests. However, any non-pointer, 380 // non-interface field appearing in ForceSendFields will be sent to the 381 // server regardless of whether the field is empty or not. This may be 382 // used to include empty fields in Patch requests. 383 ForceSendFields []string `json:"-"` 384 385 // NullFields is a list of field names (e.g. "AllowCustomSans") to 386 // include in API requests with the JSON null value. By default, fields 387 // with empty values are omitted from API requests. However, any field 388 // with an empty value appearing in NullFields will be sent to the 389 // server as null. It is an error if a field in this list has a 390 // non-empty value. This may be used to include null fields in Patch 391 // requests. 392 NullFields []string `json:"-"` 393} 394 395func (s *AllowedSubjectAltNames) MarshalJSON() ([]byte, error) { 396 type NoMethod AllowedSubjectAltNames 397 raw := NoMethod(*s) 398 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 399} 400 401// AuditConfig: Specifies the audit configuration for a service. The 402// configuration determines which permission types are logged, and what 403// identities, if any, are exempted from logging. An AuditConfig must 404// have one or more AuditLogConfigs. If there are AuditConfigs for both 405// `allServices` and a specific service, the union of the two 406// AuditConfigs is used for that service: the log_types specified in 407// each AuditConfig are enabled, and the exempted_members in each 408// AuditLogConfig are exempted. Example Policy with multiple 409// AuditConfigs: { "audit_configs": [ { "service": "allServices", 410// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": 411// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { 412// "log_type": "ADMIN_READ" } ] }, { "service": 413// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": 414// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ 415// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy 416// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts 417// jose@example.com from DATA_READ logging, and aliya@example.com from 418// DATA_WRITE logging. 419type AuditConfig struct { 420 // AuditLogConfigs: The configuration for logging of each type of 421 // permission. 422 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 423 424 // Service: Specifies a service that will be enabled for audit logging. 425 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. 426 // `allServices` is a special value that covers all services. 427 Service string `json:"service,omitempty"` 428 429 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 430 // unconditionally include in API requests. By default, fields with 431 // empty values are omitted from API requests. However, any non-pointer, 432 // non-interface field appearing in ForceSendFields will be sent to the 433 // server regardless of whether the field is empty or not. This may be 434 // used to include empty fields in Patch requests. 435 ForceSendFields []string `json:"-"` 436 437 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 438 // include in API requests with the JSON null value. By default, fields 439 // with empty values are omitted from API requests. However, any field 440 // with an empty value appearing in NullFields will be sent to the 441 // server as null. It is an error if a field in this list has a 442 // non-empty value. This may be used to include null fields in Patch 443 // requests. 444 NullFields []string `json:"-"` 445} 446 447func (s *AuditConfig) MarshalJSON() ([]byte, error) { 448 type NoMethod AuditConfig 449 raw := NoMethod(*s) 450 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 451} 452 453// AuditLogConfig: Provides the configuration for logging a type of 454// permissions. Example: { "audit_log_configs": [ { "log_type": 455// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { 456// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 457// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ 458// logging. 459type AuditLogConfig struct { 460 // ExemptedMembers: Specifies the identities that do not cause logging 461 // for this type of permission. Follows the same format of 462 // Binding.members. 463 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 464 465 // LogType: The log type that this config enables. 466 // 467 // Possible values: 468 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 469 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 470 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 471 // "DATA_READ" - Data reads. Example: CloudSQL Users list 472 LogType string `json:"logType,omitempty"` 473 474 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 475 // unconditionally include in API requests. By default, fields with 476 // empty values are omitted from API requests. However, any non-pointer, 477 // non-interface field appearing in ForceSendFields will be sent to the 478 // server regardless of whether the field is empty or not. This may be 479 // used to include empty fields in Patch requests. 480 ForceSendFields []string `json:"-"` 481 482 // NullFields is a list of field names (e.g. "ExemptedMembers") to 483 // include in API requests with the JSON null value. By default, fields 484 // with empty values are omitted from API requests. However, any field 485 // with an empty value appearing in NullFields will be sent to the 486 // server as null. It is an error if a field in this list has a 487 // non-empty value. This may be used to include null fields in Patch 488 // requests. 489 NullFields []string `json:"-"` 490} 491 492func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 493 type NoMethod AuditLogConfig 494 raw := NoMethod(*s) 495 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 496} 497 498// Binding: Associates `members` with a `role`. 499type Binding struct { 500 // Condition: The condition that is associated with this binding. If the 501 // condition evaluates to `true`, then this binding applies to the 502 // current request. If the condition evaluates to `false`, then this 503 // binding does not apply to the current request. However, a different 504 // role binding might grant the same role to one or more of the members 505 // in this binding. To learn which resources support conditions in their 506 // IAM policies, see the IAM documentation 507 // (https://cloud.google.com/iam/help/conditions/resource-policies). 508 Condition *Expr `json:"condition,omitempty"` 509 510 // Members: Specifies the identities requesting access for a Cloud 511 // Platform resource. `members` can have the following values: * 512 // `allUsers`: A special identifier that represents anyone who is on the 513 // internet; with or without a Google account. * 514 // `allAuthenticatedUsers`: A special identifier that represents anyone 515 // who is authenticated with a Google account or a service account. * 516 // `user:{emailid}`: An email address that represents a specific Google 517 // account. For example, `alice@example.com` . * 518 // `serviceAccount:{emailid}`: An email address that represents a 519 // service account. For example, 520 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 521 // email address that represents a Google group. For example, 522 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 523 // email address (plus unique identifier) representing a user that has 524 // been recently deleted. For example, 525 // `alice@example.com?uid=123456789012345678901`. If the user is 526 // recovered, this value reverts to `user:{emailid}` and the recovered 527 // user retains the role in the binding. * 528 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 529 // (plus unique identifier) representing a service account that has been 530 // recently deleted. For example, 531 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 532 // If the service account is undeleted, this value reverts to 533 // `serviceAccount:{emailid}` and the undeleted service account retains 534 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 535 // An email address (plus unique identifier) representing a Google group 536 // that has been recently deleted. For example, 537 // `admins@example.com?uid=123456789012345678901`. If the group is 538 // recovered, this value reverts to `group:{emailid}` and the recovered 539 // group retains the role in the binding. * `domain:{domain}`: The G 540 // Suite domain (primary) that represents all the users of that domain. 541 // For example, `google.com` or `example.com`. 542 Members []string `json:"members,omitempty"` 543 544 // Role: Role that is assigned to `members`. For example, 545 // `roles/viewer`, `roles/editor`, or `roles/owner`. 546 Role string `json:"role,omitempty"` 547 548 // ForceSendFields is a list of field names (e.g. "Condition") to 549 // unconditionally include in API requests. By default, fields with 550 // empty values are omitted from API requests. However, any non-pointer, 551 // non-interface field appearing in ForceSendFields will be sent to the 552 // server regardless of whether the field is empty or not. This may be 553 // used to include empty fields in Patch requests. 554 ForceSendFields []string `json:"-"` 555 556 // NullFields is a list of field names (e.g. "Condition") to include in 557 // API requests with the JSON null value. By default, fields with empty 558 // values are omitted from API requests. However, any field with an 559 // empty value appearing in NullFields will be sent to the server as 560 // null. It is an error if a field in this list has a non-empty value. 561 // This may be used to include null fields in Patch requests. 562 NullFields []string `json:"-"` 563} 564 565func (s *Binding) MarshalJSON() ([]byte, error) { 566 type NoMethod Binding 567 raw := NoMethod(*s) 568 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 569} 570 571// CaOptions: Describes values that are relevant in a CA certificate. 572type CaOptions struct { 573 // IsCa: Optional. Refers to the "CA" X.509 extension, which is a 574 // boolean value. When this value is missing, the extension will be 575 // omitted from the CA certificate. 576 IsCa bool `json:"isCa,omitempty"` 577 578 // MaxIssuerPathLength: Optional. Refers to the path length restriction 579 // X.509 extension. For a CA certificate, this value describes the depth 580 // of subordinate CA certificates that are allowed. If this value is 581 // less than 0, the request will fail. If this value is missing, the max 582 // path length will be omitted from the CA certificate. 583 MaxIssuerPathLength int64 `json:"maxIssuerPathLength,omitempty"` 584 585 // ForceSendFields is a list of field names (e.g. "IsCa") to 586 // unconditionally include in API requests. By default, fields with 587 // empty values are omitted from API requests. However, any non-pointer, 588 // non-interface field appearing in ForceSendFields will be sent to the 589 // server regardless of whether the field is empty or not. This may be 590 // used to include empty fields in Patch requests. 591 ForceSendFields []string `json:"-"` 592 593 // NullFields is a list of field names (e.g. "IsCa") to include in API 594 // requests with the JSON null value. By default, fields with empty 595 // values are omitted from API requests. However, any field with an 596 // empty value appearing in NullFields will be sent to the server as 597 // null. It is an error if a field in this list has a non-empty value. 598 // This may be used to include null fields in Patch requests. 599 NullFields []string `json:"-"` 600} 601 602func (s *CaOptions) MarshalJSON() ([]byte, error) { 603 type NoMethod CaOptions 604 raw := NoMethod(*s) 605 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 606} 607 608// CancelOperationRequest: The request message for 609// Operations.CancelOperation. 610type CancelOperationRequest struct { 611} 612 613// Certificate: A Certificate corresponds to a signed X.509 certificate 614// issued by a CertificateAuthority. 615type Certificate struct { 616 // CertificateDescription: Output only. A structured description of the 617 // issued X.509 certificate. 618 CertificateDescription *CertificateDescription `json:"certificateDescription,omitempty"` 619 620 // Config: Immutable. A description of the certificate and key that does 621 // not require X.509 or ASN.1. 622 Config *CertificateConfig `json:"config,omitempty"` 623 624 // CreateTime: Output only. The time at which this Certificate was 625 // created. 626 CreateTime string `json:"createTime,omitempty"` 627 628 // Labels: Optional. Labels with user-defined metadata. 629 Labels map[string]string `json:"labels,omitempty"` 630 631 // Lifetime: Required. Immutable. The desired lifetime of a certificate. 632 // Used to create the "not_before_time" and "not_after_time" fields 633 // inside an X.509 certificate. Note that the lifetime may be truncated 634 // if it would extend past the life of any certificate authority in the 635 // issuing chain. 636 Lifetime string `json:"lifetime,omitempty"` 637 638 // Name: Output only. The resource path for this Certificate in the 639 // format 640 // `projects/*/locations/*/certificateAuthorities/*/certificates/*`. 641 Name string `json:"name,omitempty"` 642 643 // PemCertificate: Output only. The pem-encoded, signed X.509 644 // certificate. 645 PemCertificate string `json:"pemCertificate,omitempty"` 646 647 // PemCertificateChain: Output only. The chain that may be used to 648 // verify the X.509 certificate. Expected to be in issuer-to-root order 649 // according to RFC 5246. 650 PemCertificateChain []string `json:"pemCertificateChain,omitempty"` 651 652 // PemCsr: Immutable. A pem-encoded X.509 certificate signing request 653 // (CSR). 654 PemCsr string `json:"pemCsr,omitempty"` 655 656 // RevocationDetails: Output only. Details regarding the revocation of 657 // this Certificate. This Certificate is considered revoked if and only 658 // if this field is present. 659 RevocationDetails *RevocationDetails `json:"revocationDetails,omitempty"` 660 661 // UpdateTime: Output only. The time at which this Certificate was 662 // updated. 663 UpdateTime string `json:"updateTime,omitempty"` 664 665 // ServerResponse contains the HTTP response code and headers from the 666 // server. 667 googleapi.ServerResponse `json:"-"` 668 669 // ForceSendFields is a list of field names (e.g. 670 // "CertificateDescription") to unconditionally include in API requests. 671 // By default, fields with empty values are omitted from API requests. 672 // However, any non-pointer, non-interface field appearing in 673 // ForceSendFields will be sent to the server regardless of whether the 674 // field is empty or not. This may be used to include empty fields in 675 // Patch requests. 676 ForceSendFields []string `json:"-"` 677 678 // NullFields is a list of field names (e.g. "CertificateDescription") 679 // to include in API requests with the JSON null value. By default, 680 // fields with empty values are omitted from API requests. However, any 681 // field with an empty value appearing in NullFields will be sent to the 682 // server as null. It is an error if a field in this list has a 683 // non-empty value. This may be used to include null fields in Patch 684 // requests. 685 NullFields []string `json:"-"` 686} 687 688func (s *Certificate) MarshalJSON() ([]byte, error) { 689 type NoMethod Certificate 690 raw := NoMethod(*s) 691 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 692} 693 694// CertificateAuthority: A CertificateAuthority represents an individual 695// Certificate Authority. A CertificateAuthority can be used to create 696// Certificates. 697type CertificateAuthority struct { 698 // AccessUrls: Output only. URLs for accessing content published by this 699 // CA, such as the CA certificate and CRLs. 700 AccessUrls *AccessUrls `json:"accessUrls,omitempty"` 701 702 // CaCertificateDescriptions: Output only. A structured description of 703 // this CertificateAuthority's CA certificate and its issuers. Ordered 704 // as self-to-root. 705 CaCertificateDescriptions []*CertificateDescription `json:"caCertificateDescriptions,omitempty"` 706 707 // CertificatePolicy: Optional. The CertificateAuthorityPolicy to 708 // enforce when issuing Certificates from this CertificateAuthority. 709 CertificatePolicy *CertificateAuthorityPolicy `json:"certificatePolicy,omitempty"` 710 711 // Config: Required. Immutable. The config used to create a self-signed 712 // X.509 certificate or CSR. 713 Config *CertificateConfig `json:"config,omitempty"` 714 715 // CreateTime: Output only. The time at which this CertificateAuthority 716 // was created. 717 CreateTime string `json:"createTime,omitempty"` 718 719 // DeleteTime: Output only. The time at which this CertificateAuthority 720 // will be deleted, if scheduled for deletion. 721 DeleteTime string `json:"deleteTime,omitempty"` 722 723 // GcsBucket: Immutable. The name of a Cloud Storage bucket where this 724 // CertificateAuthority will publish content, such as the CA certificate 725 // and CRLs. This must be a bucket name, without any prefixes (such as 726 // `gs://`) or suffixes (such as `.googleapis.com`). For example, to use 727 // a bucket named `my-bucket`, you would simply specify `my-bucket`. If 728 // not specified, a managed bucket will be created. 729 GcsBucket string `json:"gcsBucket,omitempty"` 730 731 // IssuingOptions: Optional. The IssuingOptions to follow when issuing 732 // Certificates from this CertificateAuthority. 733 IssuingOptions *IssuingOptions `json:"issuingOptions,omitempty"` 734 735 // KeySpec: Required. Immutable. Used when issuing certificates for this 736 // CertificateAuthority. If this CertificateAuthority is a self-signed 737 // CertificateAuthority, this key is also used to sign the self-signed 738 // CA certificate. Otherwise, it is used to sign a CSR. 739 KeySpec *KeyVersionSpec `json:"keySpec,omitempty"` 740 741 // Labels: Optional. Labels with user-defined metadata. 742 Labels map[string]string `json:"labels,omitempty"` 743 744 // Lifetime: Required. The desired lifetime of the CA certificate. Used 745 // to create the "not_before_time" and "not_after_time" fields inside an 746 // X.509 certificate. 747 Lifetime string `json:"lifetime,omitempty"` 748 749 // Name: Output only. The resource name for this CertificateAuthority in 750 // the format `projects/*/locations/*/certificateAuthorities/*`. 751 Name string `json:"name,omitempty"` 752 753 // PemCaCertificates: Output only. This CertificateAuthority's 754 // certificate chain, including the current CertificateAuthority's 755 // certificate. Ordered such that the root issuer is the final element 756 // (consistent with RFC 5246). For a self-signed CA, this will only list 757 // the current CertificateAuthority's certificate. 758 PemCaCertificates []string `json:"pemCaCertificates,omitempty"` 759 760 // State: Output only. The State for this CertificateAuthority. 761 // 762 // Possible values: 763 // "STATE_UNSPECIFIED" - Not specified. 764 // "ENABLED" - Certificates can be issued from this CA. CRLs will be 765 // generated for this CA. 766 // "DISABLED" - Certificates cannot be issued from this CA. CRLs will 767 // still be generated. 768 // "PENDING_ACTIVATION" - Certificates cannot be issued from this CA. 769 // CRLs will not be generated. 770 // "PENDING_DELETION" - Certificates cannot be issued from this CA. 771 // CRLs will not be generated. 772 State string `json:"state,omitempty"` 773 774 // SubordinateConfig: Optional. If this is a subordinate 775 // CertificateAuthority, this field will be set with the subordinate 776 // configuration, which describes its issuers. This may be updated, but 777 // this CertificateAuthority must continue to validate. 778 SubordinateConfig *SubordinateConfig `json:"subordinateConfig,omitempty"` 779 780 // Tier: Required. Immutable. The Tier of this CertificateAuthority. 781 // 782 // Possible values: 783 // "TIER_UNSPECIFIED" - Not specified. 784 // "ENTERPRISE" - Enterprise tier. 785 // "DEVOPS" - DevOps tier. 786 Tier string `json:"tier,omitempty"` 787 788 // Type: Required. Immutable. The Type of this CertificateAuthority. 789 // 790 // Possible values: 791 // "TYPE_UNSPECIFIED" - Not specified. 792 // "SELF_SIGNED" - Self-signed CA. 793 // "SUBORDINATE" - Subordinate CA. Could be issued by a Private CA 794 // CertificateAuthority or an unmanaged CA. 795 Type string `json:"type,omitempty"` 796 797 // UpdateTime: Output only. The time at which this CertificateAuthority 798 // was updated. 799 UpdateTime string `json:"updateTime,omitempty"` 800 801 // ServerResponse contains the HTTP response code and headers from the 802 // server. 803 googleapi.ServerResponse `json:"-"` 804 805 // ForceSendFields is a list of field names (e.g. "AccessUrls") to 806 // unconditionally include in API requests. By default, fields with 807 // empty values are omitted from API requests. However, any non-pointer, 808 // non-interface field appearing in ForceSendFields will be sent to the 809 // server regardless of whether the field is empty or not. This may be 810 // used to include empty fields in Patch requests. 811 ForceSendFields []string `json:"-"` 812 813 // NullFields is a list of field names (e.g. "AccessUrls") to include in 814 // API requests with the JSON null value. By default, fields with empty 815 // values are omitted from API requests. However, any field with an 816 // empty value appearing in NullFields will be sent to the server as 817 // null. It is an error if a field in this list has a non-empty value. 818 // This may be used to include null fields in Patch requests. 819 NullFields []string `json:"-"` 820} 821 822func (s *CertificateAuthority) MarshalJSON() ([]byte, error) { 823 type NoMethod CertificateAuthority 824 raw := NoMethod(*s) 825 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 826} 827 828// CertificateAuthorityPolicy: The issuing policy for a 829// CertificateAuthority. Certificates will not be successfully issued 830// from this CertificateAuthority if they violate the policy. 831type CertificateAuthorityPolicy struct { 832 // AllowedCommonNames: Optional. If any value is specified here, then 833 // all Certificates issued by the CertificateAuthority must match at 834 // least one listed value. If no value is specified, all values will be 835 // allowed for this fied. Glob patterns are also supported. 836 AllowedCommonNames []string `json:"allowedCommonNames,omitempty"` 837 838 // AllowedConfigList: Optional. All Certificates issued by the 839 // CertificateAuthority must match at least one listed 840 // ReusableConfigWrapper in the list. 841 AllowedConfigList *AllowedConfigList `json:"allowedConfigList,omitempty"` 842 843 // AllowedIssuanceModes: Optional. If specified, then only methods 844 // allowed in the IssuanceModes may be used to issue Certificates. 845 AllowedIssuanceModes *IssuanceModes `json:"allowedIssuanceModes,omitempty"` 846 847 // AllowedLocationsAndOrganizations: Optional. If any Subject is 848 // specified here, then all Certificates issued by the 849 // CertificateAuthority must match at least one listed Subject. If a 850 // Subject has an empty field, any value will be allowed for that field. 851 AllowedLocationsAndOrganizations []*Subject `json:"allowedLocationsAndOrganizations,omitempty"` 852 853 // AllowedSans: Optional. If a AllowedSubjectAltNames is specified here, 854 // then all Certificates issued by the CertificateAuthority must match 855 // AllowedSubjectAltNames. If no value or an empty value is specified, 856 // any value will be allowed for the SubjectAltNames field. 857 AllowedSans *AllowedSubjectAltNames `json:"allowedSans,omitempty"` 858 859 // MaximumLifetime: Optional. The maximum lifetime allowed by the 860 // CertificateAuthority. Note that if the any part if the issuing chain 861 // expires before a Certificate's requested maximum_lifetime, the 862 // effective lifetime will be explicitly truncated. 863 MaximumLifetime string `json:"maximumLifetime,omitempty"` 864 865 // OverwriteConfigValues: Optional. All Certificates issued by the 866 // CertificateAuthority will use the provided configuration values, 867 // overwriting any requested configuration values. 868 OverwriteConfigValues *ReusableConfigWrapper `json:"overwriteConfigValues,omitempty"` 869 870 // ForceSendFields is a list of field names (e.g. "AllowedCommonNames") 871 // to unconditionally include in API requests. By default, fields with 872 // empty values are omitted from API requests. However, any non-pointer, 873 // non-interface field appearing in ForceSendFields will be sent to the 874 // server regardless of whether the field is empty or not. This may be 875 // used to include empty fields in Patch requests. 876 ForceSendFields []string `json:"-"` 877 878 // NullFields is a list of field names (e.g. "AllowedCommonNames") to 879 // include in API requests with the JSON null value. By default, fields 880 // with empty values are omitted from API requests. However, any field 881 // with an empty value appearing in NullFields will be sent to the 882 // server as null. It is an error if a field in this list has a 883 // non-empty value. This may be used to include null fields in Patch 884 // requests. 885 NullFields []string `json:"-"` 886} 887 888func (s *CertificateAuthorityPolicy) MarshalJSON() ([]byte, error) { 889 type NoMethod CertificateAuthorityPolicy 890 raw := NoMethod(*s) 891 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 892} 893 894// CertificateConfig: A CertificateConfig describes an X.509 certificate 895// or CSR that is to be created, as an alternative to using ASN.1. 896type CertificateConfig struct { 897 // PublicKey: Optional. The public key that corresponds to this config. 898 // This is, for example, used when issuing Certificates, but not when 899 // creating a self-signed CertificateAuthority or CertificateAuthority 900 // CSR. 901 PublicKey *PublicKey `json:"publicKey,omitempty"` 902 903 // ReusableConfig: Required. Describes how some of the technical fields 904 // in a certificate should be populated. 905 ReusableConfig *ReusableConfigWrapper `json:"reusableConfig,omitempty"` 906 907 // SubjectConfig: Required. Specifies some of the values in a 908 // certificate that are related to the subject. 909 SubjectConfig *SubjectConfig `json:"subjectConfig,omitempty"` 910 911 // ForceSendFields is a list of field names (e.g. "PublicKey") to 912 // unconditionally include in API requests. By default, fields with 913 // empty values are omitted from API requests. However, any non-pointer, 914 // non-interface field appearing in ForceSendFields will be sent to the 915 // server regardless of whether the field is empty or not. This may be 916 // used to include empty fields in Patch requests. 917 ForceSendFields []string `json:"-"` 918 919 // NullFields is a list of field names (e.g. "PublicKey") to include in 920 // API requests with the JSON null value. By default, fields with empty 921 // values are omitted from API requests. However, any field with an 922 // empty value appearing in NullFields will be sent to the server as 923 // null. It is an error if a field in this list has a non-empty value. 924 // This may be used to include null fields in Patch requests. 925 NullFields []string `json:"-"` 926} 927 928func (s *CertificateConfig) MarshalJSON() ([]byte, error) { 929 type NoMethod CertificateConfig 930 raw := NoMethod(*s) 931 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 932} 933 934// CertificateDescription: A CertificateDescription describes an X.509 935// certificate or CSR that has been issued, as an alternative to using 936// ASN.1 / X.509. 937type CertificateDescription struct { 938 // AiaIssuingCertificateUrls: Describes lists of issuer CA certificate 939 // URLs that appear in the "Authority Information Access" extension in 940 // the certificate. 941 AiaIssuingCertificateUrls []string `json:"aiaIssuingCertificateUrls,omitempty"` 942 943 // AuthorityKeyId: Identifies the subject_key_id of the parent 944 // certificate, per https://tools.ietf.org/html/rfc5280#section-4.2.1.1 945 AuthorityKeyId *KeyId `json:"authorityKeyId,omitempty"` 946 947 // CertFingerprint: The hash of the x.509 certificate. 948 CertFingerprint *CertificateFingerprint `json:"certFingerprint,omitempty"` 949 950 // ConfigValues: Describes some of the technical fields in a 951 // certificate. 952 ConfigValues *ReusableConfigValues `json:"configValues,omitempty"` 953 954 // CrlDistributionPoints: Describes a list of locations to obtain CRL 955 // information, i.e. the DistributionPoint.fullName described by 956 // https://tools.ietf.org/html/rfc5280#section-4.2.1.13 957 CrlDistributionPoints []string `json:"crlDistributionPoints,omitempty"` 958 959 // PublicKey: The public key that corresponds to an issued certificate. 960 PublicKey *PublicKey `json:"publicKey,omitempty"` 961 962 // SubjectDescription: Describes some of the values in a certificate 963 // that are related to the subject and lifetime. 964 SubjectDescription *SubjectDescription `json:"subjectDescription,omitempty"` 965 966 // SubjectKeyId: Provides a means of identifiying certificates that 967 // contain a particular public key, per 968 // https://tools.ietf.org/html/rfc5280#section-4.2.1.2. 969 SubjectKeyId *KeyId `json:"subjectKeyId,omitempty"` 970 971 // ForceSendFields is a list of field names (e.g. 972 // "AiaIssuingCertificateUrls") to unconditionally include in API 973 // requests. By default, fields with empty values are omitted from API 974 // requests. However, any non-pointer, non-interface field appearing in 975 // ForceSendFields will be sent to the server regardless of whether the 976 // field is empty or not. This may be used to include empty fields in 977 // Patch requests. 978 ForceSendFields []string `json:"-"` 979 980 // NullFields is a list of field names (e.g. 981 // "AiaIssuingCertificateUrls") to include in API requests with the JSON 982 // null value. By default, fields with empty values are omitted from API 983 // requests. However, any field with an empty value appearing in 984 // NullFields will be sent to the server as null. It is an error if a 985 // field in this list has a non-empty value. This may be used to include 986 // null fields in Patch requests. 987 NullFields []string `json:"-"` 988} 989 990func (s *CertificateDescription) MarshalJSON() ([]byte, error) { 991 type NoMethod CertificateDescription 992 raw := NoMethod(*s) 993 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 994} 995 996// CertificateFingerprint: A group of fingerprints for the x509 997// certificate. 998type CertificateFingerprint struct { 999 // Sha256Hash: The SHA 256 hash, encoded in hexadecimal, of the DER x509 1000 // certificate. 1001 Sha256Hash string `json:"sha256Hash,omitempty"` 1002 1003 // ForceSendFields is a list of field names (e.g. "Sha256Hash") to 1004 // unconditionally include in API requests. By default, fields with 1005 // empty values are omitted from API requests. However, any non-pointer, 1006 // non-interface field appearing in ForceSendFields will be sent to the 1007 // server regardless of whether the field is empty or not. This may be 1008 // used to include empty fields in Patch requests. 1009 ForceSendFields []string `json:"-"` 1010 1011 // NullFields is a list of field names (e.g. "Sha256Hash") to include in 1012 // API requests with the JSON null value. By default, fields with empty 1013 // values are omitted from API requests. However, any field with an 1014 // empty value appearing in NullFields will be sent to the server as 1015 // null. It is an error if a field in this list has a non-empty value. 1016 // This may be used to include null fields in Patch requests. 1017 NullFields []string `json:"-"` 1018} 1019 1020func (s *CertificateFingerprint) MarshalJSON() ([]byte, error) { 1021 type NoMethod CertificateFingerprint 1022 raw := NoMethod(*s) 1023 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1024} 1025 1026// CertificateRevocationList: A CertificateRevocationList corresponds to 1027// a signed X.509 certificate Revocation List (CRL). A CRL contains the 1028// serial numbers of certificates that should no longer be trusted. 1029type CertificateRevocationList struct { 1030 // AccessUrl: Output only. The location where 'pem_crl' can be accessed. 1031 AccessUrl string `json:"accessUrl,omitempty"` 1032 1033 // CreateTime: Output only. The time at which this 1034 // CertificateRevocationList was created. 1035 CreateTime string `json:"createTime,omitempty"` 1036 1037 // Labels: Optional. Labels with user-defined metadata. 1038 Labels map[string]string `json:"labels,omitempty"` 1039 1040 // Name: Output only. The resource path for this 1041 // CertificateRevocationList in the format 1042 // `projects/*/locations/*/certificateAuthorities/*/ 1043 // certificateRevocationLists/*`. 1044 Name string `json:"name,omitempty"` 1045 1046 // PemCrl: Output only. The PEM-encoded X.509 CRL. 1047 PemCrl string `json:"pemCrl,omitempty"` 1048 1049 // RevokedCertificates: Output only. The revoked serial numbers that 1050 // appear in pem_crl. 1051 RevokedCertificates []*RevokedCertificate `json:"revokedCertificates,omitempty"` 1052 1053 // SequenceNumber: Output only. The CRL sequence number that appears in 1054 // pem_crl. 1055 SequenceNumber int64 `json:"sequenceNumber,omitempty,string"` 1056 1057 // State: Output only. The State for this CertificateRevocationList. 1058 // 1059 // Possible values: 1060 // "STATE_UNSPECIFIED" - Not specified. 1061 // "ACTIVE" - The CertificateRevocationList is up to date. 1062 // "SUPERSEDED" - The CertificateRevocationList is no longer current. 1063 State string `json:"state,omitempty"` 1064 1065 // UpdateTime: Output only. The time at which this 1066 // CertificateRevocationList was updated. 1067 UpdateTime string `json:"updateTime,omitempty"` 1068 1069 // ServerResponse contains the HTTP response code and headers from the 1070 // server. 1071 googleapi.ServerResponse `json:"-"` 1072 1073 // ForceSendFields is a list of field names (e.g. "AccessUrl") to 1074 // unconditionally include in API requests. By default, fields with 1075 // empty values are omitted from API requests. However, any non-pointer, 1076 // non-interface field appearing in ForceSendFields will be sent to the 1077 // server regardless of whether the field is empty or not. This may be 1078 // used to include empty fields in Patch requests. 1079 ForceSendFields []string `json:"-"` 1080 1081 // NullFields is a list of field names (e.g. "AccessUrl") to include in 1082 // API requests with the JSON null value. By default, fields with empty 1083 // values are omitted from API requests. However, any field with an 1084 // empty value appearing in NullFields will be sent to the server as 1085 // null. It is an error if a field in this list has a non-empty value. 1086 // This may be used to include null fields in Patch requests. 1087 NullFields []string `json:"-"` 1088} 1089 1090func (s *CertificateRevocationList) MarshalJSON() ([]byte, error) { 1091 type NoMethod CertificateRevocationList 1092 raw := NoMethod(*s) 1093 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1094} 1095 1096// DisableCertificateAuthorityRequest: Request message for 1097// CertificateAuthorityService.DisableCertificateAuthority. 1098type DisableCertificateAuthorityRequest struct { 1099 // RequestId: Optional. An ID to identify requests. Specify a unique 1100 // request ID so that if you must retry your request, the server will 1101 // know to ignore the request if it has already been completed. The 1102 // server will guarantee that for at least 60 minutes since the first 1103 // request. For example, consider a situation where you make an initial 1104 // request and t he request times out. If you make the request again 1105 // with the same request ID, the server can check if original operation 1106 // with the same request ID was received, and if so, will ignore the 1107 // second request. This prevents clients from accidentally creating 1108 // duplicate commitments. The request ID must be a valid UUID with the 1109 // exception that zero UUID is not supported 1110 // (00000000-0000-0000-0000-000000000000). 1111 RequestId string `json:"requestId,omitempty"` 1112 1113 // ForceSendFields is a list of field names (e.g. "RequestId") to 1114 // unconditionally include in API requests. By default, fields with 1115 // empty values are omitted from API requests. However, any non-pointer, 1116 // non-interface field appearing in ForceSendFields will be sent to the 1117 // server regardless of whether the field is empty or not. This may be 1118 // used to include empty fields in Patch requests. 1119 ForceSendFields []string `json:"-"` 1120 1121 // NullFields is a list of field names (e.g. "RequestId") to include in 1122 // API requests with the JSON null value. By default, fields with empty 1123 // values are omitted from API requests. However, any field with an 1124 // empty value appearing in NullFields will be sent to the server as 1125 // null. It is an error if a field in this list has a non-empty value. 1126 // This may be used to include null fields in Patch requests. 1127 NullFields []string `json:"-"` 1128} 1129 1130func (s *DisableCertificateAuthorityRequest) MarshalJSON() ([]byte, error) { 1131 type NoMethod DisableCertificateAuthorityRequest 1132 raw := NoMethod(*s) 1133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1134} 1135 1136// Empty: A generic empty message that you can re-use to avoid defining 1137// duplicated empty messages in your APIs. A typical example is to use 1138// it as the request or the response type of an API method. For 1139// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1140// (google.protobuf.Empty); } The JSON representation for `Empty` is 1141// empty JSON object `{}`. 1142type Empty struct { 1143 // ServerResponse contains the HTTP response code and headers from the 1144 // server. 1145 googleapi.ServerResponse `json:"-"` 1146} 1147 1148// EnableCertificateAuthorityRequest: Request message for 1149// CertificateAuthorityService.EnableCertificateAuthority. 1150type EnableCertificateAuthorityRequest struct { 1151 // RequestId: Optional. An ID to identify requests. Specify a unique 1152 // request ID so that if you must retry your request, the server will 1153 // know to ignore the request if it has already been completed. The 1154 // server will guarantee that for at least 60 minutes since the first 1155 // request. For example, consider a situation where you make an initial 1156 // request and t he request times out. If you make the request again 1157 // with the same request ID, the server can check if original operation 1158 // with the same request ID was received, and if so, will ignore the 1159 // second request. This prevents clients from accidentally creating 1160 // duplicate commitments. The request ID must be a valid UUID with the 1161 // exception that zero UUID is not supported 1162 // (00000000-0000-0000-0000-000000000000). 1163 RequestId string `json:"requestId,omitempty"` 1164 1165 // ForceSendFields is a list of field names (e.g. "RequestId") to 1166 // unconditionally include in API requests. By default, fields with 1167 // empty values are omitted from API requests. However, any non-pointer, 1168 // non-interface field appearing in ForceSendFields will be sent to the 1169 // server regardless of whether the field is empty or not. This may be 1170 // used to include empty fields in Patch requests. 1171 ForceSendFields []string `json:"-"` 1172 1173 // NullFields is a list of field names (e.g. "RequestId") to include in 1174 // API requests with the JSON null value. By default, fields with empty 1175 // values are omitted from API requests. However, any field with an 1176 // empty value appearing in NullFields will be sent to the server as 1177 // null. It is an error if a field in this list has a non-empty value. 1178 // This may be used to include null fields in Patch requests. 1179 NullFields []string `json:"-"` 1180} 1181 1182func (s *EnableCertificateAuthorityRequest) MarshalJSON() ([]byte, error) { 1183 type NoMethod EnableCertificateAuthorityRequest 1184 raw := NoMethod(*s) 1185 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1186} 1187 1188// Expr: Represents a textual expression in the Common Expression 1189// Language (CEL) syntax. CEL is a C-like expression language. The 1190// syntax and semantics of CEL are documented at 1191// https://github.com/google/cel-spec. Example (Comparison): title: 1192// "Summary size limit" description: "Determines if a summary is less 1193// than 100 chars" expression: "document.summary.size() < 100" Example 1194// (Equality): title: "Requestor is owner" description: "Determines if 1195// requestor is the document owner" expression: "document.owner == 1196// request.auth.claims.email" Example (Logic): title: "Public documents" 1197// description: "Determine whether the document should be publicly 1198// visible" expression: "document.type != 'private' && document.type != 1199// 'internal'" Example (Data Manipulation): title: "Notification string" 1200// description: "Create a notification string with a timestamp." 1201// expression: "'New message received at ' + 1202// string(document.create_time)" The exact variables and functions that 1203// may be referenced within an expression are determined by the service 1204// that evaluates it. See the service documentation for additional 1205// information. 1206type Expr struct { 1207 // Description: Optional. Description of the expression. This is a 1208 // longer text which describes the expression, e.g. when hovered over it 1209 // in a UI. 1210 Description string `json:"description,omitempty"` 1211 1212 // Expression: Textual representation of an expression in Common 1213 // Expression Language syntax. 1214 Expression string `json:"expression,omitempty"` 1215 1216 // Location: Optional. String indicating the location of the expression 1217 // for error reporting, e.g. a file name and a position in the file. 1218 Location string `json:"location,omitempty"` 1219 1220 // Title: Optional. Title for the expression, i.e. a short string 1221 // describing its purpose. This can be used e.g. in UIs which allow to 1222 // enter the expression. 1223 Title string `json:"title,omitempty"` 1224 1225 // ForceSendFields is a list of field names (e.g. "Description") to 1226 // unconditionally include in API requests. By default, fields with 1227 // empty values are omitted from API requests. However, any non-pointer, 1228 // non-interface field appearing in ForceSendFields will be sent to the 1229 // server regardless of whether the field is empty or not. This may be 1230 // used to include empty fields in Patch requests. 1231 ForceSendFields []string `json:"-"` 1232 1233 // NullFields is a list of field names (e.g. "Description") to include 1234 // in API requests with the JSON null value. By default, fields with 1235 // empty values are omitted from API requests. However, any field with 1236 // an empty value appearing in NullFields will be sent to the server as 1237 // null. It is an error if a field in this list has a non-empty value. 1238 // This may be used to include null fields in Patch requests. 1239 NullFields []string `json:"-"` 1240} 1241 1242func (s *Expr) MarshalJSON() ([]byte, error) { 1243 type NoMethod Expr 1244 raw := NoMethod(*s) 1245 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1246} 1247 1248// ExtendedKeyUsageOptions: KeyUsage.ExtendedKeyUsageOptions has fields 1249// that correspond to certain common OIDs that could be specified as an 1250// extended key usage value. 1251type ExtendedKeyUsageOptions struct { 1252 // ClientAuth: Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially 1253 // described as "TLS WWW client authentication", though regularly used 1254 // for non-WWW TLS. 1255 ClientAuth bool `json:"clientAuth,omitempty"` 1256 1257 // CodeSigning: Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially 1258 // described as "Signing of downloadable executable code client 1259 // authentication". 1260 CodeSigning bool `json:"codeSigning,omitempty"` 1261 1262 // EmailProtection: Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially 1263 // described as "Email protection". 1264 EmailProtection bool `json:"emailProtection,omitempty"` 1265 1266 // OcspSigning: Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially 1267 // described as "Signing OCSP responses". 1268 OcspSigning bool `json:"ocspSigning,omitempty"` 1269 1270 // ServerAuth: Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially 1271 // described as "TLS WWW server authentication", though regularly used 1272 // for non-WWW TLS. 1273 ServerAuth bool `json:"serverAuth,omitempty"` 1274 1275 // TimeStamping: Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially 1276 // described as "Binding the hash of an object to a time". 1277 TimeStamping bool `json:"timeStamping,omitempty"` 1278 1279 // ForceSendFields is a list of field names (e.g. "ClientAuth") to 1280 // unconditionally include in API requests. By default, fields with 1281 // empty values are omitted from API requests. However, any non-pointer, 1282 // non-interface field appearing in ForceSendFields will be sent to the 1283 // server regardless of whether the field is empty or not. This may be 1284 // used to include empty fields in Patch requests. 1285 ForceSendFields []string `json:"-"` 1286 1287 // NullFields is a list of field names (e.g. "ClientAuth") to include in 1288 // API requests with the JSON null value. By default, fields with empty 1289 // values are omitted from API requests. However, any field with an 1290 // empty value appearing in NullFields will be sent to the server as 1291 // null. It is an error if a field in this list has a non-empty value. 1292 // This may be used to include null fields in Patch requests. 1293 NullFields []string `json:"-"` 1294} 1295 1296func (s *ExtendedKeyUsageOptions) MarshalJSON() ([]byte, error) { 1297 type NoMethod ExtendedKeyUsageOptions 1298 raw := NoMethod(*s) 1299 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1300} 1301 1302// FetchCertificateAuthorityCsrResponse: Response message for 1303// CertificateAuthorityService.FetchCertificateAuthorityCsr. 1304type FetchCertificateAuthorityCsrResponse struct { 1305 // PemCsr: Output only. The PEM-encoded signed certificate signing 1306 // request (CSR). 1307 PemCsr string `json:"pemCsr,omitempty"` 1308 1309 // ServerResponse contains the HTTP response code and headers from the 1310 // server. 1311 googleapi.ServerResponse `json:"-"` 1312 1313 // ForceSendFields is a list of field names (e.g. "PemCsr") to 1314 // unconditionally include in API requests. By default, fields with 1315 // empty values are omitted from API requests. However, any non-pointer, 1316 // non-interface field appearing in ForceSendFields will be sent to the 1317 // server regardless of whether the field is empty or not. This may be 1318 // used to include empty fields in Patch requests. 1319 ForceSendFields []string `json:"-"` 1320 1321 // NullFields is a list of field names (e.g. "PemCsr") to include in API 1322 // requests with the JSON null value. By default, fields with empty 1323 // values are omitted from API requests. However, any field with an 1324 // empty value appearing in NullFields will be sent to the server as 1325 // null. It is an error if a field in this list has a non-empty value. 1326 // This may be used to include null fields in Patch requests. 1327 NullFields []string `json:"-"` 1328} 1329 1330func (s *FetchCertificateAuthorityCsrResponse) MarshalJSON() ([]byte, error) { 1331 type NoMethod FetchCertificateAuthorityCsrResponse 1332 raw := NoMethod(*s) 1333 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1334} 1335 1336// IssuanceModes: IssuanceModes specifies the allowed ways in which 1337// Certificates may be requested from this CertificateAuthority. 1338type IssuanceModes struct { 1339 // AllowConfigBasedIssuance: Required. When true, allows callers to 1340 // create Certificates by specifying a CertificateConfig. 1341 AllowConfigBasedIssuance bool `json:"allowConfigBasedIssuance,omitempty"` 1342 1343 // AllowCsrBasedIssuance: Required. When true, allows callers to create 1344 // Certificates by specifying a CSR. 1345 AllowCsrBasedIssuance bool `json:"allowCsrBasedIssuance,omitempty"` 1346 1347 // ForceSendFields is a list of field names (e.g. 1348 // "AllowConfigBasedIssuance") to unconditionally include in API 1349 // requests. By default, fields with empty values are omitted from API 1350 // requests. However, any non-pointer, non-interface field appearing in 1351 // ForceSendFields will be sent to the server regardless of whether the 1352 // field is empty or not. This may be used to include empty fields in 1353 // Patch requests. 1354 ForceSendFields []string `json:"-"` 1355 1356 // NullFields is a list of field names (e.g. "AllowConfigBasedIssuance") 1357 // to include in API requests with the JSON null value. By default, 1358 // fields with empty values are omitted from API requests. However, any 1359 // field with an empty value appearing in NullFields will be sent to the 1360 // server as null. It is an error if a field in this list has a 1361 // non-empty value. This may be used to include null fields in Patch 1362 // requests. 1363 NullFields []string `json:"-"` 1364} 1365 1366func (s *IssuanceModes) MarshalJSON() ([]byte, error) { 1367 type NoMethod IssuanceModes 1368 raw := NoMethod(*s) 1369 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1370} 1371 1372// IssuingOptions: Options that affect all certificates issued by a 1373// CertificateAuthority. 1374type IssuingOptions struct { 1375 // IncludeCaCertUrl: Required. When true, includes a URL to the issuing 1376 // CA certificate in the "authority information access" X.509 extension. 1377 IncludeCaCertUrl bool `json:"includeCaCertUrl,omitempty"` 1378 1379 // IncludeCrlAccessUrl: Required. When true, includes a URL to the CRL 1380 // corresponding to certificates issued from a CertificateAuthority. 1381 // CRLs will expire 7 days from their creation. However, we will rebuild 1382 // daily. CRLs are also rebuilt shortly after a certificate is revoked. 1383 IncludeCrlAccessUrl bool `json:"includeCrlAccessUrl,omitempty"` 1384 1385 // ForceSendFields is a list of field names (e.g. "IncludeCaCertUrl") to 1386 // unconditionally include in API requests. By default, fields with 1387 // empty values are omitted from API requests. However, any non-pointer, 1388 // non-interface field appearing in ForceSendFields will be sent to the 1389 // server regardless of whether the field is empty or not. This may be 1390 // used to include empty fields in Patch requests. 1391 ForceSendFields []string `json:"-"` 1392 1393 // NullFields is a list of field names (e.g. "IncludeCaCertUrl") to 1394 // include in API requests with the JSON null value. By default, fields 1395 // with empty values are omitted from API requests. However, any field 1396 // with an empty value appearing in NullFields will be sent to the 1397 // server as null. It is an error if a field in this list has a 1398 // non-empty value. This may be used to include null fields in Patch 1399 // requests. 1400 NullFields []string `json:"-"` 1401} 1402 1403func (s *IssuingOptions) MarshalJSON() ([]byte, error) { 1404 type NoMethod IssuingOptions 1405 raw := NoMethod(*s) 1406 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1407} 1408 1409// KeyId: A KeyId identifies a specific public key, usually by hashing 1410// the public key. 1411type KeyId struct { 1412 // KeyId: Optional. The value of this KeyId encoded in lowercase 1413 // hexadecimal. This is most likely the 160 bit SHA-1 hash of the public 1414 // key. 1415 KeyId string `json:"keyId,omitempty"` 1416 1417 // ForceSendFields is a list of field names (e.g. "KeyId") to 1418 // unconditionally include in API requests. By default, fields with 1419 // empty values are omitted from API requests. However, any non-pointer, 1420 // non-interface field appearing in ForceSendFields will be sent to the 1421 // server regardless of whether the field is empty or not. This may be 1422 // used to include empty fields in Patch requests. 1423 ForceSendFields []string `json:"-"` 1424 1425 // NullFields is a list of field names (e.g. "KeyId") to include in API 1426 // requests with the JSON null value. By default, fields with empty 1427 // values are omitted from API requests. However, any field with an 1428 // empty value appearing in NullFields will be sent to the server as 1429 // null. It is an error if a field in this list has a non-empty value. 1430 // This may be used to include null fields in Patch requests. 1431 NullFields []string `json:"-"` 1432} 1433 1434func (s *KeyId) MarshalJSON() ([]byte, error) { 1435 type NoMethod KeyId 1436 raw := NoMethod(*s) 1437 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1438} 1439 1440// KeyUsage: A KeyUsage describes key usage values that may appear in an 1441// X.509 certificate. 1442type KeyUsage struct { 1443 // BaseKeyUsage: Describes high-level ways in which a key may be used. 1444 BaseKeyUsage *KeyUsageOptions `json:"baseKeyUsage,omitempty"` 1445 1446 // ExtendedKeyUsage: Detailed scenarios in which a key may be used. 1447 ExtendedKeyUsage *ExtendedKeyUsageOptions `json:"extendedKeyUsage,omitempty"` 1448 1449 // UnknownExtendedKeyUsages: Used to describe extended key usages that 1450 // are not listed in the KeyUsage.ExtendedKeyUsageOptions message. 1451 UnknownExtendedKeyUsages []*ObjectId `json:"unknownExtendedKeyUsages,omitempty"` 1452 1453 // ForceSendFields is a list of field names (e.g. "BaseKeyUsage") to 1454 // unconditionally include in API requests. By default, fields with 1455 // empty values are omitted from API requests. However, any non-pointer, 1456 // non-interface field appearing in ForceSendFields will be sent to the 1457 // server regardless of whether the field is empty or not. This may be 1458 // used to include empty fields in Patch requests. 1459 ForceSendFields []string `json:"-"` 1460 1461 // NullFields is a list of field names (e.g. "BaseKeyUsage") to include 1462 // in API requests with the JSON null value. By default, fields with 1463 // empty values are omitted from API requests. However, any field with 1464 // an empty value appearing in NullFields will be sent to the server as 1465 // null. It is an error if a field in this list has a non-empty value. 1466 // This may be used to include null fields in Patch requests. 1467 NullFields []string `json:"-"` 1468} 1469 1470func (s *KeyUsage) MarshalJSON() ([]byte, error) { 1471 type NoMethod KeyUsage 1472 raw := NoMethod(*s) 1473 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1474} 1475 1476// KeyUsageOptions: KeyUsage.KeyUsageOptions corresponds to the key 1477// usage values described in 1478// https://tools.ietf.org/html/rfc5280#section-4.2.1.3. 1479type KeyUsageOptions struct { 1480 // CertSign: The key may be used to sign certificates. 1481 CertSign bool `json:"certSign,omitempty"` 1482 1483 // ContentCommitment: The key may be used for cryptographic commitments. 1484 // Note that this may also be referred to as "non-repudiation". 1485 ContentCommitment bool `json:"contentCommitment,omitempty"` 1486 1487 // CrlSign: The key may be used sign certificate revocation lists. 1488 CrlSign bool `json:"crlSign,omitempty"` 1489 1490 // DataEncipherment: The key may be used to encipher data. 1491 DataEncipherment bool `json:"dataEncipherment,omitempty"` 1492 1493 // DecipherOnly: The key may be used to decipher only. 1494 DecipherOnly bool `json:"decipherOnly,omitempty"` 1495 1496 // DigitalSignature: The key may be used for digital signatures. 1497 DigitalSignature bool `json:"digitalSignature,omitempty"` 1498 1499 // EncipherOnly: The key may be used to encipher only. 1500 EncipherOnly bool `json:"encipherOnly,omitempty"` 1501 1502 // KeyAgreement: The key may be used in a key agreement protocol. 1503 KeyAgreement bool `json:"keyAgreement,omitempty"` 1504 1505 // KeyEncipherment: The key may be used to encipher other keys. 1506 KeyEncipherment bool `json:"keyEncipherment,omitempty"` 1507 1508 // ForceSendFields is a list of field names (e.g. "CertSign") to 1509 // unconditionally include in API requests. By default, fields with 1510 // empty values are omitted from API requests. However, any non-pointer, 1511 // non-interface field appearing in ForceSendFields will be sent to the 1512 // server regardless of whether the field is empty or not. This may be 1513 // used to include empty fields in Patch requests. 1514 ForceSendFields []string `json:"-"` 1515 1516 // NullFields is a list of field names (e.g. "CertSign") to include in 1517 // API requests with the JSON null value. By default, fields with empty 1518 // values are omitted from API requests. However, any field with an 1519 // empty value appearing in NullFields will be sent to the server as 1520 // null. It is an error if a field in this list has a non-empty value. 1521 // This may be used to include null fields in Patch requests. 1522 NullFields []string `json:"-"` 1523} 1524 1525func (s *KeyUsageOptions) MarshalJSON() ([]byte, error) { 1526 type NoMethod KeyUsageOptions 1527 raw := NoMethod(*s) 1528 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1529} 1530 1531// KeyVersionSpec: A Cloud KMS key configuration that a 1532// CertificateAuthority will use. 1533type KeyVersionSpec struct { 1534 // Algorithm: Required. The algorithm to use for creating a managed 1535 // Cloud KMS key for a for a simplified experience. All managed keys 1536 // will be have their ProtectionLevel as `HSM`. 1537 // 1538 // Possible values: 1539 // "SIGN_HASH_ALGORITHM_UNSPECIFIED" - Not specified. 1540 // "RSA_PSS_2048_SHA256" - maps to 1541 // CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 1542 // "RSA_PSS_3072_SHA256" - maps to CryptoKeyVersionAlgorithm. 1543 // RSA_SIGN_PSS_3072_SHA256 1544 // "RSA_PSS_4096_SHA256" - maps to 1545 // CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 1546 // "RSA_PKCS1_2048_SHA256" - maps to 1547 // CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 1548 // "RSA_PKCS1_3072_SHA256" - maps to 1549 // CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 1550 // "RSA_PKCS1_4096_SHA256" - maps to 1551 // CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 1552 // "EC_P256_SHA256" - maps to 1553 // CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 1554 // "EC_P384_SHA384" - maps to 1555 // CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 1556 Algorithm string `json:"algorithm,omitempty"` 1557 1558 // CloudKmsKeyVersion: Required. The resource name for an existing Cloud 1559 // KMS CryptoKeyVersion in the format 1560 // `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. 1561 // This option enables full flexibility in the key's capabilities and 1562 // properties. 1563 CloudKmsKeyVersion string `json:"cloudKmsKeyVersion,omitempty"` 1564 1565 // ForceSendFields is a list of field names (e.g. "Algorithm") to 1566 // unconditionally include in API requests. By default, fields with 1567 // empty values are omitted from API requests. However, any non-pointer, 1568 // non-interface field appearing in ForceSendFields will be sent to the 1569 // server regardless of whether the field is empty or not. This may be 1570 // used to include empty fields in Patch requests. 1571 ForceSendFields []string `json:"-"` 1572 1573 // NullFields is a list of field names (e.g. "Algorithm") to include in 1574 // API requests with the JSON null value. By default, fields with empty 1575 // values are omitted from API requests. However, any field with an 1576 // empty value appearing in NullFields will be sent to the server as 1577 // null. It is an error if a field in this list has a non-empty value. 1578 // This may be used to include null fields in Patch requests. 1579 NullFields []string `json:"-"` 1580} 1581 1582func (s *KeyVersionSpec) MarshalJSON() ([]byte, error) { 1583 type NoMethod KeyVersionSpec 1584 raw := NoMethod(*s) 1585 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1586} 1587 1588// ListCertificateAuthoritiesResponse: Response message for 1589// CertificateAuthorityService.ListCertificateAuthorities. 1590type ListCertificateAuthoritiesResponse struct { 1591 // CertificateAuthorities: The list of CertificateAuthorities. 1592 CertificateAuthorities []*CertificateAuthority `json:"certificateAuthorities,omitempty"` 1593 1594 // NextPageToken: A token to retrieve next page of results. Pass this 1595 // value in ListCertificateAuthoritiesRequest.next_page_token to 1596 // retrieve the next page of results. 1597 NextPageToken string `json:"nextPageToken,omitempty"` 1598 1599 // Unreachable: A list of locations (e.g. "us-west1") that could not be 1600 // reached. 1601 Unreachable []string `json:"unreachable,omitempty"` 1602 1603 // ServerResponse contains the HTTP response code and headers from the 1604 // server. 1605 googleapi.ServerResponse `json:"-"` 1606 1607 // ForceSendFields is a list of field names (e.g. 1608 // "CertificateAuthorities") to unconditionally include in API requests. 1609 // By default, fields with empty values are omitted from API requests. 1610 // However, any non-pointer, non-interface field appearing in 1611 // ForceSendFields will be sent to the server regardless of whether the 1612 // field is empty or not. This may be used to include empty fields in 1613 // Patch requests. 1614 ForceSendFields []string `json:"-"` 1615 1616 // NullFields is a list of field names (e.g. "CertificateAuthorities") 1617 // to include in API requests with the JSON null value. By default, 1618 // fields with empty values are omitted from API requests. However, any 1619 // field with an empty value appearing in NullFields will be sent to the 1620 // server as null. It is an error if a field in this list has a 1621 // non-empty value. This may be used to include null fields in Patch 1622 // requests. 1623 NullFields []string `json:"-"` 1624} 1625 1626func (s *ListCertificateAuthoritiesResponse) MarshalJSON() ([]byte, error) { 1627 type NoMethod ListCertificateAuthoritiesResponse 1628 raw := NoMethod(*s) 1629 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1630} 1631 1632// ListCertificateRevocationListsResponse: Response message for 1633// CertificateAuthorityService.ListCertificateRevocationLists. 1634type ListCertificateRevocationListsResponse struct { 1635 // CertificateRevocationLists: The list of CertificateRevocationLists. 1636 CertificateRevocationLists []*CertificateRevocationList `json:"certificateRevocationLists,omitempty"` 1637 1638 // NextPageToken: A token to retrieve next page of results. Pass this 1639 // value in ListCertificateRevocationListsRequest.next_page_token to 1640 // retrieve the next page of results. 1641 NextPageToken string `json:"nextPageToken,omitempty"` 1642 1643 // Unreachable: A list of locations (e.g. "us-west1") that could not be 1644 // reached. 1645 Unreachable []string `json:"unreachable,omitempty"` 1646 1647 // ServerResponse contains the HTTP response code and headers from the 1648 // server. 1649 googleapi.ServerResponse `json:"-"` 1650 1651 // ForceSendFields is a list of field names (e.g. 1652 // "CertificateRevocationLists") to unconditionally include in API 1653 // requests. By default, fields with empty values are omitted from API 1654 // requests. However, any non-pointer, non-interface field appearing in 1655 // ForceSendFields will be sent to the server regardless of whether the 1656 // field is empty or not. This may be used to include empty fields in 1657 // Patch requests. 1658 ForceSendFields []string `json:"-"` 1659 1660 // NullFields is a list of field names (e.g. 1661 // "CertificateRevocationLists") to include in API requests with the 1662 // JSON null value. By default, fields with empty values are omitted 1663 // from API requests. However, any field with an empty value appearing 1664 // in NullFields will be sent to the server as null. It is an error if a 1665 // field in this list has a non-empty value. This may be used to include 1666 // null fields in Patch requests. 1667 NullFields []string `json:"-"` 1668} 1669 1670func (s *ListCertificateRevocationListsResponse) MarshalJSON() ([]byte, error) { 1671 type NoMethod ListCertificateRevocationListsResponse 1672 raw := NoMethod(*s) 1673 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1674} 1675 1676// ListCertificatesResponse: Response message for 1677// CertificateAuthorityService.ListCertificates. 1678type ListCertificatesResponse struct { 1679 // Certificates: The list of Certificates. 1680 Certificates []*Certificate `json:"certificates,omitempty"` 1681 1682 // NextPageToken: A token to retrieve next page of results. Pass this 1683 // value in ListCertificatesRequest.next_page_token to retrieve the next 1684 // page of results. 1685 NextPageToken string `json:"nextPageToken,omitempty"` 1686 1687 // Unreachable: A list of locations (e.g. "us-west1") that could not be 1688 // reached. 1689 Unreachable []string `json:"unreachable,omitempty"` 1690 1691 // ServerResponse contains the HTTP response code and headers from the 1692 // server. 1693 googleapi.ServerResponse `json:"-"` 1694 1695 // ForceSendFields is a list of field names (e.g. "Certificates") to 1696 // unconditionally include in API requests. By default, fields with 1697 // empty values are omitted from API requests. However, any non-pointer, 1698 // non-interface field appearing in ForceSendFields will be sent to the 1699 // server regardless of whether the field is empty or not. This may be 1700 // used to include empty fields in Patch requests. 1701 ForceSendFields []string `json:"-"` 1702 1703 // NullFields is a list of field names (e.g. "Certificates") to include 1704 // in API requests with the JSON null value. By default, fields with 1705 // empty values are omitted from API requests. However, any field with 1706 // an empty value appearing in NullFields will be sent to the server as 1707 // null. It is an error if a field in this list has a non-empty value. 1708 // This may be used to include null fields in Patch requests. 1709 NullFields []string `json:"-"` 1710} 1711 1712func (s *ListCertificatesResponse) MarshalJSON() ([]byte, error) { 1713 type NoMethod ListCertificatesResponse 1714 raw := NoMethod(*s) 1715 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1716} 1717 1718// ListLocationsResponse: The response message for 1719// Locations.ListLocations. 1720type ListLocationsResponse struct { 1721 // Locations: A list of locations that matches the specified filter in 1722 // the request. 1723 Locations []*Location `json:"locations,omitempty"` 1724 1725 // NextPageToken: The standard List next-page token. 1726 NextPageToken string `json:"nextPageToken,omitempty"` 1727 1728 // ServerResponse contains the HTTP response code and headers from the 1729 // server. 1730 googleapi.ServerResponse `json:"-"` 1731 1732 // ForceSendFields is a list of field names (e.g. "Locations") to 1733 // unconditionally include in API requests. By default, fields with 1734 // empty values are omitted from API requests. However, any non-pointer, 1735 // non-interface field appearing in ForceSendFields will be sent to the 1736 // server regardless of whether the field is empty or not. This may be 1737 // used to include empty fields in Patch requests. 1738 ForceSendFields []string `json:"-"` 1739 1740 // NullFields is a list of field names (e.g. "Locations") to include in 1741 // API requests with the JSON null value. By default, fields with empty 1742 // values are omitted from API requests. However, any field with an 1743 // empty value appearing in NullFields will be sent to the server as 1744 // null. It is an error if a field in this list has a non-empty value. 1745 // This may be used to include null fields in Patch requests. 1746 NullFields []string `json:"-"` 1747} 1748 1749func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 1750 type NoMethod ListLocationsResponse 1751 raw := NoMethod(*s) 1752 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1753} 1754 1755// ListOperationsResponse: The response message for 1756// Operations.ListOperations. 1757type ListOperationsResponse struct { 1758 // NextPageToken: The standard List next-page token. 1759 NextPageToken string `json:"nextPageToken,omitempty"` 1760 1761 // Operations: A list of operations that matches the specified filter in 1762 // the request. 1763 Operations []*Operation `json:"operations,omitempty"` 1764 1765 // ServerResponse contains the HTTP response code and headers from the 1766 // server. 1767 googleapi.ServerResponse `json:"-"` 1768 1769 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1770 // unconditionally include in API requests. By default, fields with 1771 // empty values are omitted from API requests. However, any non-pointer, 1772 // non-interface field appearing in ForceSendFields will be sent to the 1773 // server regardless of whether the field is empty or not. This may be 1774 // used to include empty fields in Patch requests. 1775 ForceSendFields []string `json:"-"` 1776 1777 // NullFields is a list of field names (e.g. "NextPageToken") to include 1778 // in API requests with the JSON null value. By default, fields with 1779 // empty values are omitted from API requests. However, any field with 1780 // an empty value appearing in NullFields will be sent to the server as 1781 // null. It is an error if a field in this list has a non-empty value. 1782 // This may be used to include null fields in Patch requests. 1783 NullFields []string `json:"-"` 1784} 1785 1786func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 1787 type NoMethod ListOperationsResponse 1788 raw := NoMethod(*s) 1789 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1790} 1791 1792// ListReusableConfigsResponse: Response message for 1793// CertificateAuthorityService.ListReusableConfigs. 1794type ListReusableConfigsResponse struct { 1795 // NextPageToken: A token to retrieve next page of results. Pass this 1796 // value in ListReusableConfigsRequest.next_page_token to retrieve the 1797 // next page of results. 1798 NextPageToken string `json:"nextPageToken,omitempty"` 1799 1800 // ReusableConfigs: The list of ReusableConfigs. 1801 ReusableConfigs []*ReusableConfig `json:"reusableConfigs,omitempty"` 1802 1803 // Unreachable: A list of locations (e.g. "us-west1") that could not be 1804 // reached. 1805 Unreachable []string `json:"unreachable,omitempty"` 1806 1807 // ServerResponse contains the HTTP response code and headers from the 1808 // server. 1809 googleapi.ServerResponse `json:"-"` 1810 1811 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1812 // unconditionally include in API requests. By default, fields with 1813 // empty values are omitted from API requests. However, any non-pointer, 1814 // non-interface field appearing in ForceSendFields will be sent to the 1815 // server regardless of whether the field is empty or not. This may be 1816 // used to include empty fields in Patch requests. 1817 ForceSendFields []string `json:"-"` 1818 1819 // NullFields is a list of field names (e.g. "NextPageToken") to include 1820 // in API requests with the JSON null value. By default, fields with 1821 // empty values are omitted from API requests. However, any field with 1822 // an empty value appearing in NullFields will be sent to the server as 1823 // null. It is an error if a field in this list has a non-empty value. 1824 // This may be used to include null fields in Patch requests. 1825 NullFields []string `json:"-"` 1826} 1827 1828func (s *ListReusableConfigsResponse) MarshalJSON() ([]byte, error) { 1829 type NoMethod ListReusableConfigsResponse 1830 raw := NoMethod(*s) 1831 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1832} 1833 1834// Location: A resource that represents Google Cloud Platform location. 1835type Location struct { 1836 // DisplayName: The friendly name for this location, typically a nearby 1837 // city name. For example, "Tokyo". 1838 DisplayName string `json:"displayName,omitempty"` 1839 1840 // Labels: Cross-service attributes for the location. For example 1841 // {"cloud.googleapis.com/region": "us-east1"} 1842 Labels map[string]string `json:"labels,omitempty"` 1843 1844 // LocationId: The canonical id for this location. For example: 1845 // "us-east1". 1846 LocationId string `json:"locationId,omitempty"` 1847 1848 // Metadata: Service-specific metadata. For example the available 1849 // capacity at the given location. 1850 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1851 1852 // Name: Resource name for the location, which may vary between 1853 // implementations. For example: 1854 // "projects/example-project/locations/us-east1" 1855 Name string `json:"name,omitempty"` 1856 1857 // ServerResponse contains the HTTP response code and headers from the 1858 // server. 1859 googleapi.ServerResponse `json:"-"` 1860 1861 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1862 // unconditionally include in API requests. By default, fields with 1863 // empty values are omitted from API requests. However, any non-pointer, 1864 // non-interface field appearing in ForceSendFields will be sent to the 1865 // server regardless of whether the field is empty or not. This may be 1866 // used to include empty fields in Patch requests. 1867 ForceSendFields []string `json:"-"` 1868 1869 // NullFields is a list of field names (e.g. "DisplayName") to include 1870 // in API requests with the JSON null value. By default, fields with 1871 // empty values are omitted from API requests. However, any field with 1872 // an empty value appearing in NullFields will be sent to the server as 1873 // null. It is an error if a field in this list has a non-empty value. 1874 // This may be used to include null fields in Patch requests. 1875 NullFields []string `json:"-"` 1876} 1877 1878func (s *Location) MarshalJSON() ([]byte, error) { 1879 type NoMethod Location 1880 raw := NoMethod(*s) 1881 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1882} 1883 1884// ObjectId: An ObjectId specifies an object identifier (OID). These 1885// provide context and describe types in ASN.1 messages. 1886type ObjectId struct { 1887 // ObjectIdPath: Required. The parts of an OID path. The most 1888 // significant parts of the path come first. 1889 ObjectIdPath []int64 `json:"objectIdPath,omitempty"` 1890 1891 // ForceSendFields is a list of field names (e.g. "ObjectIdPath") to 1892 // unconditionally include in API requests. By default, fields with 1893 // empty values are omitted from API requests. However, any non-pointer, 1894 // non-interface field appearing in ForceSendFields will be sent to the 1895 // server regardless of whether the field is empty or not. This may be 1896 // used to include empty fields in Patch requests. 1897 ForceSendFields []string `json:"-"` 1898 1899 // NullFields is a list of field names (e.g. "ObjectIdPath") to include 1900 // in API requests with the JSON null value. By default, fields with 1901 // empty values are omitted from API requests. However, any field with 1902 // an empty value appearing in NullFields will be sent to the server as 1903 // null. It is an error if a field in this list has a non-empty value. 1904 // This may be used to include null fields in Patch requests. 1905 NullFields []string `json:"-"` 1906} 1907 1908func (s *ObjectId) MarshalJSON() ([]byte, error) { 1909 type NoMethod ObjectId 1910 raw := NoMethod(*s) 1911 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1912} 1913 1914// Operation: This resource represents a long-running operation that is 1915// the result of a network API call. 1916type Operation struct { 1917 // Done: If the value is `false`, it means the operation is still in 1918 // progress. If `true`, the operation is completed, and either `error` 1919 // or `response` is available. 1920 Done bool `json:"done,omitempty"` 1921 1922 // Error: The error result of the operation in case of failure or 1923 // cancellation. 1924 Error *Status `json:"error,omitempty"` 1925 1926 // Metadata: Service-specific metadata associated with the operation. It 1927 // typically contains progress information and common metadata such as 1928 // create time. Some services might not provide such metadata. Any 1929 // method that returns a long-running operation should document the 1930 // metadata type, if any. 1931 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1932 1933 // Name: The server-assigned name, which is only unique within the same 1934 // service that originally returns it. If you use the default HTTP 1935 // mapping, the `name` should be a resource name ending with 1936 // `operations/{unique_id}`. 1937 Name string `json:"name,omitempty"` 1938 1939 // Response: The normal response of the operation in case of success. If 1940 // the original method returns no data on success, such as `Delete`, the 1941 // response is `google.protobuf.Empty`. If the original method is 1942 // standard `Get`/`Create`/`Update`, the response should be the 1943 // resource. For other methods, the response should have the type 1944 // `XxxResponse`, where `Xxx` is the original method name. For example, 1945 // if the original method name is `TakeSnapshot()`, the inferred 1946 // response type is `TakeSnapshotResponse`. 1947 Response googleapi.RawMessage `json:"response,omitempty"` 1948 1949 // ServerResponse contains the HTTP response code and headers from the 1950 // server. 1951 googleapi.ServerResponse `json:"-"` 1952 1953 // ForceSendFields is a list of field names (e.g. "Done") to 1954 // unconditionally include in API requests. By default, fields with 1955 // empty values are omitted from API requests. However, any non-pointer, 1956 // non-interface field appearing in ForceSendFields will be sent to the 1957 // server regardless of whether the field is empty or not. This may be 1958 // used to include empty fields in Patch requests. 1959 ForceSendFields []string `json:"-"` 1960 1961 // NullFields is a list of field names (e.g. "Done") to include in API 1962 // requests with the JSON null value. By default, fields with empty 1963 // values are omitted from API requests. However, any field with an 1964 // empty value appearing in NullFields will be sent to the server as 1965 // null. It is an error if a field in this list has a non-empty value. 1966 // This may be used to include null fields in Patch requests. 1967 NullFields []string `json:"-"` 1968} 1969 1970func (s *Operation) MarshalJSON() ([]byte, error) { 1971 type NoMethod Operation 1972 raw := NoMethod(*s) 1973 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1974} 1975 1976// OperationMetadata: Represents the metadata of the long-running 1977// operation. 1978type OperationMetadata struct { 1979 // ApiVersion: Output only. API version used to start the operation. 1980 ApiVersion string `json:"apiVersion,omitempty"` 1981 1982 // CreateTime: Output only. The time the operation was created. 1983 CreateTime string `json:"createTime,omitempty"` 1984 1985 // EndTime: Output only. The time the operation finished running. 1986 EndTime string `json:"endTime,omitempty"` 1987 1988 // RequestedCancellation: Output only. Identifies whether the user has 1989 // requested cancellation of the operation. Operations that have 1990 // successfully been cancelled have Operation.error value with a 1991 // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. 1992 RequestedCancellation bool `json:"requestedCancellation,omitempty"` 1993 1994 // StatusMessage: Output only. Human-readable status of the operation, 1995 // if any. 1996 StatusMessage string `json:"statusMessage,omitempty"` 1997 1998 // Target: Output only. Server-defined resource path for the target of 1999 // the operation. 2000 Target string `json:"target,omitempty"` 2001 2002 // Verb: Output only. Name of the verb executed by the operation. 2003 Verb string `json:"verb,omitempty"` 2004 2005 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 2006 // unconditionally include in API requests. By default, fields with 2007 // empty values are omitted from API requests. However, any non-pointer, 2008 // non-interface field appearing in ForceSendFields will be sent to the 2009 // server regardless of whether the field is empty or not. This may be 2010 // used to include empty fields in Patch requests. 2011 ForceSendFields []string `json:"-"` 2012 2013 // NullFields is a list of field names (e.g. "ApiVersion") to include in 2014 // API requests with the JSON null value. By default, fields with empty 2015 // values are omitted from API requests. However, any field with an 2016 // empty value appearing in NullFields will be sent to the server as 2017 // null. It is an error if a field in this list has a non-empty value. 2018 // This may be used to include null fields in Patch requests. 2019 NullFields []string `json:"-"` 2020} 2021 2022func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 2023 type NoMethod OperationMetadata 2024 raw := NoMethod(*s) 2025 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2026} 2027 2028// Policy: An Identity and Access Management (IAM) policy, which 2029// specifies access controls for Google Cloud resources. A `Policy` is a 2030// collection of `bindings`. A `binding` binds one or more `members` to 2031// a single `role`. Members can be user accounts, service accounts, 2032// Google groups, and domains (such as G Suite). A `role` is a named 2033// list of permissions; each `role` can be an IAM predefined role or a 2034// user-created custom role. For some types of Google Cloud resources, a 2035// `binding` can also specify a `condition`, which is a logical 2036// expression that allows access to a resource only if the expression 2037// evaluates to `true`. A condition can add constraints based on 2038// attributes of the request, the resource, or both. To learn which 2039// resources support conditions in their IAM policies, see the IAM 2040// documentation 2041// (https://cloud.google.com/iam/help/conditions/resource-policies). 2042// **JSON example:** { "bindings": [ { "role": 2043// "roles/resourcemanager.organizationAdmin", "members": [ 2044// "user:mike@example.com", "group:admins@example.com", 2045// "domain:google.com", 2046// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 2047// "role": "roles/resourcemanager.organizationViewer", "members": [ 2048// "user:eve@example.com" ], "condition": { "title": "expirable access", 2049// "description": "Does not grant access after Sep 2020", "expression": 2050// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 2051// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 2052// members: - user:mike@example.com - group:admins@example.com - 2053// domain:google.com - 2054// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 2055// roles/resourcemanager.organizationAdmin - members: - 2056// user:eve@example.com role: roles/resourcemanager.organizationViewer 2057// condition: title: expirable access description: Does not grant access 2058// after Sep 2020 expression: request.time < 2059// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 2060// 3 For a description of IAM and its features, see the IAM 2061// documentation (https://cloud.google.com/iam/docs/). 2062type Policy struct { 2063 // AuditConfigs: Specifies cloud audit logging configuration for this 2064 // policy. 2065 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 2066 2067 // Bindings: Associates a list of `members` to a `role`. Optionally, may 2068 // specify a `condition` that determines how and when the `bindings` are 2069 // applied. Each of the `bindings` must contain at least one member. 2070 Bindings []*Binding `json:"bindings,omitempty"` 2071 2072 // Etag: `etag` is used for optimistic concurrency control as a way to 2073 // help prevent simultaneous updates of a policy from overwriting each 2074 // other. It is strongly suggested that systems make use of the `etag` 2075 // in the read-modify-write cycle to perform policy updates in order to 2076 // avoid race conditions: An `etag` is returned in the response to 2077 // `getIamPolicy`, and systems are expected to put that etag in the 2078 // request to `setIamPolicy` to ensure that their change will be applied 2079 // to the same version of the policy. **Important:** If you use IAM 2080 // Conditions, you must include the `etag` field whenever you call 2081 // `setIamPolicy`. If you omit this field, then IAM allows you to 2082 // overwrite a version `3` policy with a version `1` policy, and all of 2083 // the conditions in the version `3` policy are lost. 2084 Etag string `json:"etag,omitempty"` 2085 2086 // Version: Specifies the format of the policy. Valid values are `0`, 2087 // `1`, and `3`. Requests that specify an invalid value are rejected. 2088 // Any operation that affects conditional role bindings must specify 2089 // version `3`. This requirement applies to the following operations: * 2090 // Getting a policy that includes a conditional role binding * Adding a 2091 // conditional role binding to a policy * Changing a conditional role 2092 // binding in a policy * Removing any role binding, with or without a 2093 // condition, from a policy that includes conditions **Important:** If 2094 // you use IAM Conditions, you must include the `etag` field whenever 2095 // you call `setIamPolicy`. If you omit this field, then IAM allows you 2096 // to overwrite a version `3` policy with a version `1` policy, and all 2097 // of the conditions in the version `3` policy are lost. If a policy 2098 // does not include any conditions, operations on that policy may 2099 // specify any valid version or leave the field unset. To learn which 2100 // resources support conditions in their IAM policies, see the IAM 2101 // documentation 2102 // (https://cloud.google.com/iam/help/conditions/resource-policies). 2103 Version int64 `json:"version,omitempty"` 2104 2105 // ServerResponse contains the HTTP response code and headers from the 2106 // server. 2107 googleapi.ServerResponse `json:"-"` 2108 2109 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 2110 // unconditionally include in API requests. By default, fields with 2111 // empty values are omitted from API requests. However, any non-pointer, 2112 // non-interface field appearing in ForceSendFields will be sent to the 2113 // server regardless of whether the field is empty or not. This may be 2114 // used to include empty fields in Patch requests. 2115 ForceSendFields []string `json:"-"` 2116 2117 // NullFields is a list of field names (e.g. "AuditConfigs") to include 2118 // in API requests with the JSON null value. By default, fields with 2119 // empty values are omitted from API requests. However, any field with 2120 // an empty value appearing in NullFields will be sent to the server as 2121 // null. It is an error if a field in this list has a non-empty value. 2122 // This may be used to include null fields in Patch requests. 2123 NullFields []string `json:"-"` 2124} 2125 2126func (s *Policy) MarshalJSON() ([]byte, error) { 2127 type NoMethod Policy 2128 raw := NoMethod(*s) 2129 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2130} 2131 2132// PublicKey: A PublicKey describes a public key. 2133type PublicKey struct { 2134 // Key: Required. A public key. When this is specified in a request, the 2135 // padding and encoding can be any of the options described by the 2136 // respective 'KeyType' value. When this is generated by the service, it 2137 // will always be an RFC 5280 SubjectPublicKeyInfo 2138 // (https://tools.ietf.org/html/rfc5280#section-4.1) structure 2139 // containing an algorithm identifier and a key. 2140 Key string `json:"key,omitempty"` 2141 2142 // Type: Optional. The type of public key. If specified, it must match 2143 // the public key used for the`key` field. 2144 // 2145 // Possible values: 2146 // "KEY_TYPE_UNSPECIFIED" - Default unspecified value. 2147 // "PEM_RSA_KEY" - A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey 2148 // structure, or an RFC 5280 2149 // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1 2150 // ) structure containing the former. 2151 // "PEM_EC_KEY" - An RFC 5280 2152 // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1 2153 // ) structure containing a PEM-encoded compressed NIST 2154 // P-256/secp256r1/prime256v1 or P-384 key. 2155 Type string `json:"type,omitempty"` 2156 2157 // ForceSendFields is a list of field names (e.g. "Key") to 2158 // unconditionally include in API requests. By default, fields with 2159 // empty values are omitted from API requests. However, any non-pointer, 2160 // non-interface field appearing in ForceSendFields will be sent to the 2161 // server regardless of whether the field is empty or not. This may be 2162 // used to include empty fields in Patch requests. 2163 ForceSendFields []string `json:"-"` 2164 2165 // NullFields is a list of field names (e.g. "Key") to include in API 2166 // requests with the JSON null value. By default, fields with empty 2167 // values are omitted from API requests. However, any field with an 2168 // empty value appearing in NullFields will be sent to the server as 2169 // null. It is an error if a field in this list has a non-empty value. 2170 // This may be used to include null fields in Patch requests. 2171 NullFields []string `json:"-"` 2172} 2173 2174func (s *PublicKey) MarshalJSON() ([]byte, error) { 2175 type NoMethod PublicKey 2176 raw := NoMethod(*s) 2177 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2178} 2179 2180// ReconciliationOperationMetadata: Operation metadata returned by the 2181// CLH during resource state reconciliation. 2182type ReconciliationOperationMetadata struct { 2183 // DeleteResource: If set to TRUE, the resource has to be deleted. When 2184 // using this bit, the CLH should fail the operation. 2185 DeleteResource bool `json:"deleteResource,omitempty"` 2186 2187 // ForceSendFields is a list of field names (e.g. "DeleteResource") to 2188 // unconditionally include in API requests. By default, fields with 2189 // empty values are omitted from API requests. However, any non-pointer, 2190 // non-interface field appearing in ForceSendFields will be sent to the 2191 // server regardless of whether the field is empty or not. This may be 2192 // used to include empty fields in Patch requests. 2193 ForceSendFields []string `json:"-"` 2194 2195 // NullFields is a list of field names (e.g. "DeleteResource") to 2196 // include in API requests with the JSON null value. By default, fields 2197 // with empty values are omitted from API requests. However, any field 2198 // with an empty value appearing in NullFields will be sent to the 2199 // server as null. It is an error if a field in this list has a 2200 // non-empty value. This may be used to include null fields in Patch 2201 // requests. 2202 NullFields []string `json:"-"` 2203} 2204 2205func (s *ReconciliationOperationMetadata) MarshalJSON() ([]byte, error) { 2206 type NoMethod ReconciliationOperationMetadata 2207 raw := NoMethod(*s) 2208 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2209} 2210 2211// RestoreCertificateAuthorityRequest: Request message for 2212// CertificateAuthorityService.RestoreCertificateAuthority. 2213type RestoreCertificateAuthorityRequest struct { 2214 // RequestId: Optional. An ID to identify requests. Specify a unique 2215 // request ID so that if you must retry your request, the server will 2216 // know to ignore the request if it has already been completed. The 2217 // server will guarantee that for at least 60 minutes since the first 2218 // request. For example, consider a situation where you make an initial 2219 // request and t he request times out. If you make the request again 2220 // with the same request ID, the server can check if original operation 2221 // with the same request ID was received, and if so, will ignore the 2222 // second request. This prevents clients from accidentally creating 2223 // duplicate commitments. The request ID must be a valid UUID with the 2224 // exception that zero UUID is not supported 2225 // (00000000-0000-0000-0000-000000000000). 2226 RequestId string `json:"requestId,omitempty"` 2227 2228 // ForceSendFields is a list of field names (e.g. "RequestId") to 2229 // unconditionally include in API requests. By default, fields with 2230 // empty values are omitted from API requests. However, any non-pointer, 2231 // non-interface field appearing in ForceSendFields will be sent to the 2232 // server regardless of whether the field is empty or not. This may be 2233 // used to include empty fields in Patch requests. 2234 ForceSendFields []string `json:"-"` 2235 2236 // NullFields is a list of field names (e.g. "RequestId") to include in 2237 // API requests with the JSON null value. By default, fields with empty 2238 // values are omitted from API requests. However, any field with an 2239 // empty value appearing in NullFields will be sent to the server as 2240 // null. It is an error if a field in this list has a non-empty value. 2241 // This may be used to include null fields in Patch requests. 2242 NullFields []string `json:"-"` 2243} 2244 2245func (s *RestoreCertificateAuthorityRequest) MarshalJSON() ([]byte, error) { 2246 type NoMethod RestoreCertificateAuthorityRequest 2247 raw := NoMethod(*s) 2248 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2249} 2250 2251// ReusableConfig: A ReusableConfig refers to a managed 2252// ReusableConfigValues. Those, in turn, are used to describe certain 2253// fields of an X.509 certificate, such as the key usage fields, fields 2254// specific to CA certificates, certificate policy extensions and custom 2255// extensions. 2256type ReusableConfig struct { 2257 // CreateTime: Output only. The time at which this ReusableConfig was 2258 // created. 2259 CreateTime string `json:"createTime,omitempty"` 2260 2261 // Description: Optional. A human-readable description of scenarios 2262 // these ReusableConfigValues may be compatible with. 2263 Description string `json:"description,omitempty"` 2264 2265 // Labels: Optional. Labels with user-defined metadata. 2266 Labels map[string]string `json:"labels,omitempty"` 2267 2268 // Name: Output only. The resource path for this ReusableConfig in the 2269 // format `projects/*/locations/*/reusableConfigs/*`. 2270 Name string `json:"name,omitempty"` 2271 2272 // UpdateTime: Output only. The time at which this ReusableConfig was 2273 // updated. 2274 UpdateTime string `json:"updateTime,omitempty"` 2275 2276 // Values: Required. The config values. 2277 Values *ReusableConfigValues `json:"values,omitempty"` 2278 2279 // ServerResponse contains the HTTP response code and headers from the 2280 // server. 2281 googleapi.ServerResponse `json:"-"` 2282 2283 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2284 // unconditionally include in API requests. By default, fields with 2285 // empty values are omitted from API requests. However, any non-pointer, 2286 // non-interface field appearing in ForceSendFields will be sent to the 2287 // server regardless of whether the field is empty or not. This may be 2288 // used to include empty fields in Patch requests. 2289 ForceSendFields []string `json:"-"` 2290 2291 // NullFields is a list of field names (e.g. "CreateTime") to include in 2292 // API requests with the JSON null value. By default, fields with empty 2293 // values are omitted from API requests. However, any field with an 2294 // empty value appearing in NullFields will be sent to the server as 2295 // null. It is an error if a field in this list has a non-empty value. 2296 // This may be used to include null fields in Patch requests. 2297 NullFields []string `json:"-"` 2298} 2299 2300func (s *ReusableConfig) MarshalJSON() ([]byte, error) { 2301 type NoMethod ReusableConfig 2302 raw := NoMethod(*s) 2303 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2304} 2305 2306// ReusableConfigValues: A ReusableConfigValues is used to describe 2307// certain fields of an X.509 certificate, such as the key usage fields, 2308// fields specific to CA certificates, certificate policy extensions and 2309// custom extensions. 2310type ReusableConfigValues struct { 2311 // AdditionalExtensions: Optional. Describes custom X.509 extensions. 2312 AdditionalExtensions []*X509Extension `json:"additionalExtensions,omitempty"` 2313 2314 // AiaOcspServers: Optional. Describes Online Certificate Status 2315 // Protocol (OCSP) endpoint addresses that appear in the "Authority 2316 // Information Access" extension in the certificate. 2317 AiaOcspServers []string `json:"aiaOcspServers,omitempty"` 2318 2319 // CaOptions: Optional. Describes options in this ReusableConfigValues 2320 // that are relevant in a CA certificate. 2321 CaOptions *CaOptions `json:"caOptions,omitempty"` 2322 2323 // KeyUsage: Optional. Indicates the intended use for keys that 2324 // correspond to a certificate. 2325 KeyUsage *KeyUsage `json:"keyUsage,omitempty"` 2326 2327 // PolicyIds: Optional. Describes the X.509 certificate policy object 2328 // identifiers, per https://tools.ietf.org/html/rfc5280#section-4.2.1.4. 2329 PolicyIds []*ObjectId `json:"policyIds,omitempty"` 2330 2331 // ForceSendFields is a list of field names (e.g. 2332 // "AdditionalExtensions") to unconditionally include in API requests. 2333 // By default, fields with empty values are omitted from API requests. 2334 // However, any non-pointer, non-interface field appearing in 2335 // ForceSendFields will be sent to the server regardless of whether the 2336 // field is empty or not. This may be used to include empty fields in 2337 // Patch requests. 2338 ForceSendFields []string `json:"-"` 2339 2340 // NullFields is a list of field names (e.g. "AdditionalExtensions") to 2341 // include in API requests with the JSON null value. By default, fields 2342 // with empty values are omitted from API requests. However, any field 2343 // with an empty value appearing in NullFields will be sent to the 2344 // server as null. It is an error if a field in this list has a 2345 // non-empty value. This may be used to include null fields in Patch 2346 // requests. 2347 NullFields []string `json:"-"` 2348} 2349 2350func (s *ReusableConfigValues) MarshalJSON() ([]byte, error) { 2351 type NoMethod ReusableConfigValues 2352 raw := NoMethod(*s) 2353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2354} 2355 2356// ReusableConfigWrapper: A ReusableConfigWrapper describes values that 2357// may assist in creating an X.509 certificate, or a reference to a 2358// pre-defined set of values. 2359type ReusableConfigWrapper struct { 2360 // ReusableConfig: Required. A resource path to a ReusableConfig in the 2361 // format `projects/*/locations/*/reusableConfigs/*`. 2362 ReusableConfig string `json:"reusableConfig,omitempty"` 2363 2364 // ReusableConfigValues: Required. A user-specified inline 2365 // ReusableConfigValues. 2366 ReusableConfigValues *ReusableConfigValues `json:"reusableConfigValues,omitempty"` 2367 2368 // ForceSendFields is a list of field names (e.g. "ReusableConfig") to 2369 // unconditionally include in API requests. By default, fields with 2370 // empty values are omitted from API requests. However, any non-pointer, 2371 // non-interface field appearing in ForceSendFields will be sent to the 2372 // server regardless of whether the field is empty or not. This may be 2373 // used to include empty fields in Patch requests. 2374 ForceSendFields []string `json:"-"` 2375 2376 // NullFields is a list of field names (e.g. "ReusableConfig") to 2377 // include in API requests with the JSON null value. By default, fields 2378 // with empty values are omitted from API requests. However, any field 2379 // with an empty value appearing in NullFields will be sent to the 2380 // server as null. It is an error if a field in this list has a 2381 // non-empty value. This may be used to include null fields in Patch 2382 // requests. 2383 NullFields []string `json:"-"` 2384} 2385 2386func (s *ReusableConfigWrapper) MarshalJSON() ([]byte, error) { 2387 type NoMethod ReusableConfigWrapper 2388 raw := NoMethod(*s) 2389 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2390} 2391 2392// RevocationDetails: Describes fields that are relavent to the 2393// revocation of a Certificate. 2394type RevocationDetails struct { 2395 // RevocationState: Indicates why a Certificate was revoked. 2396 // 2397 // Possible values: 2398 // "REVOCATION_REASON_UNSPECIFIED" - Default unspecified value. This 2399 // value does indicate that a Certificate has been revoked, but that a 2400 // reason has not been recorded. 2401 // "KEY_COMPROMISE" - Key material for this Certificate may have 2402 // leaked. 2403 // "CERTIFICATE_AUTHORITY_COMPROMISE" - The key material for a 2404 // certificate authority in the issuing path may have leaked. 2405 // "AFFILIATION_CHANGED" - The subject or other attributes in this 2406 // Certificate have changed. 2407 // "SUPERSEDED" - This Certificate has been superseded. 2408 // "CESSATION_OF_OPERATION" - This Certificate or entities in the 2409 // issuing path have ceased to operate. 2410 // "CERTIFICATE_HOLD" - This Certificate should not be considered 2411 // valid, it is expected that it may become valid in the future. 2412 // "PRIVILEGE_WITHDRAWN" - This Certificate no longer has permission 2413 // to assert the listed attributes. 2414 // "ATTRIBUTE_AUTHORITY_COMPROMISE" - The authority which determines 2415 // appropriate attributes for a Certificate may have been compromised. 2416 RevocationState string `json:"revocationState,omitempty"` 2417 2418 // RevocationTime: The time at which this Certificate was revoked. 2419 RevocationTime string `json:"revocationTime,omitempty"` 2420 2421 // ForceSendFields is a list of field names (e.g. "RevocationState") to 2422 // unconditionally include in API requests. By default, fields with 2423 // empty values are omitted from API requests. However, any non-pointer, 2424 // non-interface field appearing in ForceSendFields will be sent to the 2425 // server regardless of whether the field is empty or not. This may be 2426 // used to include empty fields in Patch requests. 2427 ForceSendFields []string `json:"-"` 2428 2429 // NullFields is a list of field names (e.g. "RevocationState") to 2430 // include in API requests with the JSON null value. By default, fields 2431 // with empty values are omitted from API requests. However, any field 2432 // with an empty value appearing in NullFields will be sent to the 2433 // server as null. It is an error if a field in this list has a 2434 // non-empty value. This may be used to include null fields in Patch 2435 // requests. 2436 NullFields []string `json:"-"` 2437} 2438 2439func (s *RevocationDetails) MarshalJSON() ([]byte, error) { 2440 type NoMethod RevocationDetails 2441 raw := NoMethod(*s) 2442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2443} 2444 2445// RevokeCertificateRequest: Request message for 2446// CertificateAuthorityService.RevokeCertificate. 2447type RevokeCertificateRequest struct { 2448 // Reason: Required. The RevocationReason for revoking this certificate. 2449 // 2450 // Possible values: 2451 // "REVOCATION_REASON_UNSPECIFIED" - Default unspecified value. This 2452 // value does indicate that a Certificate has been revoked, but that a 2453 // reason has not been recorded. 2454 // "KEY_COMPROMISE" - Key material for this Certificate may have 2455 // leaked. 2456 // "CERTIFICATE_AUTHORITY_COMPROMISE" - The key material for a 2457 // certificate authority in the issuing path may have leaked. 2458 // "AFFILIATION_CHANGED" - The subject or other attributes in this 2459 // Certificate have changed. 2460 // "SUPERSEDED" - This Certificate has been superseded. 2461 // "CESSATION_OF_OPERATION" - This Certificate or entities in the 2462 // issuing path have ceased to operate. 2463 // "CERTIFICATE_HOLD" - This Certificate should not be considered 2464 // valid, it is expected that it may become valid in the future. 2465 // "PRIVILEGE_WITHDRAWN" - This Certificate no longer has permission 2466 // to assert the listed attributes. 2467 // "ATTRIBUTE_AUTHORITY_COMPROMISE" - The authority which determines 2468 // appropriate attributes for a Certificate may have been compromised. 2469 Reason string `json:"reason,omitempty"` 2470 2471 // RequestId: Optional. An ID to identify requests. Specify a unique 2472 // request ID so that if you must retry your request, the server will 2473 // know to ignore the request if it has already been completed. The 2474 // server will guarantee that for at least 60 minutes since the first 2475 // request. For example, consider a situation where you make an initial 2476 // request and t he request times out. If you make the request again 2477 // with the same request ID, the server can check if original operation 2478 // with the same request ID was received, and if so, will ignore the 2479 // second request. This prevents clients from accidentally creating 2480 // duplicate commitments. The request ID must be a valid UUID with the 2481 // exception that zero UUID is not supported 2482 // (00000000-0000-0000-0000-000000000000). 2483 RequestId string `json:"requestId,omitempty"` 2484 2485 // ForceSendFields is a list of field names (e.g. "Reason") to 2486 // unconditionally include in API requests. By default, fields with 2487 // empty values are omitted from API requests. However, any non-pointer, 2488 // non-interface field appearing in ForceSendFields will be sent to the 2489 // server regardless of whether the field is empty or not. This may be 2490 // used to include empty fields in Patch requests. 2491 ForceSendFields []string `json:"-"` 2492 2493 // NullFields is a list of field names (e.g. "Reason") to include in API 2494 // requests with the JSON null value. By default, fields with empty 2495 // values are omitted from API requests. However, any field with an 2496 // empty value appearing in NullFields will be sent to the server as 2497 // null. It is an error if a field in this list has a non-empty value. 2498 // This may be used to include null fields in Patch requests. 2499 NullFields []string `json:"-"` 2500} 2501 2502func (s *RevokeCertificateRequest) MarshalJSON() ([]byte, error) { 2503 type NoMethod RevokeCertificateRequest 2504 raw := NoMethod(*s) 2505 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2506} 2507 2508// RevokedCertificate: Describes a revoked Certificate. 2509type RevokedCertificate struct { 2510 // Certificate: The resource path for the Certificate in the format 2511 // `projects/*/locations/*/certificateAuthorities/*/certificates/*`. 2512 Certificate string `json:"certificate,omitempty"` 2513 2514 // HexSerialNumber: The serial number of the Certificate. 2515 HexSerialNumber string `json:"hexSerialNumber,omitempty"` 2516 2517 // RevocationReason: The reason the Certificate was revoked. 2518 // 2519 // Possible values: 2520 // "REVOCATION_REASON_UNSPECIFIED" - Default unspecified value. This 2521 // value does indicate that a Certificate has been revoked, but that a 2522 // reason has not been recorded. 2523 // "KEY_COMPROMISE" - Key material for this Certificate may have 2524 // leaked. 2525 // "CERTIFICATE_AUTHORITY_COMPROMISE" - The key material for a 2526 // certificate authority in the issuing path may have leaked. 2527 // "AFFILIATION_CHANGED" - The subject or other attributes in this 2528 // Certificate have changed. 2529 // "SUPERSEDED" - This Certificate has been superseded. 2530 // "CESSATION_OF_OPERATION" - This Certificate or entities in the 2531 // issuing path have ceased to operate. 2532 // "CERTIFICATE_HOLD" - This Certificate should not be considered 2533 // valid, it is expected that it may become valid in the future. 2534 // "PRIVILEGE_WITHDRAWN" - This Certificate no longer has permission 2535 // to assert the listed attributes. 2536 // "ATTRIBUTE_AUTHORITY_COMPROMISE" - The authority which determines 2537 // appropriate attributes for a Certificate may have been compromised. 2538 RevocationReason string `json:"revocationReason,omitempty"` 2539 2540 // ForceSendFields is a list of field names (e.g. "Certificate") to 2541 // unconditionally include in API requests. By default, fields with 2542 // empty values are omitted from API requests. However, any non-pointer, 2543 // non-interface field appearing in ForceSendFields will be sent to the 2544 // server regardless of whether the field is empty or not. This may be 2545 // used to include empty fields in Patch requests. 2546 ForceSendFields []string `json:"-"` 2547 2548 // NullFields is a list of field names (e.g. "Certificate") to include 2549 // in API requests with the JSON null value. By default, fields with 2550 // empty values are omitted from API requests. However, any field with 2551 // an empty value appearing in NullFields will be sent to the server as 2552 // null. It is an error if a field in this list has a non-empty value. 2553 // This may be used to include null fields in Patch requests. 2554 NullFields []string `json:"-"` 2555} 2556 2557func (s *RevokedCertificate) MarshalJSON() ([]byte, error) { 2558 type NoMethod RevokedCertificate 2559 raw := NoMethod(*s) 2560 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2561} 2562 2563// ScheduleDeleteCertificateAuthorityRequest: Request message for 2564// CertificateAuthorityService.ScheduleDeleteCertificateAuthority. 2565type ScheduleDeleteCertificateAuthorityRequest struct { 2566 // IgnoreActiveCertificates: Optional. This field allows the CA to be 2567 // scheduled for deletion even if the CA has active certs. Active certs 2568 // include both unrevoked and unexpired certs. 2569 IgnoreActiveCertificates bool `json:"ignoreActiveCertificates,omitempty"` 2570 2571 // RequestId: Optional. An ID to identify requests. Specify a unique 2572 // request ID so that if you must retry your request, the server will 2573 // know to ignore the request if it has already been completed. The 2574 // server will guarantee that for at least 60 minutes since the first 2575 // request. For example, consider a situation where you make an initial 2576 // request and t he request times out. If you make the request again 2577 // with the same request ID, the server can check if original operation 2578 // with the same request ID was received, and if so, will ignore the 2579 // second request. This prevents clients from accidentally creating 2580 // duplicate commitments. The request ID must be a valid UUID with the 2581 // exception that zero UUID is not supported 2582 // (00000000-0000-0000-0000-000000000000). 2583 RequestId string `json:"requestId,omitempty"` 2584 2585 // ForceSendFields is a list of field names (e.g. 2586 // "IgnoreActiveCertificates") to unconditionally include in API 2587 // requests. By default, fields with empty values are omitted from API 2588 // requests. However, any non-pointer, non-interface field appearing in 2589 // ForceSendFields will be sent to the server regardless of whether the 2590 // field is empty or not. This may be used to include empty fields in 2591 // Patch requests. 2592 ForceSendFields []string `json:"-"` 2593 2594 // NullFields is a list of field names (e.g. "IgnoreActiveCertificates") 2595 // to include in API requests with the JSON null value. By default, 2596 // fields with empty values are omitted from API requests. However, any 2597 // field with an empty value appearing in NullFields will be sent to the 2598 // server as null. It is an error if a field in this list has a 2599 // non-empty value. This may be used to include null fields in Patch 2600 // requests. 2601 NullFields []string `json:"-"` 2602} 2603 2604func (s *ScheduleDeleteCertificateAuthorityRequest) MarshalJSON() ([]byte, error) { 2605 type NoMethod ScheduleDeleteCertificateAuthorityRequest 2606 raw := NoMethod(*s) 2607 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2608} 2609 2610// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 2611type SetIamPolicyRequest struct { 2612 // Policy: REQUIRED: The complete policy to be applied to the 2613 // `resource`. The size of the policy is limited to a few 10s of KB. An 2614 // empty policy is a valid policy but certain Cloud Platform services 2615 // (such as Projects) might reject them. 2616 Policy *Policy `json:"policy,omitempty"` 2617 2618 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the 2619 // policy to modify. Only the fields in the mask will be modified. If no 2620 // mask is provided, the following default mask is used: `paths: 2621 // "bindings, etag" 2622 UpdateMask string `json:"updateMask,omitempty"` 2623 2624 // ForceSendFields is a list of field names (e.g. "Policy") to 2625 // unconditionally include in API requests. By default, fields with 2626 // empty values are omitted from API requests. However, any non-pointer, 2627 // non-interface field appearing in ForceSendFields will be sent to the 2628 // server regardless of whether the field is empty or not. This may be 2629 // used to include empty fields in Patch requests. 2630 ForceSendFields []string `json:"-"` 2631 2632 // NullFields is a list of field names (e.g. "Policy") to include in API 2633 // requests with the JSON null value. By default, fields with empty 2634 // values are omitted from API requests. However, any field with an 2635 // empty value appearing in NullFields will be sent to the server as 2636 // null. It is an error if a field in this list has a non-empty value. 2637 // This may be used to include null fields in Patch requests. 2638 NullFields []string `json:"-"` 2639} 2640 2641func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 2642 type NoMethod SetIamPolicyRequest 2643 raw := NoMethod(*s) 2644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2645} 2646 2647// Status: The `Status` type defines a logical error model that is 2648// suitable for different programming environments, including REST APIs 2649// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 2650// `Status` message contains three pieces of data: error code, error 2651// message, and error details. You can find out more about this error 2652// model and how to work with it in the API Design Guide 2653// (https://cloud.google.com/apis/design/errors). 2654type Status struct { 2655 // Code: The status code, which should be an enum value of 2656 // google.rpc.Code. 2657 Code int64 `json:"code,omitempty"` 2658 2659 // Details: A list of messages that carry the error details. There is a 2660 // common set of message types for APIs to use. 2661 Details []googleapi.RawMessage `json:"details,omitempty"` 2662 2663 // Message: A developer-facing error message, which should be in 2664 // English. Any user-facing error message should be localized and sent 2665 // in the google.rpc.Status.details field, or localized by the client. 2666 Message string `json:"message,omitempty"` 2667 2668 // ForceSendFields is a list of field names (e.g. "Code") to 2669 // unconditionally include in API requests. By default, fields with 2670 // empty values are omitted from API requests. However, any non-pointer, 2671 // non-interface field appearing in ForceSendFields will be sent to the 2672 // server regardless of whether the field is empty or not. This may be 2673 // used to include empty fields in Patch requests. 2674 ForceSendFields []string `json:"-"` 2675 2676 // NullFields is a list of field names (e.g. "Code") to include in API 2677 // requests with the JSON null value. By default, fields with empty 2678 // values are omitted from API requests. However, any field with an 2679 // empty value appearing in NullFields will be sent to the server as 2680 // null. It is an error if a field in this list has a non-empty value. 2681 // This may be used to include null fields in Patch requests. 2682 NullFields []string `json:"-"` 2683} 2684 2685func (s *Status) MarshalJSON() ([]byte, error) { 2686 type NoMethod Status 2687 raw := NoMethod(*s) 2688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2689} 2690 2691// Subject: Subject describes parts of a distinguished name that, in 2692// turn, describes the subject of the certificate. 2693type Subject struct { 2694 // CountryCode: The country code of the subject. 2695 CountryCode string `json:"countryCode,omitempty"` 2696 2697 // Locality: The locality or city of the subject. 2698 Locality string `json:"locality,omitempty"` 2699 2700 // Organization: The organization of the subject. 2701 Organization string `json:"organization,omitempty"` 2702 2703 // OrganizationalUnit: The organizational_unit of the subject. 2704 OrganizationalUnit string `json:"organizationalUnit,omitempty"` 2705 2706 // PostalCode: The postal code of the subject. 2707 PostalCode string `json:"postalCode,omitempty"` 2708 2709 // Province: The province, territory, or regional state of the subject. 2710 Province string `json:"province,omitempty"` 2711 2712 // StreetAddress: The street address of the subject. 2713 StreetAddress string `json:"streetAddress,omitempty"` 2714 2715 // ForceSendFields is a list of field names (e.g. "CountryCode") to 2716 // unconditionally include in API requests. By default, fields with 2717 // empty values are omitted from API requests. However, any non-pointer, 2718 // non-interface field appearing in ForceSendFields will be sent to the 2719 // server regardless of whether the field is empty or not. This may be 2720 // used to include empty fields in Patch requests. 2721 ForceSendFields []string `json:"-"` 2722 2723 // NullFields is a list of field names (e.g. "CountryCode") to include 2724 // in API requests with the JSON null value. By default, fields with 2725 // empty values are omitted from API requests. However, any field with 2726 // an empty value appearing in NullFields will be sent to the server as 2727 // null. It is an error if a field in this list has a non-empty value. 2728 // This may be used to include null fields in Patch requests. 2729 NullFields []string `json:"-"` 2730} 2731 2732func (s *Subject) MarshalJSON() ([]byte, error) { 2733 type NoMethod Subject 2734 raw := NoMethod(*s) 2735 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2736} 2737 2738// SubjectAltNames: SubjectAltNames corresponds to a more modern way of 2739// listing what the asserted identity is in a certificate (i.e., 2740// compared to the "common name" in the distinguished name). 2741type SubjectAltNames struct { 2742 // CustomSans: Contains additional subject alternative name values. 2743 CustomSans []*X509Extension `json:"customSans,omitempty"` 2744 2745 // DnsNames: Contains only valid, fully-qualified host names. 2746 DnsNames []string `json:"dnsNames,omitempty"` 2747 2748 // EmailAddresses: Contains only valid RFC 2822 E-mail addresses. 2749 EmailAddresses []string `json:"emailAddresses,omitempty"` 2750 2751 // IpAddresses: Contains only valid 32-bit IPv4 addresses or RFC 4291 2752 // IPv6 addresses. 2753 IpAddresses []string `json:"ipAddresses,omitempty"` 2754 2755 // Uris: Contains only valid RFC 3986 URIs. 2756 Uris []string `json:"uris,omitempty"` 2757 2758 // ForceSendFields is a list of field names (e.g. "CustomSans") to 2759 // unconditionally include in API requests. By default, fields with 2760 // empty values are omitted from API requests. However, any non-pointer, 2761 // non-interface field appearing in ForceSendFields will be sent to the 2762 // server regardless of whether the field is empty or not. This may be 2763 // used to include empty fields in Patch requests. 2764 ForceSendFields []string `json:"-"` 2765 2766 // NullFields is a list of field names (e.g. "CustomSans") to include in 2767 // API requests with the JSON null value. By default, fields with empty 2768 // values are omitted from API requests. However, any field with an 2769 // empty value appearing in NullFields will be sent to the server as 2770 // null. It is an error if a field in this list has a non-empty value. 2771 // This may be used to include null fields in Patch requests. 2772 NullFields []string `json:"-"` 2773} 2774 2775func (s *SubjectAltNames) MarshalJSON() ([]byte, error) { 2776 type NoMethod SubjectAltNames 2777 raw := NoMethod(*s) 2778 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2779} 2780 2781// SubjectConfig: These values are used to create the distinguished name 2782// and subject alternative name fields in an X.509 certificate. 2783type SubjectConfig struct { 2784 // CommonName: Optional. The "common name" of the distinguished name. 2785 CommonName string `json:"commonName,omitempty"` 2786 2787 // Subject: Required. Contains distinguished name fields such as the 2788 // location and organization. 2789 Subject *Subject `json:"subject,omitempty"` 2790 2791 // SubjectAltName: Optional. The subject alternative name fields. 2792 SubjectAltName *SubjectAltNames `json:"subjectAltName,omitempty"` 2793 2794 // ForceSendFields is a list of field names (e.g. "CommonName") to 2795 // unconditionally include in API requests. By default, fields with 2796 // empty values are omitted from API requests. However, any non-pointer, 2797 // non-interface field appearing in ForceSendFields will be sent to the 2798 // server regardless of whether the field is empty or not. This may be 2799 // used to include empty fields in Patch requests. 2800 ForceSendFields []string `json:"-"` 2801 2802 // NullFields is a list of field names (e.g. "CommonName") to include in 2803 // API requests with the JSON null value. By default, fields with empty 2804 // values are omitted from API requests. However, any field with an 2805 // empty value appearing in NullFields will be sent to the server as 2806 // null. It is an error if a field in this list has a non-empty value. 2807 // This may be used to include null fields in Patch requests. 2808 NullFields []string `json:"-"` 2809} 2810 2811func (s *SubjectConfig) MarshalJSON() ([]byte, error) { 2812 type NoMethod SubjectConfig 2813 raw := NoMethod(*s) 2814 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2815} 2816 2817// SubjectDescription: These values describe fields in an issued X.509 2818// certificate such as the distinguished name, subject alternative 2819// names, serial number, and lifetime. 2820type SubjectDescription struct { 2821 // CommonName: The "common name" of the distinguished name. 2822 CommonName string `json:"commonName,omitempty"` 2823 2824 // HexSerialNumber: The serial number encoded in lowercase hexadecimal. 2825 HexSerialNumber string `json:"hexSerialNumber,omitempty"` 2826 2827 // Lifetime: For convenience, the actual lifetime of an issued 2828 // certificate. Corresponds to 'not_after_time' - 'not_before_time'. 2829 Lifetime string `json:"lifetime,omitempty"` 2830 2831 // NotAfterTime: The time at which the certificate expires. 2832 NotAfterTime string `json:"notAfterTime,omitempty"` 2833 2834 // NotBeforeTime: The time at which the certificate becomes valid. 2835 NotBeforeTime string `json:"notBeforeTime,omitempty"` 2836 2837 // Subject: Contains distinguished name fields such as the location and 2838 // organization. 2839 Subject *Subject `json:"subject,omitempty"` 2840 2841 // SubjectAltName: The subject alternative name fields. 2842 SubjectAltName *SubjectAltNames `json:"subjectAltName,omitempty"` 2843 2844 // ForceSendFields is a list of field names (e.g. "CommonName") to 2845 // unconditionally include in API requests. By default, fields with 2846 // empty values are omitted from API requests. However, any non-pointer, 2847 // non-interface field appearing in ForceSendFields will be sent to the 2848 // server regardless of whether the field is empty or not. This may be 2849 // used to include empty fields in Patch requests. 2850 ForceSendFields []string `json:"-"` 2851 2852 // NullFields is a list of field names (e.g. "CommonName") to include in 2853 // API requests with the JSON null value. By default, fields with empty 2854 // values are omitted from API requests. However, any field with an 2855 // empty value appearing in NullFields will be sent to the server as 2856 // null. It is an error if a field in this list has a non-empty value. 2857 // This may be used to include null fields in Patch requests. 2858 NullFields []string `json:"-"` 2859} 2860 2861func (s *SubjectDescription) MarshalJSON() ([]byte, error) { 2862 type NoMethod SubjectDescription 2863 raw := NoMethod(*s) 2864 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2865} 2866 2867// SubordinateConfig: Describes a subordinate CA's issuers. This is 2868// either a resource path to a known issuing CertificateAuthority, or a 2869// PEM issuer certificate chain. 2870type SubordinateConfig struct { 2871 // CertificateAuthority: Required. This can refer to a 2872 // CertificateAuthority in the same project that was used to create a 2873 // subordinate CertificateAuthority. This field is used for information 2874 // and usability purposes only. The resource name is in the format 2875 // `projects/*/locations/*/certificateAuthorities/*`. 2876 CertificateAuthority string `json:"certificateAuthority,omitempty"` 2877 2878 // PemIssuerChain: Required. Contains the PEM certificate chain for the 2879 // issuers of this CertificateAuthority, but not pem certificate for 2880 // this CA itself. 2881 PemIssuerChain *SubordinateConfigChain `json:"pemIssuerChain,omitempty"` 2882 2883 // ForceSendFields is a list of field names (e.g. 2884 // "CertificateAuthority") to unconditionally include in API requests. 2885 // By default, fields with empty values are omitted from API requests. 2886 // However, any non-pointer, non-interface field appearing in 2887 // ForceSendFields will be sent to the server regardless of whether the 2888 // field is empty or not. This may be used to include empty fields in 2889 // Patch requests. 2890 ForceSendFields []string `json:"-"` 2891 2892 // NullFields is a list of field names (e.g. "CertificateAuthority") to 2893 // include in API requests with the JSON null value. By default, fields 2894 // with empty values are omitted from API requests. However, any field 2895 // with an empty value appearing in NullFields will be sent to the 2896 // server as null. It is an error if a field in this list has a 2897 // non-empty value. This may be used to include null fields in Patch 2898 // requests. 2899 NullFields []string `json:"-"` 2900} 2901 2902func (s *SubordinateConfig) MarshalJSON() ([]byte, error) { 2903 type NoMethod SubordinateConfig 2904 raw := NoMethod(*s) 2905 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2906} 2907 2908// SubordinateConfigChain: This message describes a subordinate CA's 2909// issuer certificate chain. This wrapper exists for compatibility 2910// reasons. 2911type SubordinateConfigChain struct { 2912 // PemCertificates: Required. Expected to be in leaf-to-root order 2913 // according to RFC 5246. 2914 PemCertificates []string `json:"pemCertificates,omitempty"` 2915 2916 // ForceSendFields is a list of field names (e.g. "PemCertificates") to 2917 // unconditionally include in API requests. By default, fields with 2918 // empty values are omitted from API requests. However, any non-pointer, 2919 // non-interface field appearing in ForceSendFields will be sent to the 2920 // server regardless of whether the field is empty or not. This may be 2921 // used to include empty fields in Patch requests. 2922 ForceSendFields []string `json:"-"` 2923 2924 // NullFields is a list of field names (e.g. "PemCertificates") to 2925 // include in API requests with the JSON null value. By default, fields 2926 // with empty values are omitted from API requests. However, any field 2927 // with an empty value appearing in NullFields will be sent to the 2928 // server as null. It is an error if a field in this list has a 2929 // non-empty value. This may be used to include null fields in Patch 2930 // requests. 2931 NullFields []string `json:"-"` 2932} 2933 2934func (s *SubordinateConfigChain) MarshalJSON() ([]byte, error) { 2935 type NoMethod SubordinateConfigChain 2936 raw := NoMethod(*s) 2937 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2938} 2939 2940// TestIamPermissionsRequest: Request message for `TestIamPermissions` 2941// method. 2942type TestIamPermissionsRequest struct { 2943 // Permissions: The set of permissions to check for the `resource`. 2944 // Permissions with wildcards (such as '*' or 'storage.*') are not 2945 // allowed. For more information see IAM Overview 2946 // (https://cloud.google.com/iam/docs/overview#permissions). 2947 Permissions []string `json:"permissions,omitempty"` 2948 2949 // ForceSendFields is a list of field names (e.g. "Permissions") to 2950 // unconditionally include in API requests. By default, fields with 2951 // empty values are omitted from API requests. However, any non-pointer, 2952 // non-interface field appearing in ForceSendFields will be sent to the 2953 // server regardless of whether the field is empty or not. This may be 2954 // used to include empty fields in Patch requests. 2955 ForceSendFields []string `json:"-"` 2956 2957 // NullFields is a list of field names (e.g. "Permissions") to include 2958 // in API requests with the JSON null value. By default, fields with 2959 // empty values are omitted from API requests. However, any field with 2960 // an empty value appearing in NullFields will be sent to the server as 2961 // null. It is an error if a field in this list has a non-empty value. 2962 // This may be used to include null fields in Patch requests. 2963 NullFields []string `json:"-"` 2964} 2965 2966func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 2967 type NoMethod TestIamPermissionsRequest 2968 raw := NoMethod(*s) 2969 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2970} 2971 2972// TestIamPermissionsResponse: Response message for `TestIamPermissions` 2973// method. 2974type TestIamPermissionsResponse struct { 2975 // Permissions: A subset of `TestPermissionsRequest.permissions` that 2976 // the caller is allowed. 2977 Permissions []string `json:"permissions,omitempty"` 2978 2979 // ServerResponse contains the HTTP response code and headers from the 2980 // server. 2981 googleapi.ServerResponse `json:"-"` 2982 2983 // ForceSendFields is a list of field names (e.g. "Permissions") to 2984 // unconditionally include in API requests. By default, fields with 2985 // empty values are omitted from API requests. However, any non-pointer, 2986 // non-interface field appearing in ForceSendFields will be sent to the 2987 // server regardless of whether the field is empty or not. This may be 2988 // used to include empty fields in Patch requests. 2989 ForceSendFields []string `json:"-"` 2990 2991 // NullFields is a list of field names (e.g. "Permissions") to include 2992 // in API requests with the JSON null value. By default, fields with 2993 // empty values are omitted from API requests. However, any field with 2994 // an empty value appearing in NullFields will be sent to the server as 2995 // null. It is an error if a field in this list has a non-empty value. 2996 // This may be used to include null fields in Patch requests. 2997 NullFields []string `json:"-"` 2998} 2999 3000func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 3001 type NoMethod TestIamPermissionsResponse 3002 raw := NoMethod(*s) 3003 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3004} 3005 3006// X509Extension: An X509Extension specifies an X.509 extension, which 3007// may be used in different parts of X.509 objects like certificates, 3008// CSRs, and CRLs. 3009type X509Extension struct { 3010 // Critical: Required. Indicates whether or not this extension is 3011 // critical (i.e., if the client does not know how to handle this 3012 // extension, the client should consider this to be an error). 3013 Critical bool `json:"critical,omitempty"` 3014 3015 // ObjectId: Required. The OID for this X.509 extension. 3016 ObjectId *ObjectId `json:"objectId,omitempty"` 3017 3018 // Value: Required. The value of this X.509 extension. 3019 Value string `json:"value,omitempty"` 3020 3021 // ForceSendFields is a list of field names (e.g. "Critical") to 3022 // unconditionally include in API requests. By default, fields with 3023 // empty values are omitted from API requests. However, any non-pointer, 3024 // non-interface field appearing in ForceSendFields will be sent to the 3025 // server regardless of whether the field is empty or not. This may be 3026 // used to include empty fields in Patch requests. 3027 ForceSendFields []string `json:"-"` 3028 3029 // NullFields is a list of field names (e.g. "Critical") to include in 3030 // API requests with the JSON null value. By default, fields with empty 3031 // values are omitted from API requests. However, any field with an 3032 // empty value appearing in NullFields will be sent to the server as 3033 // null. It is an error if a field in this list has a non-empty value. 3034 // This may be used to include null fields in Patch requests. 3035 NullFields []string `json:"-"` 3036} 3037 3038func (s *X509Extension) MarshalJSON() ([]byte, error) { 3039 type NoMethod X509Extension 3040 raw := NoMethod(*s) 3041 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3042} 3043 3044// method id "privateca.projects.locations.get": 3045 3046type ProjectsLocationsGetCall struct { 3047 s *Service 3048 name string 3049 urlParams_ gensupport.URLParams 3050 ifNoneMatch_ string 3051 ctx_ context.Context 3052 header_ http.Header 3053} 3054 3055// Get: Gets information about a location. 3056// 3057// - name: Resource name for the location. 3058func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 3059 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3060 c.name = name 3061 return c 3062} 3063 3064// Fields allows partial responses to be retrieved. See 3065// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3066// for more information. 3067func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 3068 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3069 return c 3070} 3071 3072// IfNoneMatch sets the optional parameter which makes the operation 3073// fail if the object's ETag matches the given value. This is useful for 3074// getting updates only after the object has changed since the last 3075// request. Use googleapi.IsNotModified to check whether the response 3076// error from Do is the result of In-None-Match. 3077func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 3078 c.ifNoneMatch_ = entityTag 3079 return c 3080} 3081 3082// Context sets the context to be used in this call's Do method. Any 3083// pending HTTP request will be aborted if the provided context is 3084// canceled. 3085func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 3086 c.ctx_ = ctx 3087 return c 3088} 3089 3090// Header returns an http.Header that can be modified by the caller to 3091// add HTTP headers to the request. 3092func (c *ProjectsLocationsGetCall) Header() http.Header { 3093 if c.header_ == nil { 3094 c.header_ = make(http.Header) 3095 } 3096 return c.header_ 3097} 3098 3099func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 3100 reqHeaders := make(http.Header) 3101 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3102 for k, v := range c.header_ { 3103 reqHeaders[k] = v 3104 } 3105 reqHeaders.Set("User-Agent", c.s.userAgent()) 3106 if c.ifNoneMatch_ != "" { 3107 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3108 } 3109 var body io.Reader = nil 3110 c.urlParams_.Set("alt", alt) 3111 c.urlParams_.Set("prettyPrint", "false") 3112 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3113 urls += "?" + c.urlParams_.Encode() 3114 req, err := http.NewRequest("GET", urls, body) 3115 if err != nil { 3116 return nil, err 3117 } 3118 req.Header = reqHeaders 3119 googleapi.Expand(req.URL, map[string]string{ 3120 "name": c.name, 3121 }) 3122 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3123} 3124 3125// Do executes the "privateca.projects.locations.get" call. 3126// Exactly one of *Location or error will be non-nil. Any non-2xx status 3127// code is an error. Response headers are in either 3128// *Location.ServerResponse.Header or (if a response was returned at 3129// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3130// to check whether the returned error was because 3131// http.StatusNotModified was returned. 3132func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { 3133 gensupport.SetOptions(c.urlParams_, opts...) 3134 res, err := c.doRequest("json") 3135 if res != nil && res.StatusCode == http.StatusNotModified { 3136 if res.Body != nil { 3137 res.Body.Close() 3138 } 3139 return nil, &googleapi.Error{ 3140 Code: res.StatusCode, 3141 Header: res.Header, 3142 } 3143 } 3144 if err != nil { 3145 return nil, err 3146 } 3147 defer googleapi.CloseBody(res) 3148 if err := googleapi.CheckResponse(res); err != nil { 3149 return nil, err 3150 } 3151 ret := &Location{ 3152 ServerResponse: googleapi.ServerResponse{ 3153 Header: res.Header, 3154 HTTPStatusCode: res.StatusCode, 3155 }, 3156 } 3157 target := &ret 3158 if err := gensupport.DecodeResponse(target, res); err != nil { 3159 return nil, err 3160 } 3161 return ret, nil 3162 // { 3163 // "description": "Gets information about a location.", 3164 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}", 3165 // "httpMethod": "GET", 3166 // "id": "privateca.projects.locations.get", 3167 // "parameterOrder": [ 3168 // "name" 3169 // ], 3170 // "parameters": { 3171 // "name": { 3172 // "description": "Resource name for the location.", 3173 // "location": "path", 3174 // "pattern": "^projects/[^/]+/locations/[^/]+$", 3175 // "required": true, 3176 // "type": "string" 3177 // } 3178 // }, 3179 // "path": "v1beta1/{+name}", 3180 // "response": { 3181 // "$ref": "Location" 3182 // }, 3183 // "scopes": [ 3184 // "https://www.googleapis.com/auth/cloud-platform" 3185 // ] 3186 // } 3187 3188} 3189 3190// method id "privateca.projects.locations.list": 3191 3192type ProjectsLocationsListCall struct { 3193 s *Service 3194 name string 3195 urlParams_ gensupport.URLParams 3196 ifNoneMatch_ string 3197 ctx_ context.Context 3198 header_ http.Header 3199} 3200 3201// List: Lists information about the supported locations for this 3202// service. 3203// 3204// - name: The resource that owns the locations collection, if 3205// applicable. 3206func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 3207 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3208 c.name = name 3209 return c 3210} 3211 3212// Filter sets the optional parameter "filter": A filter to narrow down 3213// results to a preferred subset. The filtering language accepts strings 3214// like "displayName=tokyo", and is documented in more detail in AIP-160 3215// (https://google.aip.dev/160). 3216func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 3217 c.urlParams_.Set("filter", filter) 3218 return c 3219} 3220 3221// PageSize sets the optional parameter "pageSize": The maximum number 3222// of results to return. If not set, the service will select a default. 3223func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 3224 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3225 return c 3226} 3227 3228// PageToken sets the optional parameter "pageToken": A page token 3229// received from the `next_page_token` field in the response. Send that 3230// page token to receive the subsequent page. 3231func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 3232 c.urlParams_.Set("pageToken", pageToken) 3233 return c 3234} 3235 3236// Fields allows partial responses to be retrieved. See 3237// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3238// for more information. 3239func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 3240 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3241 return c 3242} 3243 3244// IfNoneMatch sets the optional parameter which makes the operation 3245// fail if the object's ETag matches the given value. This is useful for 3246// getting updates only after the object has changed since the last 3247// request. Use googleapi.IsNotModified to check whether the response 3248// error from Do is the result of In-None-Match. 3249func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 3250 c.ifNoneMatch_ = entityTag 3251 return c 3252} 3253 3254// Context sets the context to be used in this call's Do method. Any 3255// pending HTTP request will be aborted if the provided context is 3256// canceled. 3257func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 3258 c.ctx_ = ctx 3259 return c 3260} 3261 3262// Header returns an http.Header that can be modified by the caller to 3263// add HTTP headers to the request. 3264func (c *ProjectsLocationsListCall) Header() http.Header { 3265 if c.header_ == nil { 3266 c.header_ = make(http.Header) 3267 } 3268 return c.header_ 3269} 3270 3271func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 3272 reqHeaders := make(http.Header) 3273 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3274 for k, v := range c.header_ { 3275 reqHeaders[k] = v 3276 } 3277 reqHeaders.Set("User-Agent", c.s.userAgent()) 3278 if c.ifNoneMatch_ != "" { 3279 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3280 } 3281 var body io.Reader = nil 3282 c.urlParams_.Set("alt", alt) 3283 c.urlParams_.Set("prettyPrint", "false") 3284 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") 3285 urls += "?" + c.urlParams_.Encode() 3286 req, err := http.NewRequest("GET", urls, body) 3287 if err != nil { 3288 return nil, err 3289 } 3290 req.Header = reqHeaders 3291 googleapi.Expand(req.URL, map[string]string{ 3292 "name": c.name, 3293 }) 3294 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3295} 3296 3297// Do executes the "privateca.projects.locations.list" call. 3298// Exactly one of *ListLocationsResponse or error will be non-nil. Any 3299// non-2xx status code is an error. Response headers are in either 3300// *ListLocationsResponse.ServerResponse.Header or (if a response was 3301// returned at all) in error.(*googleapi.Error).Header. Use 3302// googleapi.IsNotModified to check whether the returned error was 3303// because http.StatusNotModified was returned. 3304func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 3305 gensupport.SetOptions(c.urlParams_, opts...) 3306 res, err := c.doRequest("json") 3307 if res != nil && res.StatusCode == http.StatusNotModified { 3308 if res.Body != nil { 3309 res.Body.Close() 3310 } 3311 return nil, &googleapi.Error{ 3312 Code: res.StatusCode, 3313 Header: res.Header, 3314 } 3315 } 3316 if err != nil { 3317 return nil, err 3318 } 3319 defer googleapi.CloseBody(res) 3320 if err := googleapi.CheckResponse(res); err != nil { 3321 return nil, err 3322 } 3323 ret := &ListLocationsResponse{ 3324 ServerResponse: googleapi.ServerResponse{ 3325 Header: res.Header, 3326 HTTPStatusCode: res.StatusCode, 3327 }, 3328 } 3329 target := &ret 3330 if err := gensupport.DecodeResponse(target, res); err != nil { 3331 return nil, err 3332 } 3333 return ret, nil 3334 // { 3335 // "description": "Lists information about the supported locations for this service.", 3336 // "flatPath": "v1beta1/projects/{projectsId}/locations", 3337 // "httpMethod": "GET", 3338 // "id": "privateca.projects.locations.list", 3339 // "parameterOrder": [ 3340 // "name" 3341 // ], 3342 // "parameters": { 3343 // "filter": { 3344 // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in [AIP-160](https://google.aip.dev/160).", 3345 // "location": "query", 3346 // "type": "string" 3347 // }, 3348 // "name": { 3349 // "description": "The resource that owns the locations collection, if applicable.", 3350 // "location": "path", 3351 // "pattern": "^projects/[^/]+$", 3352 // "required": true, 3353 // "type": "string" 3354 // }, 3355 // "pageSize": { 3356 // "description": "The maximum number of results to return. If not set, the service will select a default.", 3357 // "format": "int32", 3358 // "location": "query", 3359 // "type": "integer" 3360 // }, 3361 // "pageToken": { 3362 // "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", 3363 // "location": "query", 3364 // "type": "string" 3365 // } 3366 // }, 3367 // "path": "v1beta1/{+name}/locations", 3368 // "response": { 3369 // "$ref": "ListLocationsResponse" 3370 // }, 3371 // "scopes": [ 3372 // "https://www.googleapis.com/auth/cloud-platform" 3373 // ] 3374 // } 3375 3376} 3377 3378// Pages invokes f for each page of results. 3379// A non-nil error returned from f will halt the iteration. 3380// The provided context supersedes any context provided to the Context method. 3381func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 3382 c.ctx_ = ctx 3383 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3384 for { 3385 x, err := c.Do() 3386 if err != nil { 3387 return err 3388 } 3389 if err := f(x); err != nil { 3390 return err 3391 } 3392 if x.NextPageToken == "" { 3393 return nil 3394 } 3395 c.PageToken(x.NextPageToken) 3396 } 3397} 3398 3399// method id "privateca.projects.locations.certificateAuthorities.activate": 3400 3401type ProjectsLocationsCertificateAuthoritiesActivateCall struct { 3402 s *Service 3403 name string 3404 activatecertificateauthorityrequest *ActivateCertificateAuthorityRequest 3405 urlParams_ gensupport.URLParams 3406 ctx_ context.Context 3407 header_ http.Header 3408} 3409 3410// Activate: Activate a CertificateAuthority that is in state 3411// PENDING_ACTIVATION and is of type SUBORDINATE. After the parent 3412// Certificate Authority signs a certificate signing request from 3413// FetchCertificateAuthorityCsr, this method can complete the activation 3414// process. 3415// 3416// - name: The resource name for this CertificateAuthority in the format 3417// `projects/*/locations/*/certificateAuthorities/*`. 3418func (r *ProjectsLocationsCertificateAuthoritiesService) Activate(name string, activatecertificateauthorityrequest *ActivateCertificateAuthorityRequest) *ProjectsLocationsCertificateAuthoritiesActivateCall { 3419 c := &ProjectsLocationsCertificateAuthoritiesActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3420 c.name = name 3421 c.activatecertificateauthorityrequest = activatecertificateauthorityrequest 3422 return c 3423} 3424 3425// Fields allows partial responses to be retrieved. See 3426// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3427// for more information. 3428func (c *ProjectsLocationsCertificateAuthoritiesActivateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesActivateCall { 3429 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3430 return c 3431} 3432 3433// Context sets the context to be used in this call's Do method. Any 3434// pending HTTP request will be aborted if the provided context is 3435// canceled. 3436func (c *ProjectsLocationsCertificateAuthoritiesActivateCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesActivateCall { 3437 c.ctx_ = ctx 3438 return c 3439} 3440 3441// Header returns an http.Header that can be modified by the caller to 3442// add HTTP headers to the request. 3443func (c *ProjectsLocationsCertificateAuthoritiesActivateCall) Header() http.Header { 3444 if c.header_ == nil { 3445 c.header_ = make(http.Header) 3446 } 3447 return c.header_ 3448} 3449 3450func (c *ProjectsLocationsCertificateAuthoritiesActivateCall) doRequest(alt string) (*http.Response, error) { 3451 reqHeaders := make(http.Header) 3452 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3453 for k, v := range c.header_ { 3454 reqHeaders[k] = v 3455 } 3456 reqHeaders.Set("User-Agent", c.s.userAgent()) 3457 var body io.Reader = nil 3458 body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatecertificateauthorityrequest) 3459 if err != nil { 3460 return nil, err 3461 } 3462 reqHeaders.Set("Content-Type", "application/json") 3463 c.urlParams_.Set("alt", alt) 3464 c.urlParams_.Set("prettyPrint", "false") 3465 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:activate") 3466 urls += "?" + c.urlParams_.Encode() 3467 req, err := http.NewRequest("POST", urls, body) 3468 if err != nil { 3469 return nil, err 3470 } 3471 req.Header = reqHeaders 3472 googleapi.Expand(req.URL, map[string]string{ 3473 "name": c.name, 3474 }) 3475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3476} 3477 3478// Do executes the "privateca.projects.locations.certificateAuthorities.activate" call. 3479// Exactly one of *Operation or error will be non-nil. Any non-2xx 3480// status code is an error. Response headers are in either 3481// *Operation.ServerResponse.Header or (if a response was returned at 3482// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3483// to check whether the returned error was because 3484// http.StatusNotModified was returned. 3485func (c *ProjectsLocationsCertificateAuthoritiesActivateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3486 gensupport.SetOptions(c.urlParams_, opts...) 3487 res, err := c.doRequest("json") 3488 if res != nil && res.StatusCode == http.StatusNotModified { 3489 if res.Body != nil { 3490 res.Body.Close() 3491 } 3492 return nil, &googleapi.Error{ 3493 Code: res.StatusCode, 3494 Header: res.Header, 3495 } 3496 } 3497 if err != nil { 3498 return nil, err 3499 } 3500 defer googleapi.CloseBody(res) 3501 if err := googleapi.CheckResponse(res); err != nil { 3502 return nil, err 3503 } 3504 ret := &Operation{ 3505 ServerResponse: googleapi.ServerResponse{ 3506 Header: res.Header, 3507 HTTPStatusCode: res.StatusCode, 3508 }, 3509 } 3510 target := &ret 3511 if err := gensupport.DecodeResponse(target, res); err != nil { 3512 return nil, err 3513 } 3514 return ret, nil 3515 // { 3516 // "description": "Activate a CertificateAuthority that is in state PENDING_ACTIVATION and is of type SUBORDINATE. After the parent Certificate Authority signs a certificate signing request from FetchCertificateAuthorityCsr, this method can complete the activation process.", 3517 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:activate", 3518 // "httpMethod": "POST", 3519 // "id": "privateca.projects.locations.certificateAuthorities.activate", 3520 // "parameterOrder": [ 3521 // "name" 3522 // ], 3523 // "parameters": { 3524 // "name": { 3525 // "description": "Required. The resource name for this CertificateAuthority in the format `projects/*/locations/*/certificateAuthorities/*`.", 3526 // "location": "path", 3527 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 3528 // "required": true, 3529 // "type": "string" 3530 // } 3531 // }, 3532 // "path": "v1beta1/{+name}:activate", 3533 // "request": { 3534 // "$ref": "ActivateCertificateAuthorityRequest" 3535 // }, 3536 // "response": { 3537 // "$ref": "Operation" 3538 // }, 3539 // "scopes": [ 3540 // "https://www.googleapis.com/auth/cloud-platform" 3541 // ] 3542 // } 3543 3544} 3545 3546// method id "privateca.projects.locations.certificateAuthorities.create": 3547 3548type ProjectsLocationsCertificateAuthoritiesCreateCall struct { 3549 s *Service 3550 parent string 3551 certificateauthority *CertificateAuthority 3552 urlParams_ gensupport.URLParams 3553 ctx_ context.Context 3554 header_ http.Header 3555} 3556 3557// Create: Create a new CertificateAuthority in a given Project and 3558// Location. 3559// 3560// - parent: The resource name of the location associated with the 3561// CertificateAuthorities, in the format `projects/*/locations/*`. 3562func (r *ProjectsLocationsCertificateAuthoritiesService) Create(parent string, certificateauthority *CertificateAuthority) *ProjectsLocationsCertificateAuthoritiesCreateCall { 3563 c := &ProjectsLocationsCertificateAuthoritiesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3564 c.parent = parent 3565 c.certificateauthority = certificateauthority 3566 return c 3567} 3568 3569// CertificateAuthorityId sets the optional parameter 3570// "certificateAuthorityId": Required. It must be unique within a 3571// location and match the regular expression `[a-zA-Z0-9_-]{1,63}` 3572func (c *ProjectsLocationsCertificateAuthoritiesCreateCall) CertificateAuthorityId(certificateAuthorityId string) *ProjectsLocationsCertificateAuthoritiesCreateCall { 3573 c.urlParams_.Set("certificateAuthorityId", certificateAuthorityId) 3574 return c 3575} 3576 3577// RequestId sets the optional parameter "requestId": An ID to identify 3578// requests. Specify a unique request ID so that if you must retry your 3579// request, the server will know to ignore the request if it has already 3580// been completed. The server will guarantee that for at least 60 3581// minutes since the first request. For example, consider a situation 3582// where you make an initial request and t he request times out. If you 3583// make the request again with the same request ID, the server can check 3584// if original operation with the same request ID was received, and if 3585// so, will ignore the second request. This prevents clients from 3586// accidentally creating duplicate commitments. The request ID must be a 3587// valid UUID with the exception that zero UUID is not supported 3588// (00000000-0000-0000-0000-000000000000). 3589func (c *ProjectsLocationsCertificateAuthoritiesCreateCall) RequestId(requestId string) *ProjectsLocationsCertificateAuthoritiesCreateCall { 3590 c.urlParams_.Set("requestId", requestId) 3591 return c 3592} 3593 3594// Fields allows partial responses to be retrieved. See 3595// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3596// for more information. 3597func (c *ProjectsLocationsCertificateAuthoritiesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCreateCall { 3598 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3599 return c 3600} 3601 3602// Context sets the context to be used in this call's Do method. Any 3603// pending HTTP request will be aborted if the provided context is 3604// canceled. 3605func (c *ProjectsLocationsCertificateAuthoritiesCreateCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCreateCall { 3606 c.ctx_ = ctx 3607 return c 3608} 3609 3610// Header returns an http.Header that can be modified by the caller to 3611// add HTTP headers to the request. 3612func (c *ProjectsLocationsCertificateAuthoritiesCreateCall) Header() http.Header { 3613 if c.header_ == nil { 3614 c.header_ = make(http.Header) 3615 } 3616 return c.header_ 3617} 3618 3619func (c *ProjectsLocationsCertificateAuthoritiesCreateCall) doRequest(alt string) (*http.Response, error) { 3620 reqHeaders := make(http.Header) 3621 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3622 for k, v := range c.header_ { 3623 reqHeaders[k] = v 3624 } 3625 reqHeaders.Set("User-Agent", c.s.userAgent()) 3626 var body io.Reader = nil 3627 body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificateauthority) 3628 if err != nil { 3629 return nil, err 3630 } 3631 reqHeaders.Set("Content-Type", "application/json") 3632 c.urlParams_.Set("alt", alt) 3633 c.urlParams_.Set("prettyPrint", "false") 3634 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/certificateAuthorities") 3635 urls += "?" + c.urlParams_.Encode() 3636 req, err := http.NewRequest("POST", urls, body) 3637 if err != nil { 3638 return nil, err 3639 } 3640 req.Header = reqHeaders 3641 googleapi.Expand(req.URL, map[string]string{ 3642 "parent": c.parent, 3643 }) 3644 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3645} 3646 3647// Do executes the "privateca.projects.locations.certificateAuthorities.create" call. 3648// Exactly one of *Operation or error will be non-nil. Any non-2xx 3649// status code is an error. Response headers are in either 3650// *Operation.ServerResponse.Header or (if a response was returned at 3651// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3652// to check whether the returned error was because 3653// http.StatusNotModified was returned. 3654func (c *ProjectsLocationsCertificateAuthoritiesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3655 gensupport.SetOptions(c.urlParams_, opts...) 3656 res, err := c.doRequest("json") 3657 if res != nil && res.StatusCode == http.StatusNotModified { 3658 if res.Body != nil { 3659 res.Body.Close() 3660 } 3661 return nil, &googleapi.Error{ 3662 Code: res.StatusCode, 3663 Header: res.Header, 3664 } 3665 } 3666 if err != nil { 3667 return nil, err 3668 } 3669 defer googleapi.CloseBody(res) 3670 if err := googleapi.CheckResponse(res); err != nil { 3671 return nil, err 3672 } 3673 ret := &Operation{ 3674 ServerResponse: googleapi.ServerResponse{ 3675 Header: res.Header, 3676 HTTPStatusCode: res.StatusCode, 3677 }, 3678 } 3679 target := &ret 3680 if err := gensupport.DecodeResponse(target, res); err != nil { 3681 return nil, err 3682 } 3683 return ret, nil 3684 // { 3685 // "description": "Create a new CertificateAuthority in a given Project and Location.", 3686 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities", 3687 // "httpMethod": "POST", 3688 // "id": "privateca.projects.locations.certificateAuthorities.create", 3689 // "parameterOrder": [ 3690 // "parent" 3691 // ], 3692 // "parameters": { 3693 // "certificateAuthorityId": { 3694 // "description": "Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63}`", 3695 // "location": "query", 3696 // "type": "string" 3697 // }, 3698 // "parent": { 3699 // "description": "Required. The resource name of the location associated with the CertificateAuthorities, in the format `projects/*/locations/*`.", 3700 // "location": "path", 3701 // "pattern": "^projects/[^/]+/locations/[^/]+$", 3702 // "required": true, 3703 // "type": "string" 3704 // }, 3705 // "requestId": { 3706 // "description": "Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", 3707 // "location": "query", 3708 // "type": "string" 3709 // } 3710 // }, 3711 // "path": "v1beta1/{+parent}/certificateAuthorities", 3712 // "request": { 3713 // "$ref": "CertificateAuthority" 3714 // }, 3715 // "response": { 3716 // "$ref": "Operation" 3717 // }, 3718 // "scopes": [ 3719 // "https://www.googleapis.com/auth/cloud-platform" 3720 // ] 3721 // } 3722 3723} 3724 3725// method id "privateca.projects.locations.certificateAuthorities.disable": 3726 3727type ProjectsLocationsCertificateAuthoritiesDisableCall struct { 3728 s *Service 3729 name string 3730 disablecertificateauthorityrequest *DisableCertificateAuthorityRequest 3731 urlParams_ gensupport.URLParams 3732 ctx_ context.Context 3733 header_ http.Header 3734} 3735 3736// Disable: Disable a CertificateAuthority. 3737// 3738// - name: The resource name for this CertificateAuthority in the format 3739// `projects/*/locations/*/certificateAuthorities/*`. 3740func (r *ProjectsLocationsCertificateAuthoritiesService) Disable(name string, disablecertificateauthorityrequest *DisableCertificateAuthorityRequest) *ProjectsLocationsCertificateAuthoritiesDisableCall { 3741 c := &ProjectsLocationsCertificateAuthoritiesDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3742 c.name = name 3743 c.disablecertificateauthorityrequest = disablecertificateauthorityrequest 3744 return c 3745} 3746 3747// Fields allows partial responses to be retrieved. See 3748// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3749// for more information. 3750func (c *ProjectsLocationsCertificateAuthoritiesDisableCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesDisableCall { 3751 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3752 return c 3753} 3754 3755// Context sets the context to be used in this call's Do method. Any 3756// pending HTTP request will be aborted if the provided context is 3757// canceled. 3758func (c *ProjectsLocationsCertificateAuthoritiesDisableCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesDisableCall { 3759 c.ctx_ = ctx 3760 return c 3761} 3762 3763// Header returns an http.Header that can be modified by the caller to 3764// add HTTP headers to the request. 3765func (c *ProjectsLocationsCertificateAuthoritiesDisableCall) Header() http.Header { 3766 if c.header_ == nil { 3767 c.header_ = make(http.Header) 3768 } 3769 return c.header_ 3770} 3771 3772func (c *ProjectsLocationsCertificateAuthoritiesDisableCall) doRequest(alt string) (*http.Response, error) { 3773 reqHeaders := make(http.Header) 3774 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3775 for k, v := range c.header_ { 3776 reqHeaders[k] = v 3777 } 3778 reqHeaders.Set("User-Agent", c.s.userAgent()) 3779 var body io.Reader = nil 3780 body, err := googleapi.WithoutDataWrapper.JSONReader(c.disablecertificateauthorityrequest) 3781 if err != nil { 3782 return nil, err 3783 } 3784 reqHeaders.Set("Content-Type", "application/json") 3785 c.urlParams_.Set("alt", alt) 3786 c.urlParams_.Set("prettyPrint", "false") 3787 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:disable") 3788 urls += "?" + c.urlParams_.Encode() 3789 req, err := http.NewRequest("POST", urls, body) 3790 if err != nil { 3791 return nil, err 3792 } 3793 req.Header = reqHeaders 3794 googleapi.Expand(req.URL, map[string]string{ 3795 "name": c.name, 3796 }) 3797 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3798} 3799 3800// Do executes the "privateca.projects.locations.certificateAuthorities.disable" call. 3801// Exactly one of *Operation or error will be non-nil. Any non-2xx 3802// status code is an error. Response headers are in either 3803// *Operation.ServerResponse.Header or (if a response was returned at 3804// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3805// to check whether the returned error was because 3806// http.StatusNotModified was returned. 3807func (c *ProjectsLocationsCertificateAuthoritiesDisableCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3808 gensupport.SetOptions(c.urlParams_, opts...) 3809 res, err := c.doRequest("json") 3810 if res != nil && res.StatusCode == http.StatusNotModified { 3811 if res.Body != nil { 3812 res.Body.Close() 3813 } 3814 return nil, &googleapi.Error{ 3815 Code: res.StatusCode, 3816 Header: res.Header, 3817 } 3818 } 3819 if err != nil { 3820 return nil, err 3821 } 3822 defer googleapi.CloseBody(res) 3823 if err := googleapi.CheckResponse(res); err != nil { 3824 return nil, err 3825 } 3826 ret := &Operation{ 3827 ServerResponse: googleapi.ServerResponse{ 3828 Header: res.Header, 3829 HTTPStatusCode: res.StatusCode, 3830 }, 3831 } 3832 target := &ret 3833 if err := gensupport.DecodeResponse(target, res); err != nil { 3834 return nil, err 3835 } 3836 return ret, nil 3837 // { 3838 // "description": "Disable a CertificateAuthority.", 3839 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:disable", 3840 // "httpMethod": "POST", 3841 // "id": "privateca.projects.locations.certificateAuthorities.disable", 3842 // "parameterOrder": [ 3843 // "name" 3844 // ], 3845 // "parameters": { 3846 // "name": { 3847 // "description": "Required. The resource name for this CertificateAuthority in the format `projects/*/locations/*/certificateAuthorities/*`.", 3848 // "location": "path", 3849 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 3850 // "required": true, 3851 // "type": "string" 3852 // } 3853 // }, 3854 // "path": "v1beta1/{+name}:disable", 3855 // "request": { 3856 // "$ref": "DisableCertificateAuthorityRequest" 3857 // }, 3858 // "response": { 3859 // "$ref": "Operation" 3860 // }, 3861 // "scopes": [ 3862 // "https://www.googleapis.com/auth/cloud-platform" 3863 // ] 3864 // } 3865 3866} 3867 3868// method id "privateca.projects.locations.certificateAuthorities.enable": 3869 3870type ProjectsLocationsCertificateAuthoritiesEnableCall struct { 3871 s *Service 3872 name string 3873 enablecertificateauthorityrequest *EnableCertificateAuthorityRequest 3874 urlParams_ gensupport.URLParams 3875 ctx_ context.Context 3876 header_ http.Header 3877} 3878 3879// Enable: Enable a CertificateAuthority. 3880// 3881// - name: The resource name for this CertificateAuthority in the format 3882// `projects/*/locations/*/certificateAuthorities/*`. 3883func (r *ProjectsLocationsCertificateAuthoritiesService) Enable(name string, enablecertificateauthorityrequest *EnableCertificateAuthorityRequest) *ProjectsLocationsCertificateAuthoritiesEnableCall { 3884 c := &ProjectsLocationsCertificateAuthoritiesEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3885 c.name = name 3886 c.enablecertificateauthorityrequest = enablecertificateauthorityrequest 3887 return c 3888} 3889 3890// Fields allows partial responses to be retrieved. See 3891// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3892// for more information. 3893func (c *ProjectsLocationsCertificateAuthoritiesEnableCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesEnableCall { 3894 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3895 return c 3896} 3897 3898// Context sets the context to be used in this call's Do method. Any 3899// pending HTTP request will be aborted if the provided context is 3900// canceled. 3901func (c *ProjectsLocationsCertificateAuthoritiesEnableCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesEnableCall { 3902 c.ctx_ = ctx 3903 return c 3904} 3905 3906// Header returns an http.Header that can be modified by the caller to 3907// add HTTP headers to the request. 3908func (c *ProjectsLocationsCertificateAuthoritiesEnableCall) Header() http.Header { 3909 if c.header_ == nil { 3910 c.header_ = make(http.Header) 3911 } 3912 return c.header_ 3913} 3914 3915func (c *ProjectsLocationsCertificateAuthoritiesEnableCall) doRequest(alt string) (*http.Response, error) { 3916 reqHeaders := make(http.Header) 3917 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3918 for k, v := range c.header_ { 3919 reqHeaders[k] = v 3920 } 3921 reqHeaders.Set("User-Agent", c.s.userAgent()) 3922 var body io.Reader = nil 3923 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enablecertificateauthorityrequest) 3924 if err != nil { 3925 return nil, err 3926 } 3927 reqHeaders.Set("Content-Type", "application/json") 3928 c.urlParams_.Set("alt", alt) 3929 c.urlParams_.Set("prettyPrint", "false") 3930 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:enable") 3931 urls += "?" + c.urlParams_.Encode() 3932 req, err := http.NewRequest("POST", urls, body) 3933 if err != nil { 3934 return nil, err 3935 } 3936 req.Header = reqHeaders 3937 googleapi.Expand(req.URL, map[string]string{ 3938 "name": c.name, 3939 }) 3940 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3941} 3942 3943// Do executes the "privateca.projects.locations.certificateAuthorities.enable" call. 3944// Exactly one of *Operation or error will be non-nil. Any non-2xx 3945// status code is an error. Response headers are in either 3946// *Operation.ServerResponse.Header or (if a response was returned at 3947// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3948// to check whether the returned error was because 3949// http.StatusNotModified was returned. 3950func (c *ProjectsLocationsCertificateAuthoritiesEnableCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3951 gensupport.SetOptions(c.urlParams_, opts...) 3952 res, err := c.doRequest("json") 3953 if res != nil && res.StatusCode == http.StatusNotModified { 3954 if res.Body != nil { 3955 res.Body.Close() 3956 } 3957 return nil, &googleapi.Error{ 3958 Code: res.StatusCode, 3959 Header: res.Header, 3960 } 3961 } 3962 if err != nil { 3963 return nil, err 3964 } 3965 defer googleapi.CloseBody(res) 3966 if err := googleapi.CheckResponse(res); err != nil { 3967 return nil, err 3968 } 3969 ret := &Operation{ 3970 ServerResponse: googleapi.ServerResponse{ 3971 Header: res.Header, 3972 HTTPStatusCode: res.StatusCode, 3973 }, 3974 } 3975 target := &ret 3976 if err := gensupport.DecodeResponse(target, res); err != nil { 3977 return nil, err 3978 } 3979 return ret, nil 3980 // { 3981 // "description": "Enable a CertificateAuthority.", 3982 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:enable", 3983 // "httpMethod": "POST", 3984 // "id": "privateca.projects.locations.certificateAuthorities.enable", 3985 // "parameterOrder": [ 3986 // "name" 3987 // ], 3988 // "parameters": { 3989 // "name": { 3990 // "description": "Required. The resource name for this CertificateAuthority in the format `projects/*/locations/*/certificateAuthorities/*`.", 3991 // "location": "path", 3992 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 3993 // "required": true, 3994 // "type": "string" 3995 // } 3996 // }, 3997 // "path": "v1beta1/{+name}:enable", 3998 // "request": { 3999 // "$ref": "EnableCertificateAuthorityRequest" 4000 // }, 4001 // "response": { 4002 // "$ref": "Operation" 4003 // }, 4004 // "scopes": [ 4005 // "https://www.googleapis.com/auth/cloud-platform" 4006 // ] 4007 // } 4008 4009} 4010 4011// method id "privateca.projects.locations.certificateAuthorities.fetch": 4012 4013type ProjectsLocationsCertificateAuthoritiesFetchCall struct { 4014 s *Service 4015 name string 4016 urlParams_ gensupport.URLParams 4017 ifNoneMatch_ string 4018 ctx_ context.Context 4019 header_ http.Header 4020} 4021 4022// Fetch: Fetch a certificate signing request (CSR) from a 4023// CertificateAuthority that is in state PENDING_ACTIVATION and is of 4024// type SUBORDINATE. The CSR must then be signed by the desired parent 4025// Certificate Authority, which could be another CertificateAuthority 4026// resource, or could be an on-prem certificate authority. See also 4027// ActivateCertificateAuthority. 4028// 4029// - name: The resource name for this CertificateAuthority in the format 4030// `projects/*/locations/*/certificateAuthorities/*`. 4031func (r *ProjectsLocationsCertificateAuthoritiesService) Fetch(name string) *ProjectsLocationsCertificateAuthoritiesFetchCall { 4032 c := &ProjectsLocationsCertificateAuthoritiesFetchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4033 c.name = name 4034 return c 4035} 4036 4037// Fields allows partial responses to be retrieved. See 4038// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4039// for more information. 4040func (c *ProjectsLocationsCertificateAuthoritiesFetchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesFetchCall { 4041 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4042 return c 4043} 4044 4045// IfNoneMatch sets the optional parameter which makes the operation 4046// fail if the object's ETag matches the given value. This is useful for 4047// getting updates only after the object has changed since the last 4048// request. Use googleapi.IsNotModified to check whether the response 4049// error from Do is the result of In-None-Match. 4050func (c *ProjectsLocationsCertificateAuthoritiesFetchCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesFetchCall { 4051 c.ifNoneMatch_ = entityTag 4052 return c 4053} 4054 4055// Context sets the context to be used in this call's Do method. Any 4056// pending HTTP request will be aborted if the provided context is 4057// canceled. 4058func (c *ProjectsLocationsCertificateAuthoritiesFetchCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesFetchCall { 4059 c.ctx_ = ctx 4060 return c 4061} 4062 4063// Header returns an http.Header that can be modified by the caller to 4064// add HTTP headers to the request. 4065func (c *ProjectsLocationsCertificateAuthoritiesFetchCall) Header() http.Header { 4066 if c.header_ == nil { 4067 c.header_ = make(http.Header) 4068 } 4069 return c.header_ 4070} 4071 4072func (c *ProjectsLocationsCertificateAuthoritiesFetchCall) doRequest(alt string) (*http.Response, error) { 4073 reqHeaders := make(http.Header) 4074 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4075 for k, v := range c.header_ { 4076 reqHeaders[k] = v 4077 } 4078 reqHeaders.Set("User-Agent", c.s.userAgent()) 4079 if c.ifNoneMatch_ != "" { 4080 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4081 } 4082 var body io.Reader = nil 4083 c.urlParams_.Set("alt", alt) 4084 c.urlParams_.Set("prettyPrint", "false") 4085 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:fetch") 4086 urls += "?" + c.urlParams_.Encode() 4087 req, err := http.NewRequest("GET", urls, body) 4088 if err != nil { 4089 return nil, err 4090 } 4091 req.Header = reqHeaders 4092 googleapi.Expand(req.URL, map[string]string{ 4093 "name": c.name, 4094 }) 4095 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4096} 4097 4098// Do executes the "privateca.projects.locations.certificateAuthorities.fetch" call. 4099// Exactly one of *FetchCertificateAuthorityCsrResponse or error will be 4100// non-nil. Any non-2xx status code is an error. Response headers are in 4101// either *FetchCertificateAuthorityCsrResponse.ServerResponse.Header or 4102// (if a response was returned at all) in 4103// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4104// whether the returned error was because http.StatusNotModified was 4105// returned. 4106func (c *ProjectsLocationsCertificateAuthoritiesFetchCall) Do(opts ...googleapi.CallOption) (*FetchCertificateAuthorityCsrResponse, error) { 4107 gensupport.SetOptions(c.urlParams_, opts...) 4108 res, err := c.doRequest("json") 4109 if res != nil && res.StatusCode == http.StatusNotModified { 4110 if res.Body != nil { 4111 res.Body.Close() 4112 } 4113 return nil, &googleapi.Error{ 4114 Code: res.StatusCode, 4115 Header: res.Header, 4116 } 4117 } 4118 if err != nil { 4119 return nil, err 4120 } 4121 defer googleapi.CloseBody(res) 4122 if err := googleapi.CheckResponse(res); err != nil { 4123 return nil, err 4124 } 4125 ret := &FetchCertificateAuthorityCsrResponse{ 4126 ServerResponse: googleapi.ServerResponse{ 4127 Header: res.Header, 4128 HTTPStatusCode: res.StatusCode, 4129 }, 4130 } 4131 target := &ret 4132 if err := gensupport.DecodeResponse(target, res); err != nil { 4133 return nil, err 4134 } 4135 return ret, nil 4136 // { 4137 // "description": "Fetch a certificate signing request (CSR) from a CertificateAuthority that is in state PENDING_ACTIVATION and is of type SUBORDINATE. The CSR must then be signed by the desired parent Certificate Authority, which could be another CertificateAuthority resource, or could be an on-prem certificate authority. See also ActivateCertificateAuthority.", 4138 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:fetch", 4139 // "httpMethod": "GET", 4140 // "id": "privateca.projects.locations.certificateAuthorities.fetch", 4141 // "parameterOrder": [ 4142 // "name" 4143 // ], 4144 // "parameters": { 4145 // "name": { 4146 // "description": "Required. The resource name for this CertificateAuthority in the format `projects/*/locations/*/certificateAuthorities/*`.", 4147 // "location": "path", 4148 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 4149 // "required": true, 4150 // "type": "string" 4151 // } 4152 // }, 4153 // "path": "v1beta1/{+name}:fetch", 4154 // "response": { 4155 // "$ref": "FetchCertificateAuthorityCsrResponse" 4156 // }, 4157 // "scopes": [ 4158 // "https://www.googleapis.com/auth/cloud-platform" 4159 // ] 4160 // } 4161 4162} 4163 4164// method id "privateca.projects.locations.certificateAuthorities.get": 4165 4166type ProjectsLocationsCertificateAuthoritiesGetCall struct { 4167 s *Service 4168 name string 4169 urlParams_ gensupport.URLParams 4170 ifNoneMatch_ string 4171 ctx_ context.Context 4172 header_ http.Header 4173} 4174 4175// Get: Returns a CertificateAuthority. 4176// 4177// - name: The name of the CertificateAuthority to get. 4178func (r *ProjectsLocationsCertificateAuthoritiesService) Get(name string) *ProjectsLocationsCertificateAuthoritiesGetCall { 4179 c := &ProjectsLocationsCertificateAuthoritiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4180 c.name = name 4181 return c 4182} 4183 4184// Fields allows partial responses to be retrieved. See 4185// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4186// for more information. 4187func (c *ProjectsLocationsCertificateAuthoritiesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesGetCall { 4188 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4189 return c 4190} 4191 4192// IfNoneMatch sets the optional parameter which makes the operation 4193// fail if the object's ETag matches the given value. This is useful for 4194// getting updates only after the object has changed since the last 4195// request. Use googleapi.IsNotModified to check whether the response 4196// error from Do is the result of In-None-Match. 4197func (c *ProjectsLocationsCertificateAuthoritiesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesGetCall { 4198 c.ifNoneMatch_ = entityTag 4199 return c 4200} 4201 4202// Context sets the context to be used in this call's Do method. Any 4203// pending HTTP request will be aborted if the provided context is 4204// canceled. 4205func (c *ProjectsLocationsCertificateAuthoritiesGetCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesGetCall { 4206 c.ctx_ = ctx 4207 return c 4208} 4209 4210// Header returns an http.Header that can be modified by the caller to 4211// add HTTP headers to the request. 4212func (c *ProjectsLocationsCertificateAuthoritiesGetCall) Header() http.Header { 4213 if c.header_ == nil { 4214 c.header_ = make(http.Header) 4215 } 4216 return c.header_ 4217} 4218 4219func (c *ProjectsLocationsCertificateAuthoritiesGetCall) doRequest(alt string) (*http.Response, error) { 4220 reqHeaders := make(http.Header) 4221 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4222 for k, v := range c.header_ { 4223 reqHeaders[k] = v 4224 } 4225 reqHeaders.Set("User-Agent", c.s.userAgent()) 4226 if c.ifNoneMatch_ != "" { 4227 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4228 } 4229 var body io.Reader = nil 4230 c.urlParams_.Set("alt", alt) 4231 c.urlParams_.Set("prettyPrint", "false") 4232 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4233 urls += "?" + c.urlParams_.Encode() 4234 req, err := http.NewRequest("GET", urls, body) 4235 if err != nil { 4236 return nil, err 4237 } 4238 req.Header = reqHeaders 4239 googleapi.Expand(req.URL, map[string]string{ 4240 "name": c.name, 4241 }) 4242 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4243} 4244 4245// Do executes the "privateca.projects.locations.certificateAuthorities.get" call. 4246// Exactly one of *CertificateAuthority or error will be non-nil. Any 4247// non-2xx status code is an error. Response headers are in either 4248// *CertificateAuthority.ServerResponse.Header or (if a response was 4249// returned at all) in error.(*googleapi.Error).Header. Use 4250// googleapi.IsNotModified to check whether the returned error was 4251// because http.StatusNotModified was returned. 4252func (c *ProjectsLocationsCertificateAuthoritiesGetCall) Do(opts ...googleapi.CallOption) (*CertificateAuthority, error) { 4253 gensupport.SetOptions(c.urlParams_, opts...) 4254 res, err := c.doRequest("json") 4255 if res != nil && res.StatusCode == http.StatusNotModified { 4256 if res.Body != nil { 4257 res.Body.Close() 4258 } 4259 return nil, &googleapi.Error{ 4260 Code: res.StatusCode, 4261 Header: res.Header, 4262 } 4263 } 4264 if err != nil { 4265 return nil, err 4266 } 4267 defer googleapi.CloseBody(res) 4268 if err := googleapi.CheckResponse(res); err != nil { 4269 return nil, err 4270 } 4271 ret := &CertificateAuthority{ 4272 ServerResponse: googleapi.ServerResponse{ 4273 Header: res.Header, 4274 HTTPStatusCode: res.StatusCode, 4275 }, 4276 } 4277 target := &ret 4278 if err := gensupport.DecodeResponse(target, res); err != nil { 4279 return nil, err 4280 } 4281 return ret, nil 4282 // { 4283 // "description": "Returns a CertificateAuthority.", 4284 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}", 4285 // "httpMethod": "GET", 4286 // "id": "privateca.projects.locations.certificateAuthorities.get", 4287 // "parameterOrder": [ 4288 // "name" 4289 // ], 4290 // "parameters": { 4291 // "name": { 4292 // "description": "Required. The name of the CertificateAuthority to get.", 4293 // "location": "path", 4294 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 4295 // "required": true, 4296 // "type": "string" 4297 // } 4298 // }, 4299 // "path": "v1beta1/{+name}", 4300 // "response": { 4301 // "$ref": "CertificateAuthority" 4302 // }, 4303 // "scopes": [ 4304 // "https://www.googleapis.com/auth/cloud-platform" 4305 // ] 4306 // } 4307 4308} 4309 4310// method id "privateca.projects.locations.certificateAuthorities.getIamPolicy": 4311 4312type ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall struct { 4313 s *Service 4314 resource string 4315 urlParams_ gensupport.URLParams 4316 ifNoneMatch_ string 4317 ctx_ context.Context 4318 header_ http.Header 4319} 4320 4321// GetIamPolicy: Gets the access control policy for a resource. Returns 4322// an empty policy if the resource exists and does not have a policy 4323// set. 4324// 4325// - resource: REQUIRED: The resource for which the policy is being 4326// requested. See the operation documentation for the appropriate 4327// value for this field. 4328func (r *ProjectsLocationsCertificateAuthoritiesService) GetIamPolicy(resource string) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall { 4329 c := &ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4330 c.resource = resource 4331 return c 4332} 4333 4334// OptionsRequestedPolicyVersion sets the optional parameter 4335// "options.requestedPolicyVersion": The policy format version to be 4336// returned. Valid values are 0, 1, and 3. Requests specifying an 4337// invalid value will be rejected. Requests for policies with any 4338// conditional bindings must specify version 3. Policies without any 4339// conditional bindings may specify any valid value or leave the field 4340// unset. To learn which resources support conditions in their IAM 4341// policies, see the IAM documentation 4342// (https://cloud.google.com/iam/help/conditions/resource-policies). 4343func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall { 4344 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 4345 return c 4346} 4347 4348// Fields allows partial responses to be retrieved. See 4349// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4350// for more information. 4351func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall { 4352 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4353 return c 4354} 4355 4356// IfNoneMatch sets the optional parameter which makes the operation 4357// fail if the object's ETag matches the given value. This is useful for 4358// getting updates only after the object has changed since the last 4359// request. Use googleapi.IsNotModified to check whether the response 4360// error from Do is the result of In-None-Match. 4361func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall { 4362 c.ifNoneMatch_ = entityTag 4363 return c 4364} 4365 4366// Context sets the context to be used in this call's Do method. Any 4367// pending HTTP request will be aborted if the provided context is 4368// canceled. 4369func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall { 4370 c.ctx_ = ctx 4371 return c 4372} 4373 4374// Header returns an http.Header that can be modified by the caller to 4375// add HTTP headers to the request. 4376func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Header() http.Header { 4377 if c.header_ == nil { 4378 c.header_ = make(http.Header) 4379 } 4380 return c.header_ 4381} 4382 4383func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 4384 reqHeaders := make(http.Header) 4385 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4386 for k, v := range c.header_ { 4387 reqHeaders[k] = v 4388 } 4389 reqHeaders.Set("User-Agent", c.s.userAgent()) 4390 if c.ifNoneMatch_ != "" { 4391 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4392 } 4393 var body io.Reader = nil 4394 c.urlParams_.Set("alt", alt) 4395 c.urlParams_.Set("prettyPrint", "false") 4396 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") 4397 urls += "?" + c.urlParams_.Encode() 4398 req, err := http.NewRequest("GET", urls, body) 4399 if err != nil { 4400 return nil, err 4401 } 4402 req.Header = reqHeaders 4403 googleapi.Expand(req.URL, map[string]string{ 4404 "resource": c.resource, 4405 }) 4406 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4407} 4408 4409// Do executes the "privateca.projects.locations.certificateAuthorities.getIamPolicy" call. 4410// Exactly one of *Policy or error will be non-nil. Any non-2xx status 4411// code is an error. Response headers are in either 4412// *Policy.ServerResponse.Header or (if a response was returned at all) 4413// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4414// check whether the returned error was because http.StatusNotModified 4415// was returned. 4416func (c *ProjectsLocationsCertificateAuthoritiesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 4417 gensupport.SetOptions(c.urlParams_, opts...) 4418 res, err := c.doRequest("json") 4419 if res != nil && res.StatusCode == http.StatusNotModified { 4420 if res.Body != nil { 4421 res.Body.Close() 4422 } 4423 return nil, &googleapi.Error{ 4424 Code: res.StatusCode, 4425 Header: res.Header, 4426 } 4427 } 4428 if err != nil { 4429 return nil, err 4430 } 4431 defer googleapi.CloseBody(res) 4432 if err := googleapi.CheckResponse(res); err != nil { 4433 return nil, err 4434 } 4435 ret := &Policy{ 4436 ServerResponse: googleapi.ServerResponse{ 4437 Header: res.Header, 4438 HTTPStatusCode: res.StatusCode, 4439 }, 4440 } 4441 target := &ret 4442 if err := gensupport.DecodeResponse(target, res); err != nil { 4443 return nil, err 4444 } 4445 return ret, nil 4446 // { 4447 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 4448 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:getIamPolicy", 4449 // "httpMethod": "GET", 4450 // "id": "privateca.projects.locations.certificateAuthorities.getIamPolicy", 4451 // "parameterOrder": [ 4452 // "resource" 4453 // ], 4454 // "parameters": { 4455 // "options.requestedPolicyVersion": { 4456 // "description": "Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", 4457 // "format": "int32", 4458 // "location": "query", 4459 // "type": "integer" 4460 // }, 4461 // "resource": { 4462 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 4463 // "location": "path", 4464 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 4465 // "required": true, 4466 // "type": "string" 4467 // } 4468 // }, 4469 // "path": "v1beta1/{+resource}:getIamPolicy", 4470 // "response": { 4471 // "$ref": "Policy" 4472 // }, 4473 // "scopes": [ 4474 // "https://www.googleapis.com/auth/cloud-platform" 4475 // ] 4476 // } 4477 4478} 4479 4480// method id "privateca.projects.locations.certificateAuthorities.list": 4481 4482type ProjectsLocationsCertificateAuthoritiesListCall struct { 4483 s *Service 4484 parent string 4485 urlParams_ gensupport.URLParams 4486 ifNoneMatch_ string 4487 ctx_ context.Context 4488 header_ http.Header 4489} 4490 4491// List: Lists CertificateAuthorities. 4492// 4493// - parent: The resource name of the location associated with the 4494// CertificateAuthorities, in the format `projects/*/locations/*`. 4495func (r *ProjectsLocationsCertificateAuthoritiesService) List(parent string) *ProjectsLocationsCertificateAuthoritiesListCall { 4496 c := &ProjectsLocationsCertificateAuthoritiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4497 c.parent = parent 4498 return c 4499} 4500 4501// Filter sets the optional parameter "filter": Only include resources 4502// that match the filter in the response. 4503func (c *ProjectsLocationsCertificateAuthoritiesListCall) Filter(filter string) *ProjectsLocationsCertificateAuthoritiesListCall { 4504 c.urlParams_.Set("filter", filter) 4505 return c 4506} 4507 4508// OrderBy sets the optional parameter "orderBy": Specify how the 4509// results should be sorted. 4510func (c *ProjectsLocationsCertificateAuthoritiesListCall) OrderBy(orderBy string) *ProjectsLocationsCertificateAuthoritiesListCall { 4511 c.urlParams_.Set("orderBy", orderBy) 4512 return c 4513} 4514 4515// PageSize sets the optional parameter "pageSize": Limit on the number 4516// of CertificateAuthorities to include in the response. Further 4517// CertificateAuthorities can subsequently be obtained by including the 4518// ListCertificateAuthoritiesResponse.next_page_token in a subsequent 4519// request. If unspecified, the server will pick an appropriate default. 4520func (c *ProjectsLocationsCertificateAuthoritiesListCall) PageSize(pageSize int64) *ProjectsLocationsCertificateAuthoritiesListCall { 4521 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4522 return c 4523} 4524 4525// PageToken sets the optional parameter "pageToken": Pagination token, 4526// returned earlier via 4527// ListCertificateAuthoritiesResponse.next_page_token. 4528func (c *ProjectsLocationsCertificateAuthoritiesListCall) PageToken(pageToken string) *ProjectsLocationsCertificateAuthoritiesListCall { 4529 c.urlParams_.Set("pageToken", pageToken) 4530 return c 4531} 4532 4533// Fields allows partial responses to be retrieved. See 4534// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4535// for more information. 4536func (c *ProjectsLocationsCertificateAuthoritiesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesListCall { 4537 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4538 return c 4539} 4540 4541// IfNoneMatch sets the optional parameter which makes the operation 4542// fail if the object's ETag matches the given value. This is useful for 4543// getting updates only after the object has changed since the last 4544// request. Use googleapi.IsNotModified to check whether the response 4545// error from Do is the result of In-None-Match. 4546func (c *ProjectsLocationsCertificateAuthoritiesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesListCall { 4547 c.ifNoneMatch_ = entityTag 4548 return c 4549} 4550 4551// Context sets the context to be used in this call's Do method. Any 4552// pending HTTP request will be aborted if the provided context is 4553// canceled. 4554func (c *ProjectsLocationsCertificateAuthoritiesListCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesListCall { 4555 c.ctx_ = ctx 4556 return c 4557} 4558 4559// Header returns an http.Header that can be modified by the caller to 4560// add HTTP headers to the request. 4561func (c *ProjectsLocationsCertificateAuthoritiesListCall) Header() http.Header { 4562 if c.header_ == nil { 4563 c.header_ = make(http.Header) 4564 } 4565 return c.header_ 4566} 4567 4568func (c *ProjectsLocationsCertificateAuthoritiesListCall) doRequest(alt string) (*http.Response, error) { 4569 reqHeaders := make(http.Header) 4570 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4571 for k, v := range c.header_ { 4572 reqHeaders[k] = v 4573 } 4574 reqHeaders.Set("User-Agent", c.s.userAgent()) 4575 if c.ifNoneMatch_ != "" { 4576 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4577 } 4578 var body io.Reader = nil 4579 c.urlParams_.Set("alt", alt) 4580 c.urlParams_.Set("prettyPrint", "false") 4581 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/certificateAuthorities") 4582 urls += "?" + c.urlParams_.Encode() 4583 req, err := http.NewRequest("GET", urls, body) 4584 if err != nil { 4585 return nil, err 4586 } 4587 req.Header = reqHeaders 4588 googleapi.Expand(req.URL, map[string]string{ 4589 "parent": c.parent, 4590 }) 4591 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4592} 4593 4594// Do executes the "privateca.projects.locations.certificateAuthorities.list" call. 4595// Exactly one of *ListCertificateAuthoritiesResponse or error will be 4596// non-nil. Any non-2xx status code is an error. Response headers are in 4597// either *ListCertificateAuthoritiesResponse.ServerResponse.Header or 4598// (if a response was returned at all) in 4599// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4600// whether the returned error was because http.StatusNotModified was 4601// returned. 4602func (c *ProjectsLocationsCertificateAuthoritiesListCall) Do(opts ...googleapi.CallOption) (*ListCertificateAuthoritiesResponse, error) { 4603 gensupport.SetOptions(c.urlParams_, opts...) 4604 res, err := c.doRequest("json") 4605 if res != nil && res.StatusCode == http.StatusNotModified { 4606 if res.Body != nil { 4607 res.Body.Close() 4608 } 4609 return nil, &googleapi.Error{ 4610 Code: res.StatusCode, 4611 Header: res.Header, 4612 } 4613 } 4614 if err != nil { 4615 return nil, err 4616 } 4617 defer googleapi.CloseBody(res) 4618 if err := googleapi.CheckResponse(res); err != nil { 4619 return nil, err 4620 } 4621 ret := &ListCertificateAuthoritiesResponse{ 4622 ServerResponse: googleapi.ServerResponse{ 4623 Header: res.Header, 4624 HTTPStatusCode: res.StatusCode, 4625 }, 4626 } 4627 target := &ret 4628 if err := gensupport.DecodeResponse(target, res); err != nil { 4629 return nil, err 4630 } 4631 return ret, nil 4632 // { 4633 // "description": "Lists CertificateAuthorities.", 4634 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities", 4635 // "httpMethod": "GET", 4636 // "id": "privateca.projects.locations.certificateAuthorities.list", 4637 // "parameterOrder": [ 4638 // "parent" 4639 // ], 4640 // "parameters": { 4641 // "filter": { 4642 // "description": "Optional. Only include resources that match the filter in the response.", 4643 // "location": "query", 4644 // "type": "string" 4645 // }, 4646 // "orderBy": { 4647 // "description": "Optional. Specify how the results should be sorted.", 4648 // "location": "query", 4649 // "type": "string" 4650 // }, 4651 // "pageSize": { 4652 // "description": "Optional. Limit on the number of CertificateAuthorities to include in the response. Further CertificateAuthorities can subsequently be obtained by including the ListCertificateAuthoritiesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.", 4653 // "format": "int32", 4654 // "location": "query", 4655 // "type": "integer" 4656 // }, 4657 // "pageToken": { 4658 // "description": "Optional. Pagination token, returned earlier via ListCertificateAuthoritiesResponse.next_page_token.", 4659 // "location": "query", 4660 // "type": "string" 4661 // }, 4662 // "parent": { 4663 // "description": "Required. The resource name of the location associated with the CertificateAuthorities, in the format `projects/*/locations/*`.", 4664 // "location": "path", 4665 // "pattern": "^projects/[^/]+/locations/[^/]+$", 4666 // "required": true, 4667 // "type": "string" 4668 // } 4669 // }, 4670 // "path": "v1beta1/{+parent}/certificateAuthorities", 4671 // "response": { 4672 // "$ref": "ListCertificateAuthoritiesResponse" 4673 // }, 4674 // "scopes": [ 4675 // "https://www.googleapis.com/auth/cloud-platform" 4676 // ] 4677 // } 4678 4679} 4680 4681// Pages invokes f for each page of results. 4682// A non-nil error returned from f will halt the iteration. 4683// The provided context supersedes any context provided to the Context method. 4684func (c *ProjectsLocationsCertificateAuthoritiesListCall) Pages(ctx context.Context, f func(*ListCertificateAuthoritiesResponse) error) error { 4685 c.ctx_ = ctx 4686 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4687 for { 4688 x, err := c.Do() 4689 if err != nil { 4690 return err 4691 } 4692 if err := f(x); err != nil { 4693 return err 4694 } 4695 if x.NextPageToken == "" { 4696 return nil 4697 } 4698 c.PageToken(x.NextPageToken) 4699 } 4700} 4701 4702// method id "privateca.projects.locations.certificateAuthorities.patch": 4703 4704type ProjectsLocationsCertificateAuthoritiesPatchCall struct { 4705 s *Service 4706 name string 4707 certificateauthority *CertificateAuthority 4708 urlParams_ gensupport.URLParams 4709 ctx_ context.Context 4710 header_ http.Header 4711} 4712 4713// Patch: Update a CertificateAuthority. 4714// 4715// - name: Output only. The resource name for this CertificateAuthority 4716// in the format `projects/*/locations/*/certificateAuthorities/*`. 4717func (r *ProjectsLocationsCertificateAuthoritiesService) Patch(name string, certificateauthority *CertificateAuthority) *ProjectsLocationsCertificateAuthoritiesPatchCall { 4718 c := &ProjectsLocationsCertificateAuthoritiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4719 c.name = name 4720 c.certificateauthority = certificateauthority 4721 return c 4722} 4723 4724// RequestId sets the optional parameter "requestId": An ID to identify 4725// requests. Specify a unique request ID so that if you must retry your 4726// request, the server will know to ignore the request if it has already 4727// been completed. The server will guarantee that for at least 60 4728// minutes since the first request. For example, consider a situation 4729// where you make an initial request and t he request times out. If you 4730// make the request again with the same request ID, the server can check 4731// if original operation with the same request ID was received, and if 4732// so, will ignore the second request. This prevents clients from 4733// accidentally creating duplicate commitments. The request ID must be a 4734// valid UUID with the exception that zero UUID is not supported 4735// (00000000-0000-0000-0000-000000000000). 4736func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) RequestId(requestId string) *ProjectsLocationsCertificateAuthoritiesPatchCall { 4737 c.urlParams_.Set("requestId", requestId) 4738 return c 4739} 4740 4741// UpdateMask sets the optional parameter "updateMask": Required. A list 4742// of fields to be updated in this request. 4743func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCertificateAuthoritiesPatchCall { 4744 c.urlParams_.Set("updateMask", updateMask) 4745 return c 4746} 4747 4748// Fields allows partial responses to be retrieved. See 4749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4750// for more information. 4751func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesPatchCall { 4752 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4753 return c 4754} 4755 4756// Context sets the context to be used in this call's Do method. Any 4757// pending HTTP request will be aborted if the provided context is 4758// canceled. 4759func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesPatchCall { 4760 c.ctx_ = ctx 4761 return c 4762} 4763 4764// Header returns an http.Header that can be modified by the caller to 4765// add HTTP headers to the request. 4766func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) Header() http.Header { 4767 if c.header_ == nil { 4768 c.header_ = make(http.Header) 4769 } 4770 return c.header_ 4771} 4772 4773func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) doRequest(alt string) (*http.Response, error) { 4774 reqHeaders := make(http.Header) 4775 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4776 for k, v := range c.header_ { 4777 reqHeaders[k] = v 4778 } 4779 reqHeaders.Set("User-Agent", c.s.userAgent()) 4780 var body io.Reader = nil 4781 body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificateauthority) 4782 if err != nil { 4783 return nil, err 4784 } 4785 reqHeaders.Set("Content-Type", "application/json") 4786 c.urlParams_.Set("alt", alt) 4787 c.urlParams_.Set("prettyPrint", "false") 4788 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4789 urls += "?" + c.urlParams_.Encode() 4790 req, err := http.NewRequest("PATCH", urls, body) 4791 if err != nil { 4792 return nil, err 4793 } 4794 req.Header = reqHeaders 4795 googleapi.Expand(req.URL, map[string]string{ 4796 "name": c.name, 4797 }) 4798 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4799} 4800 4801// Do executes the "privateca.projects.locations.certificateAuthorities.patch" call. 4802// Exactly one of *Operation or error will be non-nil. Any non-2xx 4803// status code is an error. Response headers are in either 4804// *Operation.ServerResponse.Header or (if a response was returned at 4805// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4806// to check whether the returned error was because 4807// http.StatusNotModified was returned. 4808func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4809 gensupport.SetOptions(c.urlParams_, opts...) 4810 res, err := c.doRequest("json") 4811 if res != nil && res.StatusCode == http.StatusNotModified { 4812 if res.Body != nil { 4813 res.Body.Close() 4814 } 4815 return nil, &googleapi.Error{ 4816 Code: res.StatusCode, 4817 Header: res.Header, 4818 } 4819 } 4820 if err != nil { 4821 return nil, err 4822 } 4823 defer googleapi.CloseBody(res) 4824 if err := googleapi.CheckResponse(res); err != nil { 4825 return nil, err 4826 } 4827 ret := &Operation{ 4828 ServerResponse: googleapi.ServerResponse{ 4829 Header: res.Header, 4830 HTTPStatusCode: res.StatusCode, 4831 }, 4832 } 4833 target := &ret 4834 if err := gensupport.DecodeResponse(target, res); err != nil { 4835 return nil, err 4836 } 4837 return ret, nil 4838 // { 4839 // "description": "Update a CertificateAuthority.", 4840 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}", 4841 // "httpMethod": "PATCH", 4842 // "id": "privateca.projects.locations.certificateAuthorities.patch", 4843 // "parameterOrder": [ 4844 // "name" 4845 // ], 4846 // "parameters": { 4847 // "name": { 4848 // "description": "Output only. The resource name for this CertificateAuthority in the format `projects/*/locations/*/certificateAuthorities/*`.", 4849 // "location": "path", 4850 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 4851 // "required": true, 4852 // "type": "string" 4853 // }, 4854 // "requestId": { 4855 // "description": "Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", 4856 // "location": "query", 4857 // "type": "string" 4858 // }, 4859 // "updateMask": { 4860 // "description": "Required. A list of fields to be updated in this request.", 4861 // "format": "google-fieldmask", 4862 // "location": "query", 4863 // "type": "string" 4864 // } 4865 // }, 4866 // "path": "v1beta1/{+name}", 4867 // "request": { 4868 // "$ref": "CertificateAuthority" 4869 // }, 4870 // "response": { 4871 // "$ref": "Operation" 4872 // }, 4873 // "scopes": [ 4874 // "https://www.googleapis.com/auth/cloud-platform" 4875 // ] 4876 // } 4877 4878} 4879 4880// method id "privateca.projects.locations.certificateAuthorities.restore": 4881 4882type ProjectsLocationsCertificateAuthoritiesRestoreCall struct { 4883 s *Service 4884 name string 4885 restorecertificateauthorityrequest *RestoreCertificateAuthorityRequest 4886 urlParams_ gensupport.URLParams 4887 ctx_ context.Context 4888 header_ http.Header 4889} 4890 4891// Restore: Restore a CertificateAuthority that is scheduled for 4892// deletion. 4893// 4894// - name: The resource name for this CertificateAuthority in the format 4895// `projects/*/locations/*/certificateAuthorities/*`. 4896func (r *ProjectsLocationsCertificateAuthoritiesService) Restore(name string, restorecertificateauthorityrequest *RestoreCertificateAuthorityRequest) *ProjectsLocationsCertificateAuthoritiesRestoreCall { 4897 c := &ProjectsLocationsCertificateAuthoritiesRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4898 c.name = name 4899 c.restorecertificateauthorityrequest = restorecertificateauthorityrequest 4900 return c 4901} 4902 4903// Fields allows partial responses to be retrieved. See 4904// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4905// for more information. 4906func (c *ProjectsLocationsCertificateAuthoritiesRestoreCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesRestoreCall { 4907 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4908 return c 4909} 4910 4911// Context sets the context to be used in this call's Do method. Any 4912// pending HTTP request will be aborted if the provided context is 4913// canceled. 4914func (c *ProjectsLocationsCertificateAuthoritiesRestoreCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesRestoreCall { 4915 c.ctx_ = ctx 4916 return c 4917} 4918 4919// Header returns an http.Header that can be modified by the caller to 4920// add HTTP headers to the request. 4921func (c *ProjectsLocationsCertificateAuthoritiesRestoreCall) Header() http.Header { 4922 if c.header_ == nil { 4923 c.header_ = make(http.Header) 4924 } 4925 return c.header_ 4926} 4927 4928func (c *ProjectsLocationsCertificateAuthoritiesRestoreCall) doRequest(alt string) (*http.Response, error) { 4929 reqHeaders := make(http.Header) 4930 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4931 for k, v := range c.header_ { 4932 reqHeaders[k] = v 4933 } 4934 reqHeaders.Set("User-Agent", c.s.userAgent()) 4935 var body io.Reader = nil 4936 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restorecertificateauthorityrequest) 4937 if err != nil { 4938 return nil, err 4939 } 4940 reqHeaders.Set("Content-Type", "application/json") 4941 c.urlParams_.Set("alt", alt) 4942 c.urlParams_.Set("prettyPrint", "false") 4943 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:restore") 4944 urls += "?" + c.urlParams_.Encode() 4945 req, err := http.NewRequest("POST", urls, body) 4946 if err != nil { 4947 return nil, err 4948 } 4949 req.Header = reqHeaders 4950 googleapi.Expand(req.URL, map[string]string{ 4951 "name": c.name, 4952 }) 4953 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4954} 4955 4956// Do executes the "privateca.projects.locations.certificateAuthorities.restore" call. 4957// Exactly one of *Operation or error will be non-nil. Any non-2xx 4958// status code is an error. Response headers are in either 4959// *Operation.ServerResponse.Header or (if a response was returned at 4960// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4961// to check whether the returned error was because 4962// http.StatusNotModified was returned. 4963func (c *ProjectsLocationsCertificateAuthoritiesRestoreCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4964 gensupport.SetOptions(c.urlParams_, opts...) 4965 res, err := c.doRequest("json") 4966 if res != nil && res.StatusCode == http.StatusNotModified { 4967 if res.Body != nil { 4968 res.Body.Close() 4969 } 4970 return nil, &googleapi.Error{ 4971 Code: res.StatusCode, 4972 Header: res.Header, 4973 } 4974 } 4975 if err != nil { 4976 return nil, err 4977 } 4978 defer googleapi.CloseBody(res) 4979 if err := googleapi.CheckResponse(res); err != nil { 4980 return nil, err 4981 } 4982 ret := &Operation{ 4983 ServerResponse: googleapi.ServerResponse{ 4984 Header: res.Header, 4985 HTTPStatusCode: res.StatusCode, 4986 }, 4987 } 4988 target := &ret 4989 if err := gensupport.DecodeResponse(target, res); err != nil { 4990 return nil, err 4991 } 4992 return ret, nil 4993 // { 4994 // "description": "Restore a CertificateAuthority that is scheduled for deletion.", 4995 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:restore", 4996 // "httpMethod": "POST", 4997 // "id": "privateca.projects.locations.certificateAuthorities.restore", 4998 // "parameterOrder": [ 4999 // "name" 5000 // ], 5001 // "parameters": { 5002 // "name": { 5003 // "description": "Required. The resource name for this CertificateAuthority in the format `projects/*/locations/*/certificateAuthorities/*`.", 5004 // "location": "path", 5005 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 5006 // "required": true, 5007 // "type": "string" 5008 // } 5009 // }, 5010 // "path": "v1beta1/{+name}:restore", 5011 // "request": { 5012 // "$ref": "RestoreCertificateAuthorityRequest" 5013 // }, 5014 // "response": { 5015 // "$ref": "Operation" 5016 // }, 5017 // "scopes": [ 5018 // "https://www.googleapis.com/auth/cloud-platform" 5019 // ] 5020 // } 5021 5022} 5023 5024// method id "privateca.projects.locations.certificateAuthorities.scheduleDelete": 5025 5026type ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall struct { 5027 s *Service 5028 name string 5029 scheduledeletecertificateauthorityrequest *ScheduleDeleteCertificateAuthorityRequest 5030 urlParams_ gensupport.URLParams 5031 ctx_ context.Context 5032 header_ http.Header 5033} 5034 5035// ScheduleDelete: Schedule a CertificateAuthority for deletion. 5036// 5037// - name: The resource name for this CertificateAuthority in the format 5038// `projects/*/locations/*/certificateAuthorities/*`. 5039func (r *ProjectsLocationsCertificateAuthoritiesService) ScheduleDelete(name string, scheduledeletecertificateauthorityrequest *ScheduleDeleteCertificateAuthorityRequest) *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall { 5040 c := &ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5041 c.name = name 5042 c.scheduledeletecertificateauthorityrequest = scheduledeletecertificateauthorityrequest 5043 return c 5044} 5045 5046// Fields allows partial responses to be retrieved. See 5047// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5048// for more information. 5049func (c *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall { 5050 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5051 return c 5052} 5053 5054// Context sets the context to be used in this call's Do method. Any 5055// pending HTTP request will be aborted if the provided context is 5056// canceled. 5057func (c *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall { 5058 c.ctx_ = ctx 5059 return c 5060} 5061 5062// Header returns an http.Header that can be modified by the caller to 5063// add HTTP headers to the request. 5064func (c *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall) Header() http.Header { 5065 if c.header_ == nil { 5066 c.header_ = make(http.Header) 5067 } 5068 return c.header_ 5069} 5070 5071func (c *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall) doRequest(alt string) (*http.Response, error) { 5072 reqHeaders := make(http.Header) 5073 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5074 for k, v := range c.header_ { 5075 reqHeaders[k] = v 5076 } 5077 reqHeaders.Set("User-Agent", c.s.userAgent()) 5078 var body io.Reader = nil 5079 body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduledeletecertificateauthorityrequest) 5080 if err != nil { 5081 return nil, err 5082 } 5083 reqHeaders.Set("Content-Type", "application/json") 5084 c.urlParams_.Set("alt", alt) 5085 c.urlParams_.Set("prettyPrint", "false") 5086 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:scheduleDelete") 5087 urls += "?" + c.urlParams_.Encode() 5088 req, err := http.NewRequest("POST", urls, body) 5089 if err != nil { 5090 return nil, err 5091 } 5092 req.Header = reqHeaders 5093 googleapi.Expand(req.URL, map[string]string{ 5094 "name": c.name, 5095 }) 5096 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5097} 5098 5099// Do executes the "privateca.projects.locations.certificateAuthorities.scheduleDelete" call. 5100// Exactly one of *Operation or error will be non-nil. Any non-2xx 5101// status code is an error. Response headers are in either 5102// *Operation.ServerResponse.Header or (if a response was returned at 5103// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5104// to check whether the returned error was because 5105// http.StatusNotModified was returned. 5106func (c *ProjectsLocationsCertificateAuthoritiesScheduleDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5107 gensupport.SetOptions(c.urlParams_, opts...) 5108 res, err := c.doRequest("json") 5109 if res != nil && res.StatusCode == http.StatusNotModified { 5110 if res.Body != nil { 5111 res.Body.Close() 5112 } 5113 return nil, &googleapi.Error{ 5114 Code: res.StatusCode, 5115 Header: res.Header, 5116 } 5117 } 5118 if err != nil { 5119 return nil, err 5120 } 5121 defer googleapi.CloseBody(res) 5122 if err := googleapi.CheckResponse(res); err != nil { 5123 return nil, err 5124 } 5125 ret := &Operation{ 5126 ServerResponse: googleapi.ServerResponse{ 5127 Header: res.Header, 5128 HTTPStatusCode: res.StatusCode, 5129 }, 5130 } 5131 target := &ret 5132 if err := gensupport.DecodeResponse(target, res); err != nil { 5133 return nil, err 5134 } 5135 return ret, nil 5136 // { 5137 // "description": "Schedule a CertificateAuthority for deletion.", 5138 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:scheduleDelete", 5139 // "httpMethod": "POST", 5140 // "id": "privateca.projects.locations.certificateAuthorities.scheduleDelete", 5141 // "parameterOrder": [ 5142 // "name" 5143 // ], 5144 // "parameters": { 5145 // "name": { 5146 // "description": "Required. The resource name for this CertificateAuthority in the format `projects/*/locations/*/certificateAuthorities/*`.", 5147 // "location": "path", 5148 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 5149 // "required": true, 5150 // "type": "string" 5151 // } 5152 // }, 5153 // "path": "v1beta1/{+name}:scheduleDelete", 5154 // "request": { 5155 // "$ref": "ScheduleDeleteCertificateAuthorityRequest" 5156 // }, 5157 // "response": { 5158 // "$ref": "Operation" 5159 // }, 5160 // "scopes": [ 5161 // "https://www.googleapis.com/auth/cloud-platform" 5162 // ] 5163 // } 5164 5165} 5166 5167// method id "privateca.projects.locations.certificateAuthorities.setIamPolicy": 5168 5169type ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall struct { 5170 s *Service 5171 resource string 5172 setiampolicyrequest *SetIamPolicyRequest 5173 urlParams_ gensupport.URLParams 5174 ctx_ context.Context 5175 header_ http.Header 5176} 5177 5178// SetIamPolicy: Sets the access control policy on the specified 5179// resource. Replaces any existing policy. Can return `NOT_FOUND`, 5180// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. 5181// 5182// - resource: REQUIRED: The resource for which the policy is being 5183// specified. See the operation documentation for the appropriate 5184// value for this field. 5185func (r *ProjectsLocationsCertificateAuthoritiesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall { 5186 c := &ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5187 c.resource = resource 5188 c.setiampolicyrequest = setiampolicyrequest 5189 return c 5190} 5191 5192// Fields allows partial responses to be retrieved. See 5193// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5194// for more information. 5195func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall { 5196 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5197 return c 5198} 5199 5200// Context sets the context to be used in this call's Do method. Any 5201// pending HTTP request will be aborted if the provided context is 5202// canceled. 5203func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall { 5204 c.ctx_ = ctx 5205 return c 5206} 5207 5208// Header returns an http.Header that can be modified by the caller to 5209// add HTTP headers to the request. 5210func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Header() http.Header { 5211 if c.header_ == nil { 5212 c.header_ = make(http.Header) 5213 } 5214 return c.header_ 5215} 5216 5217func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5218 reqHeaders := make(http.Header) 5219 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5220 for k, v := range c.header_ { 5221 reqHeaders[k] = v 5222 } 5223 reqHeaders.Set("User-Agent", c.s.userAgent()) 5224 var body io.Reader = nil 5225 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 5226 if err != nil { 5227 return nil, err 5228 } 5229 reqHeaders.Set("Content-Type", "application/json") 5230 c.urlParams_.Set("alt", alt) 5231 c.urlParams_.Set("prettyPrint", "false") 5232 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") 5233 urls += "?" + c.urlParams_.Encode() 5234 req, err := http.NewRequest("POST", urls, body) 5235 if err != nil { 5236 return nil, err 5237 } 5238 req.Header = reqHeaders 5239 googleapi.Expand(req.URL, map[string]string{ 5240 "resource": c.resource, 5241 }) 5242 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5243} 5244 5245// Do executes the "privateca.projects.locations.certificateAuthorities.setIamPolicy" call. 5246// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5247// code is an error. Response headers are in either 5248// *Policy.ServerResponse.Header or (if a response was returned at all) 5249// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5250// check whether the returned error was because http.StatusNotModified 5251// was returned. 5252func (c *ProjectsLocationsCertificateAuthoritiesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5253 gensupport.SetOptions(c.urlParams_, opts...) 5254 res, err := c.doRequest("json") 5255 if res != nil && res.StatusCode == http.StatusNotModified { 5256 if res.Body != nil { 5257 res.Body.Close() 5258 } 5259 return nil, &googleapi.Error{ 5260 Code: res.StatusCode, 5261 Header: res.Header, 5262 } 5263 } 5264 if err != nil { 5265 return nil, err 5266 } 5267 defer googleapi.CloseBody(res) 5268 if err := googleapi.CheckResponse(res); err != nil { 5269 return nil, err 5270 } 5271 ret := &Policy{ 5272 ServerResponse: googleapi.ServerResponse{ 5273 Header: res.Header, 5274 HTTPStatusCode: res.StatusCode, 5275 }, 5276 } 5277 target := &ret 5278 if err := gensupport.DecodeResponse(target, res); err != nil { 5279 return nil, err 5280 } 5281 return ret, nil 5282 // { 5283 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", 5284 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:setIamPolicy", 5285 // "httpMethod": "POST", 5286 // "id": "privateca.projects.locations.certificateAuthorities.setIamPolicy", 5287 // "parameterOrder": [ 5288 // "resource" 5289 // ], 5290 // "parameters": { 5291 // "resource": { 5292 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 5293 // "location": "path", 5294 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 5295 // "required": true, 5296 // "type": "string" 5297 // } 5298 // }, 5299 // "path": "v1beta1/{+resource}:setIamPolicy", 5300 // "request": { 5301 // "$ref": "SetIamPolicyRequest" 5302 // }, 5303 // "response": { 5304 // "$ref": "Policy" 5305 // }, 5306 // "scopes": [ 5307 // "https://www.googleapis.com/auth/cloud-platform" 5308 // ] 5309 // } 5310 5311} 5312 5313// method id "privateca.projects.locations.certificateAuthorities.testIamPermissions": 5314 5315type ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall struct { 5316 s *Service 5317 resource string 5318 testiampermissionsrequest *TestIamPermissionsRequest 5319 urlParams_ gensupport.URLParams 5320 ctx_ context.Context 5321 header_ http.Header 5322} 5323 5324// TestIamPermissions: Returns permissions that a caller has on the 5325// specified resource. If the resource does not exist, this will return 5326// an empty set of permissions, not a `NOT_FOUND` error. Note: This 5327// operation is designed to be used for building permission-aware UIs 5328// and command-line tools, not for authorization checking. This 5329// operation may "fail open" without warning. 5330// 5331// - resource: REQUIRED: The resource for which the policy detail is 5332// being requested. See the operation documentation for the 5333// appropriate value for this field. 5334func (r *ProjectsLocationsCertificateAuthoritiesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall { 5335 c := &ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5336 c.resource = resource 5337 c.testiampermissionsrequest = testiampermissionsrequest 5338 return c 5339} 5340 5341// Fields allows partial responses to be retrieved. See 5342// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5343// for more information. 5344func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall { 5345 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5346 return c 5347} 5348 5349// Context sets the context to be used in this call's Do method. Any 5350// pending HTTP request will be aborted if the provided context is 5351// canceled. 5352func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall { 5353 c.ctx_ = ctx 5354 return c 5355} 5356 5357// Header returns an http.Header that can be modified by the caller to 5358// add HTTP headers to the request. 5359func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Header() http.Header { 5360 if c.header_ == nil { 5361 c.header_ = make(http.Header) 5362 } 5363 return c.header_ 5364} 5365 5366func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 5367 reqHeaders := make(http.Header) 5368 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5369 for k, v := range c.header_ { 5370 reqHeaders[k] = v 5371 } 5372 reqHeaders.Set("User-Agent", c.s.userAgent()) 5373 var body io.Reader = nil 5374 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 5375 if err != nil { 5376 return nil, err 5377 } 5378 reqHeaders.Set("Content-Type", "application/json") 5379 c.urlParams_.Set("alt", alt) 5380 c.urlParams_.Set("prettyPrint", "false") 5381 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") 5382 urls += "?" + c.urlParams_.Encode() 5383 req, err := http.NewRequest("POST", urls, body) 5384 if err != nil { 5385 return nil, err 5386 } 5387 req.Header = reqHeaders 5388 googleapi.Expand(req.URL, map[string]string{ 5389 "resource": c.resource, 5390 }) 5391 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5392} 5393 5394// Do executes the "privateca.projects.locations.certificateAuthorities.testIamPermissions" call. 5395// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 5396// Any non-2xx status code is an error. Response headers are in either 5397// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 5398// was returned at all) in error.(*googleapi.Error).Header. Use 5399// googleapi.IsNotModified to check whether the returned error was 5400// because http.StatusNotModified was returned. 5401func (c *ProjectsLocationsCertificateAuthoritiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 5402 gensupport.SetOptions(c.urlParams_, opts...) 5403 res, err := c.doRequest("json") 5404 if res != nil && res.StatusCode == http.StatusNotModified { 5405 if res.Body != nil { 5406 res.Body.Close() 5407 } 5408 return nil, &googleapi.Error{ 5409 Code: res.StatusCode, 5410 Header: res.Header, 5411 } 5412 } 5413 if err != nil { 5414 return nil, err 5415 } 5416 defer googleapi.CloseBody(res) 5417 if err := googleapi.CheckResponse(res); err != nil { 5418 return nil, err 5419 } 5420 ret := &TestIamPermissionsResponse{ 5421 ServerResponse: googleapi.ServerResponse{ 5422 Header: res.Header, 5423 HTTPStatusCode: res.StatusCode, 5424 }, 5425 } 5426 target := &ret 5427 if err := gensupport.DecodeResponse(target, res); err != nil { 5428 return nil, err 5429 } 5430 return ret, nil 5431 // { 5432 // "description": "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. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 5433 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}:testIamPermissions", 5434 // "httpMethod": "POST", 5435 // "id": "privateca.projects.locations.certificateAuthorities.testIamPermissions", 5436 // "parameterOrder": [ 5437 // "resource" 5438 // ], 5439 // "parameters": { 5440 // "resource": { 5441 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 5442 // "location": "path", 5443 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 5444 // "required": true, 5445 // "type": "string" 5446 // } 5447 // }, 5448 // "path": "v1beta1/{+resource}:testIamPermissions", 5449 // "request": { 5450 // "$ref": "TestIamPermissionsRequest" 5451 // }, 5452 // "response": { 5453 // "$ref": "TestIamPermissionsResponse" 5454 // }, 5455 // "scopes": [ 5456 // "https://www.googleapis.com/auth/cloud-platform" 5457 // ] 5458 // } 5459 5460} 5461 5462// method id "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.get": 5463 5464type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall struct { 5465 s *Service 5466 name string 5467 urlParams_ gensupport.URLParams 5468 ifNoneMatch_ string 5469 ctx_ context.Context 5470 header_ http.Header 5471} 5472 5473// Get: Returns a CertificateRevocationList. 5474// 5475// - name: The name of the CertificateRevocationList to get. 5476func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) Get(name string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall { 5477 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5478 c.name = name 5479 return c 5480} 5481 5482// Fields allows partial responses to be retrieved. See 5483// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5484// for more information. 5485func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall { 5486 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5487 return c 5488} 5489 5490// IfNoneMatch sets the optional parameter which makes the operation 5491// fail if the object's ETag matches the given value. This is useful for 5492// getting updates only after the object has changed since the last 5493// request. Use googleapi.IsNotModified to check whether the response 5494// error from Do is the result of In-None-Match. 5495func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall { 5496 c.ifNoneMatch_ = entityTag 5497 return c 5498} 5499 5500// Context sets the context to be used in this call's Do method. Any 5501// pending HTTP request will be aborted if the provided context is 5502// canceled. 5503func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall { 5504 c.ctx_ = ctx 5505 return c 5506} 5507 5508// Header returns an http.Header that can be modified by the caller to 5509// add HTTP headers to the request. 5510func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall) Header() http.Header { 5511 if c.header_ == nil { 5512 c.header_ = make(http.Header) 5513 } 5514 return c.header_ 5515} 5516 5517func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall) doRequest(alt string) (*http.Response, error) { 5518 reqHeaders := make(http.Header) 5519 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5520 for k, v := range c.header_ { 5521 reqHeaders[k] = v 5522 } 5523 reqHeaders.Set("User-Agent", c.s.userAgent()) 5524 if c.ifNoneMatch_ != "" { 5525 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5526 } 5527 var body io.Reader = nil 5528 c.urlParams_.Set("alt", alt) 5529 c.urlParams_.Set("prettyPrint", "false") 5530 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5531 urls += "?" + c.urlParams_.Encode() 5532 req, err := http.NewRequest("GET", urls, body) 5533 if err != nil { 5534 return nil, err 5535 } 5536 req.Header = reqHeaders 5537 googleapi.Expand(req.URL, map[string]string{ 5538 "name": c.name, 5539 }) 5540 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5541} 5542 5543// Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.get" call. 5544// Exactly one of *CertificateRevocationList or error will be non-nil. 5545// Any non-2xx status code is an error. Response headers are in either 5546// *CertificateRevocationList.ServerResponse.Header or (if a response 5547// was returned at all) in error.(*googleapi.Error).Header. Use 5548// googleapi.IsNotModified to check whether the returned error was 5549// because http.StatusNotModified was returned. 5550func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetCall) Do(opts ...googleapi.CallOption) (*CertificateRevocationList, error) { 5551 gensupport.SetOptions(c.urlParams_, opts...) 5552 res, err := c.doRequest("json") 5553 if res != nil && res.StatusCode == http.StatusNotModified { 5554 if res.Body != nil { 5555 res.Body.Close() 5556 } 5557 return nil, &googleapi.Error{ 5558 Code: res.StatusCode, 5559 Header: res.Header, 5560 } 5561 } 5562 if err != nil { 5563 return nil, err 5564 } 5565 defer googleapi.CloseBody(res) 5566 if err := googleapi.CheckResponse(res); err != nil { 5567 return nil, err 5568 } 5569 ret := &CertificateRevocationList{ 5570 ServerResponse: googleapi.ServerResponse{ 5571 Header: res.Header, 5572 HTTPStatusCode: res.StatusCode, 5573 }, 5574 } 5575 target := &ret 5576 if err := gensupport.DecodeResponse(target, res); err != nil { 5577 return nil, err 5578 } 5579 return ret, nil 5580 // { 5581 // "description": "Returns a CertificateRevocationList.", 5582 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificateRevocationLists/{certificateRevocationListsId}", 5583 // "httpMethod": "GET", 5584 // "id": "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.get", 5585 // "parameterOrder": [ 5586 // "name" 5587 // ], 5588 // "parameters": { 5589 // "name": { 5590 // "description": "Required. The name of the CertificateRevocationList to get.", 5591 // "location": "path", 5592 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+$", 5593 // "required": true, 5594 // "type": "string" 5595 // } 5596 // }, 5597 // "path": "v1beta1/{+name}", 5598 // "response": { 5599 // "$ref": "CertificateRevocationList" 5600 // }, 5601 // "scopes": [ 5602 // "https://www.googleapis.com/auth/cloud-platform" 5603 // ] 5604 // } 5605 5606} 5607 5608// method id "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.getIamPolicy": 5609 5610type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall struct { 5611 s *Service 5612 resource string 5613 urlParams_ gensupport.URLParams 5614 ifNoneMatch_ string 5615 ctx_ context.Context 5616 header_ http.Header 5617} 5618 5619// GetIamPolicy: Gets the access control policy for a resource. Returns 5620// an empty policy if the resource exists and does not have a policy 5621// set. 5622// 5623// - resource: REQUIRED: The resource for which the policy is being 5624// requested. See the operation documentation for the appropriate 5625// value for this field. 5626func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) GetIamPolicy(resource string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall { 5627 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5628 c.resource = resource 5629 return c 5630} 5631 5632// OptionsRequestedPolicyVersion sets the optional parameter 5633// "options.requestedPolicyVersion": The policy format version to be 5634// returned. Valid values are 0, 1, and 3. Requests specifying an 5635// invalid value will be rejected. Requests for policies with any 5636// conditional bindings must specify version 3. Policies without any 5637// conditional bindings may specify any valid value or leave the field 5638// unset. To learn which resources support conditions in their IAM 5639// policies, see the IAM documentation 5640// (https://cloud.google.com/iam/help/conditions/resource-policies). 5641func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall { 5642 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 5643 return c 5644} 5645 5646// Fields allows partial responses to be retrieved. See 5647// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5648// for more information. 5649func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall { 5650 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5651 return c 5652} 5653 5654// IfNoneMatch sets the optional parameter which makes the operation 5655// fail if the object's ETag matches the given value. This is useful for 5656// getting updates only after the object has changed since the last 5657// request. Use googleapi.IsNotModified to check whether the response 5658// error from Do is the result of In-None-Match. 5659func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall { 5660 c.ifNoneMatch_ = entityTag 5661 return c 5662} 5663 5664// Context sets the context to be used in this call's Do method. Any 5665// pending HTTP request will be aborted if the provided context is 5666// canceled. 5667func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall { 5668 c.ctx_ = ctx 5669 return c 5670} 5671 5672// Header returns an http.Header that can be modified by the caller to 5673// add HTTP headers to the request. 5674func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Header() http.Header { 5675 if c.header_ == nil { 5676 c.header_ = make(http.Header) 5677 } 5678 return c.header_ 5679} 5680 5681func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5682 reqHeaders := make(http.Header) 5683 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5684 for k, v := range c.header_ { 5685 reqHeaders[k] = v 5686 } 5687 reqHeaders.Set("User-Agent", c.s.userAgent()) 5688 if c.ifNoneMatch_ != "" { 5689 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5690 } 5691 var body io.Reader = nil 5692 c.urlParams_.Set("alt", alt) 5693 c.urlParams_.Set("prettyPrint", "false") 5694 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") 5695 urls += "?" + c.urlParams_.Encode() 5696 req, err := http.NewRequest("GET", urls, body) 5697 if err != nil { 5698 return nil, err 5699 } 5700 req.Header = reqHeaders 5701 googleapi.Expand(req.URL, map[string]string{ 5702 "resource": c.resource, 5703 }) 5704 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5705} 5706 5707// Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.getIamPolicy" call. 5708// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5709// code is an error. Response headers are in either 5710// *Policy.ServerResponse.Header or (if a response was returned at all) 5711// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5712// check whether the returned error was because http.StatusNotModified 5713// was returned. 5714func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5715 gensupport.SetOptions(c.urlParams_, opts...) 5716 res, err := c.doRequest("json") 5717 if res != nil && res.StatusCode == http.StatusNotModified { 5718 if res.Body != nil { 5719 res.Body.Close() 5720 } 5721 return nil, &googleapi.Error{ 5722 Code: res.StatusCode, 5723 Header: res.Header, 5724 } 5725 } 5726 if err != nil { 5727 return nil, err 5728 } 5729 defer googleapi.CloseBody(res) 5730 if err := googleapi.CheckResponse(res); err != nil { 5731 return nil, err 5732 } 5733 ret := &Policy{ 5734 ServerResponse: googleapi.ServerResponse{ 5735 Header: res.Header, 5736 HTTPStatusCode: res.StatusCode, 5737 }, 5738 } 5739 target := &ret 5740 if err := gensupport.DecodeResponse(target, res); err != nil { 5741 return nil, err 5742 } 5743 return ret, nil 5744 // { 5745 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 5746 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificateRevocationLists/{certificateRevocationListsId}:getIamPolicy", 5747 // "httpMethod": "GET", 5748 // "id": "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.getIamPolicy", 5749 // "parameterOrder": [ 5750 // "resource" 5751 // ], 5752 // "parameters": { 5753 // "options.requestedPolicyVersion": { 5754 // "description": "Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", 5755 // "format": "int32", 5756 // "location": "query", 5757 // "type": "integer" 5758 // }, 5759 // "resource": { 5760 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 5761 // "location": "path", 5762 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+$", 5763 // "required": true, 5764 // "type": "string" 5765 // } 5766 // }, 5767 // "path": "v1beta1/{+resource}:getIamPolicy", 5768 // "response": { 5769 // "$ref": "Policy" 5770 // }, 5771 // "scopes": [ 5772 // "https://www.googleapis.com/auth/cloud-platform" 5773 // ] 5774 // } 5775 5776} 5777 5778// method id "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.list": 5779 5780type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall struct { 5781 s *Service 5782 parent string 5783 urlParams_ gensupport.URLParams 5784 ifNoneMatch_ string 5785 ctx_ context.Context 5786 header_ http.Header 5787} 5788 5789// List: Lists CertificateRevocationLists. 5790// 5791// - parent: The resource name of the location associated with the 5792// CertificateRevocationLists, in the format 5793// `projects/*/locations/*/certificateauthorities/*`. 5794func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) List(parent string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5795 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5796 c.parent = parent 5797 return c 5798} 5799 5800// Filter sets the optional parameter "filter": Only include resources 5801// that match the filter in the response. 5802func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) Filter(filter string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5803 c.urlParams_.Set("filter", filter) 5804 return c 5805} 5806 5807// OrderBy sets the optional parameter "orderBy": Specify how the 5808// results should be sorted. 5809func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) OrderBy(orderBy string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5810 c.urlParams_.Set("orderBy", orderBy) 5811 return c 5812} 5813 5814// PageSize sets the optional parameter "pageSize": Limit on the number 5815// of CertificateRevocationLists to include in the response. Further 5816// CertificateRevocationLists can subsequently be obtained by including 5817// the ListCertificateRevocationListsResponse.next_page_token in a 5818// subsequent request. If unspecified, the server will pick an 5819// appropriate default. 5820func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) PageSize(pageSize int64) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5821 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5822 return c 5823} 5824 5825// PageToken sets the optional parameter "pageToken": Pagination token, 5826// returned earlier via 5827// ListCertificateRevocationListsResponse.next_page_token. 5828func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) PageToken(pageToken string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5829 c.urlParams_.Set("pageToken", pageToken) 5830 return c 5831} 5832 5833// Fields allows partial responses to be retrieved. See 5834// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5835// for more information. 5836func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5837 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5838 return c 5839} 5840 5841// IfNoneMatch sets the optional parameter which makes the operation 5842// fail if the object's ETag matches the given value. This is useful for 5843// getting updates only after the object has changed since the last 5844// request. Use googleapi.IsNotModified to check whether the response 5845// error from Do is the result of In-None-Match. 5846func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5847 c.ifNoneMatch_ = entityTag 5848 return c 5849} 5850 5851// Context sets the context to be used in this call's Do method. Any 5852// pending HTTP request will be aborted if the provided context is 5853// canceled. 5854func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall { 5855 c.ctx_ = ctx 5856 return c 5857} 5858 5859// Header returns an http.Header that can be modified by the caller to 5860// add HTTP headers to the request. 5861func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) Header() http.Header { 5862 if c.header_ == nil { 5863 c.header_ = make(http.Header) 5864 } 5865 return c.header_ 5866} 5867 5868func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) doRequest(alt string) (*http.Response, error) { 5869 reqHeaders := make(http.Header) 5870 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5871 for k, v := range c.header_ { 5872 reqHeaders[k] = v 5873 } 5874 reqHeaders.Set("User-Agent", c.s.userAgent()) 5875 if c.ifNoneMatch_ != "" { 5876 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5877 } 5878 var body io.Reader = nil 5879 c.urlParams_.Set("alt", alt) 5880 c.urlParams_.Set("prettyPrint", "false") 5881 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/certificateRevocationLists") 5882 urls += "?" + c.urlParams_.Encode() 5883 req, err := http.NewRequest("GET", urls, body) 5884 if err != nil { 5885 return nil, err 5886 } 5887 req.Header = reqHeaders 5888 googleapi.Expand(req.URL, map[string]string{ 5889 "parent": c.parent, 5890 }) 5891 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5892} 5893 5894// Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.list" call. 5895// Exactly one of *ListCertificateRevocationListsResponse or error will 5896// be non-nil. Any non-2xx status code is an error. Response headers are 5897// in either 5898// *ListCertificateRevocationListsResponse.ServerResponse.Header or (if 5899// a response was returned at all) in error.(*googleapi.Error).Header. 5900// Use googleapi.IsNotModified to check whether the returned error was 5901// because http.StatusNotModified was returned. 5902func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) Do(opts ...googleapi.CallOption) (*ListCertificateRevocationListsResponse, error) { 5903 gensupport.SetOptions(c.urlParams_, opts...) 5904 res, err := c.doRequest("json") 5905 if res != nil && res.StatusCode == http.StatusNotModified { 5906 if res.Body != nil { 5907 res.Body.Close() 5908 } 5909 return nil, &googleapi.Error{ 5910 Code: res.StatusCode, 5911 Header: res.Header, 5912 } 5913 } 5914 if err != nil { 5915 return nil, err 5916 } 5917 defer googleapi.CloseBody(res) 5918 if err := googleapi.CheckResponse(res); err != nil { 5919 return nil, err 5920 } 5921 ret := &ListCertificateRevocationListsResponse{ 5922 ServerResponse: googleapi.ServerResponse{ 5923 Header: res.Header, 5924 HTTPStatusCode: res.StatusCode, 5925 }, 5926 } 5927 target := &ret 5928 if err := gensupport.DecodeResponse(target, res); err != nil { 5929 return nil, err 5930 } 5931 return ret, nil 5932 // { 5933 // "description": "Lists CertificateRevocationLists.", 5934 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificateRevocationLists", 5935 // "httpMethod": "GET", 5936 // "id": "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.list", 5937 // "parameterOrder": [ 5938 // "parent" 5939 // ], 5940 // "parameters": { 5941 // "filter": { 5942 // "description": "Optional. Only include resources that match the filter in the response.", 5943 // "location": "query", 5944 // "type": "string" 5945 // }, 5946 // "orderBy": { 5947 // "description": "Optional. Specify how the results should be sorted.", 5948 // "location": "query", 5949 // "type": "string" 5950 // }, 5951 // "pageSize": { 5952 // "description": "Optional. Limit on the number of CertificateRevocationLists to include in the response. Further CertificateRevocationLists can subsequently be obtained by including the ListCertificateRevocationListsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.", 5953 // "format": "int32", 5954 // "location": "query", 5955 // "type": "integer" 5956 // }, 5957 // "pageToken": { 5958 // "description": "Optional. Pagination token, returned earlier via ListCertificateRevocationListsResponse.next_page_token.", 5959 // "location": "query", 5960 // "type": "string" 5961 // }, 5962 // "parent": { 5963 // "description": "Required. The resource name of the location associated with the CertificateRevocationLists, in the format `projects/*/locations/*/certificateauthorities/*`.", 5964 // "location": "path", 5965 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 5966 // "required": true, 5967 // "type": "string" 5968 // } 5969 // }, 5970 // "path": "v1beta1/{+parent}/certificateRevocationLists", 5971 // "response": { 5972 // "$ref": "ListCertificateRevocationListsResponse" 5973 // }, 5974 // "scopes": [ 5975 // "https://www.googleapis.com/auth/cloud-platform" 5976 // ] 5977 // } 5978 5979} 5980 5981// Pages invokes f for each page of results. 5982// A non-nil error returned from f will halt the iteration. 5983// The provided context supersedes any context provided to the Context method. 5984func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsListCall) Pages(ctx context.Context, f func(*ListCertificateRevocationListsResponse) error) error { 5985 c.ctx_ = ctx 5986 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5987 for { 5988 x, err := c.Do() 5989 if err != nil { 5990 return err 5991 } 5992 if err := f(x); err != nil { 5993 return err 5994 } 5995 if x.NextPageToken == "" { 5996 return nil 5997 } 5998 c.PageToken(x.NextPageToken) 5999 } 6000} 6001 6002// method id "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.patch": 6003 6004type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall struct { 6005 s *Service 6006 name string 6007 certificaterevocationlist *CertificateRevocationList 6008 urlParams_ gensupport.URLParams 6009 ctx_ context.Context 6010 header_ http.Header 6011} 6012 6013// Patch: Update a CertificateRevocationList. 6014// 6015// - name: Output only. The resource path for this 6016// CertificateRevocationList in the format 6017// `projects/*/locations/*/certificateAuthorities/*/ 6018// certificateRevocationLists/*`. 6019func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) Patch(name string, certificaterevocationlist *CertificateRevocationList) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall { 6020 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6021 c.name = name 6022 c.certificaterevocationlist = certificaterevocationlist 6023 return c 6024} 6025 6026// RequestId sets the optional parameter "requestId": An ID to identify 6027// requests. Specify a unique request ID so that if you must retry your 6028// request, the server will know to ignore the request if it has already 6029// been completed. The server will guarantee that for at least 60 6030// minutes since the first request. For example, consider a situation 6031// where you make an initial request and t he request times out. If you 6032// make the request again with the same request ID, the server can check 6033// if original operation with the same request ID was received, and if 6034// so, will ignore the second request. This prevents clients from 6035// accidentally creating duplicate commitments. The request ID must be a 6036// valid UUID with the exception that zero UUID is not supported 6037// (00000000-0000-0000-0000-000000000000). 6038func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) RequestId(requestId string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall { 6039 c.urlParams_.Set("requestId", requestId) 6040 return c 6041} 6042 6043// UpdateMask sets the optional parameter "updateMask": Required. A list 6044// of fields to be updated in this request. 6045func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall { 6046 c.urlParams_.Set("updateMask", updateMask) 6047 return c 6048} 6049 6050// Fields allows partial responses to be retrieved. See 6051// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6052// for more information. 6053func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall { 6054 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6055 return c 6056} 6057 6058// Context sets the context to be used in this call's Do method. Any 6059// pending HTTP request will be aborted if the provided context is 6060// canceled. 6061func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall { 6062 c.ctx_ = ctx 6063 return c 6064} 6065 6066// Header returns an http.Header that can be modified by the caller to 6067// add HTTP headers to the request. 6068func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) Header() http.Header { 6069 if c.header_ == nil { 6070 c.header_ = make(http.Header) 6071 } 6072 return c.header_ 6073} 6074 6075func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) doRequest(alt string) (*http.Response, error) { 6076 reqHeaders := make(http.Header) 6077 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6078 for k, v := range c.header_ { 6079 reqHeaders[k] = v 6080 } 6081 reqHeaders.Set("User-Agent", c.s.userAgent()) 6082 var body io.Reader = nil 6083 body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificaterevocationlist) 6084 if err != nil { 6085 return nil, err 6086 } 6087 reqHeaders.Set("Content-Type", "application/json") 6088 c.urlParams_.Set("alt", alt) 6089 c.urlParams_.Set("prettyPrint", "false") 6090 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6091 urls += "?" + c.urlParams_.Encode() 6092 req, err := http.NewRequest("PATCH", urls, body) 6093 if err != nil { 6094 return nil, err 6095 } 6096 req.Header = reqHeaders 6097 googleapi.Expand(req.URL, map[string]string{ 6098 "name": c.name, 6099 }) 6100 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6101} 6102 6103// Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.patch" call. 6104// Exactly one of *Operation or error will be non-nil. Any non-2xx 6105// status code is an error. Response headers are in either 6106// *Operation.ServerResponse.Header or (if a response was returned at 6107// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6108// to check whether the returned error was because 6109// http.StatusNotModified was returned. 6110func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6111 gensupport.SetOptions(c.urlParams_, opts...) 6112 res, err := c.doRequest("json") 6113 if res != nil && res.StatusCode == http.StatusNotModified { 6114 if res.Body != nil { 6115 res.Body.Close() 6116 } 6117 return nil, &googleapi.Error{ 6118 Code: res.StatusCode, 6119 Header: res.Header, 6120 } 6121 } 6122 if err != nil { 6123 return nil, err 6124 } 6125 defer googleapi.CloseBody(res) 6126 if err := googleapi.CheckResponse(res); err != nil { 6127 return nil, err 6128 } 6129 ret := &Operation{ 6130 ServerResponse: googleapi.ServerResponse{ 6131 Header: res.Header, 6132 HTTPStatusCode: res.StatusCode, 6133 }, 6134 } 6135 target := &ret 6136 if err := gensupport.DecodeResponse(target, res); err != nil { 6137 return nil, err 6138 } 6139 return ret, nil 6140 // { 6141 // "description": "Update a CertificateRevocationList.", 6142 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificateRevocationLists/{certificateRevocationListsId}", 6143 // "httpMethod": "PATCH", 6144 // "id": "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.patch", 6145 // "parameterOrder": [ 6146 // "name" 6147 // ], 6148 // "parameters": { 6149 // "name": { 6150 // "description": "Output only. The resource path for this CertificateRevocationList in the format `projects/*/locations/*/certificateAuthorities/*/ certificateRevocationLists/*`.", 6151 // "location": "path", 6152 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+$", 6153 // "required": true, 6154 // "type": "string" 6155 // }, 6156 // "requestId": { 6157 // "description": "Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", 6158 // "location": "query", 6159 // "type": "string" 6160 // }, 6161 // "updateMask": { 6162 // "description": "Required. A list of fields to be updated in this request.", 6163 // "format": "google-fieldmask", 6164 // "location": "query", 6165 // "type": "string" 6166 // } 6167 // }, 6168 // "path": "v1beta1/{+name}", 6169 // "request": { 6170 // "$ref": "CertificateRevocationList" 6171 // }, 6172 // "response": { 6173 // "$ref": "Operation" 6174 // }, 6175 // "scopes": [ 6176 // "https://www.googleapis.com/auth/cloud-platform" 6177 // ] 6178 // } 6179 6180} 6181 6182// method id "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.setIamPolicy": 6183 6184type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall struct { 6185 s *Service 6186 resource string 6187 setiampolicyrequest *SetIamPolicyRequest 6188 urlParams_ gensupport.URLParams 6189 ctx_ context.Context 6190 header_ http.Header 6191} 6192 6193// SetIamPolicy: Sets the access control policy on the specified 6194// resource. Replaces any existing policy. Can return `NOT_FOUND`, 6195// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. 6196// 6197// - resource: REQUIRED: The resource for which the policy is being 6198// specified. See the operation documentation for the appropriate 6199// value for this field. 6200func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall { 6201 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6202 c.resource = resource 6203 c.setiampolicyrequest = setiampolicyrequest 6204 return c 6205} 6206 6207// Fields allows partial responses to be retrieved. See 6208// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6209// for more information. 6210func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall { 6211 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6212 return c 6213} 6214 6215// Context sets the context to be used in this call's Do method. Any 6216// pending HTTP request will be aborted if the provided context is 6217// canceled. 6218func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall { 6219 c.ctx_ = ctx 6220 return c 6221} 6222 6223// Header returns an http.Header that can be modified by the caller to 6224// add HTTP headers to the request. 6225func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Header() http.Header { 6226 if c.header_ == nil { 6227 c.header_ = make(http.Header) 6228 } 6229 return c.header_ 6230} 6231 6232func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6233 reqHeaders := make(http.Header) 6234 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6235 for k, v := range c.header_ { 6236 reqHeaders[k] = v 6237 } 6238 reqHeaders.Set("User-Agent", c.s.userAgent()) 6239 var body io.Reader = nil 6240 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 6241 if err != nil { 6242 return nil, err 6243 } 6244 reqHeaders.Set("Content-Type", "application/json") 6245 c.urlParams_.Set("alt", alt) 6246 c.urlParams_.Set("prettyPrint", "false") 6247 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") 6248 urls += "?" + c.urlParams_.Encode() 6249 req, err := http.NewRequest("POST", urls, body) 6250 if err != nil { 6251 return nil, err 6252 } 6253 req.Header = reqHeaders 6254 googleapi.Expand(req.URL, map[string]string{ 6255 "resource": c.resource, 6256 }) 6257 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6258} 6259 6260// Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.setIamPolicy" call. 6261// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6262// code is an error. Response headers are in either 6263// *Policy.ServerResponse.Header or (if a response was returned at all) 6264// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6265// check whether the returned error was because http.StatusNotModified 6266// was returned. 6267func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6268 gensupport.SetOptions(c.urlParams_, opts...) 6269 res, err := c.doRequest("json") 6270 if res != nil && res.StatusCode == http.StatusNotModified { 6271 if res.Body != nil { 6272 res.Body.Close() 6273 } 6274 return nil, &googleapi.Error{ 6275 Code: res.StatusCode, 6276 Header: res.Header, 6277 } 6278 } 6279 if err != nil { 6280 return nil, err 6281 } 6282 defer googleapi.CloseBody(res) 6283 if err := googleapi.CheckResponse(res); err != nil { 6284 return nil, err 6285 } 6286 ret := &Policy{ 6287 ServerResponse: googleapi.ServerResponse{ 6288 Header: res.Header, 6289 HTTPStatusCode: res.StatusCode, 6290 }, 6291 } 6292 target := &ret 6293 if err := gensupport.DecodeResponse(target, res); err != nil { 6294 return nil, err 6295 } 6296 return ret, nil 6297 // { 6298 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", 6299 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificateRevocationLists/{certificateRevocationListsId}:setIamPolicy", 6300 // "httpMethod": "POST", 6301 // "id": "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.setIamPolicy", 6302 // "parameterOrder": [ 6303 // "resource" 6304 // ], 6305 // "parameters": { 6306 // "resource": { 6307 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 6308 // "location": "path", 6309 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+$", 6310 // "required": true, 6311 // "type": "string" 6312 // } 6313 // }, 6314 // "path": "v1beta1/{+resource}:setIamPolicy", 6315 // "request": { 6316 // "$ref": "SetIamPolicyRequest" 6317 // }, 6318 // "response": { 6319 // "$ref": "Policy" 6320 // }, 6321 // "scopes": [ 6322 // "https://www.googleapis.com/auth/cloud-platform" 6323 // ] 6324 // } 6325 6326} 6327 6328// method id "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.testIamPermissions": 6329 6330type ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall struct { 6331 s *Service 6332 resource string 6333 testiampermissionsrequest *TestIamPermissionsRequest 6334 urlParams_ gensupport.URLParams 6335 ctx_ context.Context 6336 header_ http.Header 6337} 6338 6339// TestIamPermissions: Returns permissions that a caller has on the 6340// specified resource. If the resource does not exist, this will return 6341// an empty set of permissions, not a `NOT_FOUND` error. Note: This 6342// operation is designed to be used for building permission-aware UIs 6343// and command-line tools, not for authorization checking. This 6344// operation may "fail open" without warning. 6345// 6346// - resource: REQUIRED: The resource for which the policy detail is 6347// being requested. See the operation documentation for the 6348// appropriate value for this field. 6349func (r *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall { 6350 c := &ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6351 c.resource = resource 6352 c.testiampermissionsrequest = testiampermissionsrequest 6353 return c 6354} 6355 6356// Fields allows partial responses to be retrieved. See 6357// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6358// for more information. 6359func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall { 6360 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6361 return c 6362} 6363 6364// Context sets the context to be used in this call's Do method. Any 6365// pending HTTP request will be aborted if the provided context is 6366// canceled. 6367func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall { 6368 c.ctx_ = ctx 6369 return c 6370} 6371 6372// Header returns an http.Header that can be modified by the caller to 6373// add HTTP headers to the request. 6374func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Header() http.Header { 6375 if c.header_ == nil { 6376 c.header_ = make(http.Header) 6377 } 6378 return c.header_ 6379} 6380 6381func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 6382 reqHeaders := make(http.Header) 6383 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6384 for k, v := range c.header_ { 6385 reqHeaders[k] = v 6386 } 6387 reqHeaders.Set("User-Agent", c.s.userAgent()) 6388 var body io.Reader = nil 6389 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 6390 if err != nil { 6391 return nil, err 6392 } 6393 reqHeaders.Set("Content-Type", "application/json") 6394 c.urlParams_.Set("alt", alt) 6395 c.urlParams_.Set("prettyPrint", "false") 6396 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") 6397 urls += "?" + c.urlParams_.Encode() 6398 req, err := http.NewRequest("POST", urls, body) 6399 if err != nil { 6400 return nil, err 6401 } 6402 req.Header = reqHeaders 6403 googleapi.Expand(req.URL, map[string]string{ 6404 "resource": c.resource, 6405 }) 6406 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6407} 6408 6409// Do executes the "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.testIamPermissions" call. 6410// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 6411// Any non-2xx status code is an error. Response headers are in either 6412// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 6413// was returned at all) in error.(*googleapi.Error).Header. Use 6414// googleapi.IsNotModified to check whether the returned error was 6415// because http.StatusNotModified was returned. 6416func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 6417 gensupport.SetOptions(c.urlParams_, opts...) 6418 res, err := c.doRequest("json") 6419 if res != nil && res.StatusCode == http.StatusNotModified { 6420 if res.Body != nil { 6421 res.Body.Close() 6422 } 6423 return nil, &googleapi.Error{ 6424 Code: res.StatusCode, 6425 Header: res.Header, 6426 } 6427 } 6428 if err != nil { 6429 return nil, err 6430 } 6431 defer googleapi.CloseBody(res) 6432 if err := googleapi.CheckResponse(res); err != nil { 6433 return nil, err 6434 } 6435 ret := &TestIamPermissionsResponse{ 6436 ServerResponse: googleapi.ServerResponse{ 6437 Header: res.Header, 6438 HTTPStatusCode: res.StatusCode, 6439 }, 6440 } 6441 target := &ret 6442 if err := gensupport.DecodeResponse(target, res); err != nil { 6443 return nil, err 6444 } 6445 return ret, nil 6446 // { 6447 // "description": "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. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 6448 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificateRevocationLists/{certificateRevocationListsId}:testIamPermissions", 6449 // "httpMethod": "POST", 6450 // "id": "privateca.projects.locations.certificateAuthorities.certificateRevocationLists.testIamPermissions", 6451 // "parameterOrder": [ 6452 // "resource" 6453 // ], 6454 // "parameters": { 6455 // "resource": { 6456 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 6457 // "location": "path", 6458 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+$", 6459 // "required": true, 6460 // "type": "string" 6461 // } 6462 // }, 6463 // "path": "v1beta1/{+resource}:testIamPermissions", 6464 // "request": { 6465 // "$ref": "TestIamPermissionsRequest" 6466 // }, 6467 // "response": { 6468 // "$ref": "TestIamPermissionsResponse" 6469 // }, 6470 // "scopes": [ 6471 // "https://www.googleapis.com/auth/cloud-platform" 6472 // ] 6473 // } 6474 6475} 6476 6477// method id "privateca.projects.locations.certificateAuthorities.certificates.create": 6478 6479type ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall struct { 6480 s *Service 6481 parent string 6482 certificate *Certificate 6483 urlParams_ gensupport.URLParams 6484 ctx_ context.Context 6485 header_ http.Header 6486} 6487 6488// Create: Create a new Certificate in a given Project, Location from a 6489// particular CertificateAuthority. 6490// 6491// - parent: The resource name of the location and CertificateAuthority 6492// associated with the Certificate, in the format 6493// `projects/*/locations/*/certificateAuthorities/*`. 6494func (r *ProjectsLocationsCertificateAuthoritiesCertificatesService) Create(parent string, certificate *Certificate) *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall { 6495 c := &ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6496 c.parent = parent 6497 c.certificate = certificate 6498 return c 6499} 6500 6501// CertificateId sets the optional parameter "certificateId": It must be 6502// unique within a location and match the regular expression 6503// `[a-zA-Z0-9_-]{1,63}`. This field is required when using a 6504// CertificateAuthority in the Enterprise CertificateAuthority.Tier, but 6505// is optional and its value is ignored otherwise. 6506func (c *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall) CertificateId(certificateId string) *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall { 6507 c.urlParams_.Set("certificateId", certificateId) 6508 return c 6509} 6510 6511// RequestId sets the optional parameter "requestId": An ID to identify 6512// requests. Specify a unique request ID so that if you must retry your 6513// request, the server will know to ignore the request if it has already 6514// been completed. The server will guarantee that for at least 60 6515// minutes since the first request. For example, consider a situation 6516// where you make an initial request and t he request times out. If you 6517// make the request again with the same request ID, the server can check 6518// if original operation with the same request ID was received, and if 6519// so, will ignore the second request. This prevents clients from 6520// accidentally creating duplicate commitments. The request ID must be a 6521// valid UUID with the exception that zero UUID is not supported 6522// (00000000-0000-0000-0000-000000000000). 6523func (c *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall) RequestId(requestId string) *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall { 6524 c.urlParams_.Set("requestId", requestId) 6525 return c 6526} 6527 6528// Fields allows partial responses to be retrieved. See 6529// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6530// for more information. 6531func (c *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall { 6532 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6533 return c 6534} 6535 6536// Context sets the context to be used in this call's Do method. Any 6537// pending HTTP request will be aborted if the provided context is 6538// canceled. 6539func (c *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall { 6540 c.ctx_ = ctx 6541 return c 6542} 6543 6544// Header returns an http.Header that can be modified by the caller to 6545// add HTTP headers to the request. 6546func (c *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall) Header() http.Header { 6547 if c.header_ == nil { 6548 c.header_ = make(http.Header) 6549 } 6550 return c.header_ 6551} 6552 6553func (c *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall) doRequest(alt string) (*http.Response, error) { 6554 reqHeaders := make(http.Header) 6555 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6556 for k, v := range c.header_ { 6557 reqHeaders[k] = v 6558 } 6559 reqHeaders.Set("User-Agent", c.s.userAgent()) 6560 var body io.Reader = nil 6561 body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificate) 6562 if err != nil { 6563 return nil, err 6564 } 6565 reqHeaders.Set("Content-Type", "application/json") 6566 c.urlParams_.Set("alt", alt) 6567 c.urlParams_.Set("prettyPrint", "false") 6568 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/certificates") 6569 urls += "?" + c.urlParams_.Encode() 6570 req, err := http.NewRequest("POST", urls, body) 6571 if err != nil { 6572 return nil, err 6573 } 6574 req.Header = reqHeaders 6575 googleapi.Expand(req.URL, map[string]string{ 6576 "parent": c.parent, 6577 }) 6578 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6579} 6580 6581// Do executes the "privateca.projects.locations.certificateAuthorities.certificates.create" call. 6582// Exactly one of *Certificate or error will be non-nil. Any non-2xx 6583// status code is an error. Response headers are in either 6584// *Certificate.ServerResponse.Header or (if a response was returned at 6585// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6586// to check whether the returned error was because 6587// http.StatusNotModified was returned. 6588func (c *ProjectsLocationsCertificateAuthoritiesCertificatesCreateCall) Do(opts ...googleapi.CallOption) (*Certificate, error) { 6589 gensupport.SetOptions(c.urlParams_, opts...) 6590 res, err := c.doRequest("json") 6591 if res != nil && res.StatusCode == http.StatusNotModified { 6592 if res.Body != nil { 6593 res.Body.Close() 6594 } 6595 return nil, &googleapi.Error{ 6596 Code: res.StatusCode, 6597 Header: res.Header, 6598 } 6599 } 6600 if err != nil { 6601 return nil, err 6602 } 6603 defer googleapi.CloseBody(res) 6604 if err := googleapi.CheckResponse(res); err != nil { 6605 return nil, err 6606 } 6607 ret := &Certificate{ 6608 ServerResponse: googleapi.ServerResponse{ 6609 Header: res.Header, 6610 HTTPStatusCode: res.StatusCode, 6611 }, 6612 } 6613 target := &ret 6614 if err := gensupport.DecodeResponse(target, res); err != nil { 6615 return nil, err 6616 } 6617 return ret, nil 6618 // { 6619 // "description": "Create a new Certificate in a given Project, Location from a particular CertificateAuthority.", 6620 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificates", 6621 // "httpMethod": "POST", 6622 // "id": "privateca.projects.locations.certificateAuthorities.certificates.create", 6623 // "parameterOrder": [ 6624 // "parent" 6625 // ], 6626 // "parameters": { 6627 // "certificateId": { 6628 // "description": "Optional. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a CertificateAuthority in the Enterprise CertificateAuthority.Tier, but is optional and its value is ignored otherwise.", 6629 // "location": "query", 6630 // "type": "string" 6631 // }, 6632 // "parent": { 6633 // "description": "Required. The resource name of the location and CertificateAuthority associated with the Certificate, in the format `projects/*/locations/*/certificateAuthorities/*`.", 6634 // "location": "path", 6635 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 6636 // "required": true, 6637 // "type": "string" 6638 // }, 6639 // "requestId": { 6640 // "description": "Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", 6641 // "location": "query", 6642 // "type": "string" 6643 // } 6644 // }, 6645 // "path": "v1beta1/{+parent}/certificates", 6646 // "request": { 6647 // "$ref": "Certificate" 6648 // }, 6649 // "response": { 6650 // "$ref": "Certificate" 6651 // }, 6652 // "scopes": [ 6653 // "https://www.googleapis.com/auth/cloud-platform" 6654 // ] 6655 // } 6656 6657} 6658 6659// method id "privateca.projects.locations.certificateAuthorities.certificates.get": 6660 6661type ProjectsLocationsCertificateAuthoritiesCertificatesGetCall struct { 6662 s *Service 6663 name string 6664 urlParams_ gensupport.URLParams 6665 ifNoneMatch_ string 6666 ctx_ context.Context 6667 header_ http.Header 6668} 6669 6670// Get: Returns a Certificate. 6671// 6672// - name: The name of the Certificate to get. 6673func (r *ProjectsLocationsCertificateAuthoritiesCertificatesService) Get(name string) *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall { 6674 c := &ProjectsLocationsCertificateAuthoritiesCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6675 c.name = name 6676 return c 6677} 6678 6679// Fields allows partial responses to be retrieved. See 6680// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6681// for more information. 6682func (c *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall { 6683 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6684 return c 6685} 6686 6687// IfNoneMatch sets the optional parameter which makes the operation 6688// fail if the object's ETag matches the given value. This is useful for 6689// getting updates only after the object has changed since the last 6690// request. Use googleapi.IsNotModified to check whether the response 6691// error from Do is the result of In-None-Match. 6692func (c *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall { 6693 c.ifNoneMatch_ = entityTag 6694 return c 6695} 6696 6697// Context sets the context to be used in this call's Do method. Any 6698// pending HTTP request will be aborted if the provided context is 6699// canceled. 6700func (c *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall { 6701 c.ctx_ = ctx 6702 return c 6703} 6704 6705// Header returns an http.Header that can be modified by the caller to 6706// add HTTP headers to the request. 6707func (c *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall) Header() http.Header { 6708 if c.header_ == nil { 6709 c.header_ = make(http.Header) 6710 } 6711 return c.header_ 6712} 6713 6714func (c *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall) doRequest(alt string) (*http.Response, error) { 6715 reqHeaders := make(http.Header) 6716 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6717 for k, v := range c.header_ { 6718 reqHeaders[k] = v 6719 } 6720 reqHeaders.Set("User-Agent", c.s.userAgent()) 6721 if c.ifNoneMatch_ != "" { 6722 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6723 } 6724 var body io.Reader = nil 6725 c.urlParams_.Set("alt", alt) 6726 c.urlParams_.Set("prettyPrint", "false") 6727 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6728 urls += "?" + c.urlParams_.Encode() 6729 req, err := http.NewRequest("GET", urls, body) 6730 if err != nil { 6731 return nil, err 6732 } 6733 req.Header = reqHeaders 6734 googleapi.Expand(req.URL, map[string]string{ 6735 "name": c.name, 6736 }) 6737 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6738} 6739 6740// Do executes the "privateca.projects.locations.certificateAuthorities.certificates.get" call. 6741// Exactly one of *Certificate or error will be non-nil. Any non-2xx 6742// status code is an error. Response headers are in either 6743// *Certificate.ServerResponse.Header or (if a response was returned at 6744// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6745// to check whether the returned error was because 6746// http.StatusNotModified was returned. 6747func (c *ProjectsLocationsCertificateAuthoritiesCertificatesGetCall) Do(opts ...googleapi.CallOption) (*Certificate, error) { 6748 gensupport.SetOptions(c.urlParams_, opts...) 6749 res, err := c.doRequest("json") 6750 if res != nil && res.StatusCode == http.StatusNotModified { 6751 if res.Body != nil { 6752 res.Body.Close() 6753 } 6754 return nil, &googleapi.Error{ 6755 Code: res.StatusCode, 6756 Header: res.Header, 6757 } 6758 } 6759 if err != nil { 6760 return nil, err 6761 } 6762 defer googleapi.CloseBody(res) 6763 if err := googleapi.CheckResponse(res); err != nil { 6764 return nil, err 6765 } 6766 ret := &Certificate{ 6767 ServerResponse: googleapi.ServerResponse{ 6768 Header: res.Header, 6769 HTTPStatusCode: res.StatusCode, 6770 }, 6771 } 6772 target := &ret 6773 if err := gensupport.DecodeResponse(target, res); err != nil { 6774 return nil, err 6775 } 6776 return ret, nil 6777 // { 6778 // "description": "Returns a Certificate.", 6779 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificates/{certificatesId}", 6780 // "httpMethod": "GET", 6781 // "id": "privateca.projects.locations.certificateAuthorities.certificates.get", 6782 // "parameterOrder": [ 6783 // "name" 6784 // ], 6785 // "parameters": { 6786 // "name": { 6787 // "description": "Required. The name of the Certificate to get.", 6788 // "location": "path", 6789 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+$", 6790 // "required": true, 6791 // "type": "string" 6792 // } 6793 // }, 6794 // "path": "v1beta1/{+name}", 6795 // "response": { 6796 // "$ref": "Certificate" 6797 // }, 6798 // "scopes": [ 6799 // "https://www.googleapis.com/auth/cloud-platform" 6800 // ] 6801 // } 6802 6803} 6804 6805// method id "privateca.projects.locations.certificateAuthorities.certificates.list": 6806 6807type ProjectsLocationsCertificateAuthoritiesCertificatesListCall struct { 6808 s *Service 6809 parent string 6810 urlParams_ gensupport.URLParams 6811 ifNoneMatch_ string 6812 ctx_ context.Context 6813 header_ http.Header 6814} 6815 6816// List: Lists Certificates. 6817// 6818// - parent: The resource name of the location associated with the 6819// Certificates, in the format 6820// `projects/*/locations/*/certificateauthorities/*`. 6821func (r *ProjectsLocationsCertificateAuthoritiesCertificatesService) List(parent string) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6822 c := &ProjectsLocationsCertificateAuthoritiesCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6823 c.parent = parent 6824 return c 6825} 6826 6827// Filter sets the optional parameter "filter": Only include resources 6828// that match the filter in the response. For details on supported 6829// filters and syntax, see Certificates Filtering documentation 6830// (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). 6831func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) Filter(filter string) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6832 c.urlParams_.Set("filter", filter) 6833 return c 6834} 6835 6836// OrderBy sets the optional parameter "orderBy": Specify how the 6837// results should be sorted. For details on supported fields and syntax, 6838// see Certificates Sorting documentation 6839// (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). 6840func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) OrderBy(orderBy string) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6841 c.urlParams_.Set("orderBy", orderBy) 6842 return c 6843} 6844 6845// PageSize sets the optional parameter "pageSize": Limit on the number 6846// of Certificates to include in the response. Further Certificates can 6847// subsequently be obtained by including the 6848// ListCertificatesResponse.next_page_token in a subsequent request. If 6849// unspecified, the server will pick an appropriate default. 6850func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) PageSize(pageSize int64) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6851 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6852 return c 6853} 6854 6855// PageToken sets the optional parameter "pageToken": Pagination token, 6856// returned earlier via ListCertificatesResponse.next_page_token. 6857func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) PageToken(pageToken string) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6858 c.urlParams_.Set("pageToken", pageToken) 6859 return c 6860} 6861 6862// Fields allows partial responses to be retrieved. See 6863// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6864// for more information. 6865func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6866 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6867 return c 6868} 6869 6870// IfNoneMatch sets the optional parameter which makes the operation 6871// fail if the object's ETag matches the given value. This is useful for 6872// getting updates only after the object has changed since the last 6873// request. Use googleapi.IsNotModified to check whether the response 6874// error from Do is the result of In-None-Match. 6875func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6876 c.ifNoneMatch_ = entityTag 6877 return c 6878} 6879 6880// Context sets the context to be used in this call's Do method. Any 6881// pending HTTP request will be aborted if the provided context is 6882// canceled. 6883func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificatesListCall { 6884 c.ctx_ = ctx 6885 return c 6886} 6887 6888// Header returns an http.Header that can be modified by the caller to 6889// add HTTP headers to the request. 6890func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) Header() http.Header { 6891 if c.header_ == nil { 6892 c.header_ = make(http.Header) 6893 } 6894 return c.header_ 6895} 6896 6897func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) doRequest(alt string) (*http.Response, error) { 6898 reqHeaders := make(http.Header) 6899 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6900 for k, v := range c.header_ { 6901 reqHeaders[k] = v 6902 } 6903 reqHeaders.Set("User-Agent", c.s.userAgent()) 6904 if c.ifNoneMatch_ != "" { 6905 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6906 } 6907 var body io.Reader = nil 6908 c.urlParams_.Set("alt", alt) 6909 c.urlParams_.Set("prettyPrint", "false") 6910 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/certificates") 6911 urls += "?" + c.urlParams_.Encode() 6912 req, err := http.NewRequest("GET", urls, body) 6913 if err != nil { 6914 return nil, err 6915 } 6916 req.Header = reqHeaders 6917 googleapi.Expand(req.URL, map[string]string{ 6918 "parent": c.parent, 6919 }) 6920 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6921} 6922 6923// Do executes the "privateca.projects.locations.certificateAuthorities.certificates.list" call. 6924// Exactly one of *ListCertificatesResponse or error will be non-nil. 6925// Any non-2xx status code is an error. Response headers are in either 6926// *ListCertificatesResponse.ServerResponse.Header or (if a response was 6927// returned at all) in error.(*googleapi.Error).Header. Use 6928// googleapi.IsNotModified to check whether the returned error was 6929// because http.StatusNotModified was returned. 6930func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) Do(opts ...googleapi.CallOption) (*ListCertificatesResponse, error) { 6931 gensupport.SetOptions(c.urlParams_, opts...) 6932 res, err := c.doRequest("json") 6933 if res != nil && res.StatusCode == http.StatusNotModified { 6934 if res.Body != nil { 6935 res.Body.Close() 6936 } 6937 return nil, &googleapi.Error{ 6938 Code: res.StatusCode, 6939 Header: res.Header, 6940 } 6941 } 6942 if err != nil { 6943 return nil, err 6944 } 6945 defer googleapi.CloseBody(res) 6946 if err := googleapi.CheckResponse(res); err != nil { 6947 return nil, err 6948 } 6949 ret := &ListCertificatesResponse{ 6950 ServerResponse: googleapi.ServerResponse{ 6951 Header: res.Header, 6952 HTTPStatusCode: res.StatusCode, 6953 }, 6954 } 6955 target := &ret 6956 if err := gensupport.DecodeResponse(target, res); err != nil { 6957 return nil, err 6958 } 6959 return ret, nil 6960 // { 6961 // "description": "Lists Certificates.", 6962 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificates", 6963 // "httpMethod": "GET", 6964 // "id": "privateca.projects.locations.certificateAuthorities.certificates.list", 6965 // "parameterOrder": [ 6966 // "parent" 6967 // ], 6968 // "parameters": { 6969 // "filter": { 6970 // "description": "Optional. Only include resources that match the filter in the response. For details on supported filters and syntax, see [Certificates Filtering documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).", 6971 // "location": "query", 6972 // "type": "string" 6973 // }, 6974 // "orderBy": { 6975 // "description": "Optional. Specify how the results should be sorted. For details on supported fields and syntax, see [Certificates Sorting documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).", 6976 // "location": "query", 6977 // "type": "string" 6978 // }, 6979 // "pageSize": { 6980 // "description": "Optional. Limit on the number of Certificates to include in the response. Further Certificates can subsequently be obtained by including the ListCertificatesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.", 6981 // "format": "int32", 6982 // "location": "query", 6983 // "type": "integer" 6984 // }, 6985 // "pageToken": { 6986 // "description": "Optional. Pagination token, returned earlier via ListCertificatesResponse.next_page_token.", 6987 // "location": "query", 6988 // "type": "string" 6989 // }, 6990 // "parent": { 6991 // "description": "Required. The resource name of the location associated with the Certificates, in the format `projects/*/locations/*/certificateauthorities/*`.", 6992 // "location": "path", 6993 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+$", 6994 // "required": true, 6995 // "type": "string" 6996 // } 6997 // }, 6998 // "path": "v1beta1/{+parent}/certificates", 6999 // "response": { 7000 // "$ref": "ListCertificatesResponse" 7001 // }, 7002 // "scopes": [ 7003 // "https://www.googleapis.com/auth/cloud-platform" 7004 // ] 7005 // } 7006 7007} 7008 7009// Pages invokes f for each page of results. 7010// A non-nil error returned from f will halt the iteration. 7011// The provided context supersedes any context provided to the Context method. 7012func (c *ProjectsLocationsCertificateAuthoritiesCertificatesListCall) Pages(ctx context.Context, f func(*ListCertificatesResponse) error) error { 7013 c.ctx_ = ctx 7014 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7015 for { 7016 x, err := c.Do() 7017 if err != nil { 7018 return err 7019 } 7020 if err := f(x); err != nil { 7021 return err 7022 } 7023 if x.NextPageToken == "" { 7024 return nil 7025 } 7026 c.PageToken(x.NextPageToken) 7027 } 7028} 7029 7030// method id "privateca.projects.locations.certificateAuthorities.certificates.patch": 7031 7032type ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall struct { 7033 s *Service 7034 name string 7035 certificate *Certificate 7036 urlParams_ gensupport.URLParams 7037 ctx_ context.Context 7038 header_ http.Header 7039} 7040 7041// Patch: Update a Certificate. Currently, the only field you can update 7042// is the labels field. 7043// 7044// - name: Output only. The resource path for this Certificate in the 7045// format 7046// `projects/*/locations/*/certificateAuthorities/*/certificates/*`. 7047func (r *ProjectsLocationsCertificateAuthoritiesCertificatesService) Patch(name string, certificate *Certificate) *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall { 7048 c := &ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7049 c.name = name 7050 c.certificate = certificate 7051 return c 7052} 7053 7054// RequestId sets the optional parameter "requestId": An ID to identify 7055// requests. Specify a unique request ID so that if you must retry your 7056// request, the server will know to ignore the request if it has already 7057// been completed. The server will guarantee that for at least 60 7058// minutes since the first request. For example, consider a situation 7059// where you make an initial request and t he request times out. If you 7060// make the request again with the same request ID, the server can check 7061// if original operation with the same request ID was received, and if 7062// so, will ignore the second request. This prevents clients from 7063// accidentally creating duplicate commitments. The request ID must be a 7064// valid UUID with the exception that zero UUID is not supported 7065// (00000000-0000-0000-0000-000000000000). 7066func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) RequestId(requestId string) *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall { 7067 c.urlParams_.Set("requestId", requestId) 7068 return c 7069} 7070 7071// UpdateMask sets the optional parameter "updateMask": Required. A list 7072// of fields to be updated in this request. 7073func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall { 7074 c.urlParams_.Set("updateMask", updateMask) 7075 return c 7076} 7077 7078// Fields allows partial responses to be retrieved. See 7079// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7080// for more information. 7081func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall { 7082 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7083 return c 7084} 7085 7086// Context sets the context to be used in this call's Do method. Any 7087// pending HTTP request will be aborted if the provided context is 7088// canceled. 7089func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall { 7090 c.ctx_ = ctx 7091 return c 7092} 7093 7094// Header returns an http.Header that can be modified by the caller to 7095// add HTTP headers to the request. 7096func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) Header() http.Header { 7097 if c.header_ == nil { 7098 c.header_ = make(http.Header) 7099 } 7100 return c.header_ 7101} 7102 7103func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) doRequest(alt string) (*http.Response, error) { 7104 reqHeaders := make(http.Header) 7105 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7106 for k, v := range c.header_ { 7107 reqHeaders[k] = v 7108 } 7109 reqHeaders.Set("User-Agent", c.s.userAgent()) 7110 var body io.Reader = nil 7111 body, err := googleapi.WithoutDataWrapper.JSONReader(c.certificate) 7112 if err != nil { 7113 return nil, err 7114 } 7115 reqHeaders.Set("Content-Type", "application/json") 7116 c.urlParams_.Set("alt", alt) 7117 c.urlParams_.Set("prettyPrint", "false") 7118 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7119 urls += "?" + c.urlParams_.Encode() 7120 req, err := http.NewRequest("PATCH", urls, body) 7121 if err != nil { 7122 return nil, err 7123 } 7124 req.Header = reqHeaders 7125 googleapi.Expand(req.URL, map[string]string{ 7126 "name": c.name, 7127 }) 7128 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7129} 7130 7131// Do executes the "privateca.projects.locations.certificateAuthorities.certificates.patch" call. 7132// Exactly one of *Certificate or error will be non-nil. Any non-2xx 7133// status code is an error. Response headers are in either 7134// *Certificate.ServerResponse.Header or (if a response was returned at 7135// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7136// to check whether the returned error was because 7137// http.StatusNotModified was returned. 7138func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) Do(opts ...googleapi.CallOption) (*Certificate, error) { 7139 gensupport.SetOptions(c.urlParams_, opts...) 7140 res, err := c.doRequest("json") 7141 if res != nil && res.StatusCode == http.StatusNotModified { 7142 if res.Body != nil { 7143 res.Body.Close() 7144 } 7145 return nil, &googleapi.Error{ 7146 Code: res.StatusCode, 7147 Header: res.Header, 7148 } 7149 } 7150 if err != nil { 7151 return nil, err 7152 } 7153 defer googleapi.CloseBody(res) 7154 if err := googleapi.CheckResponse(res); err != nil { 7155 return nil, err 7156 } 7157 ret := &Certificate{ 7158 ServerResponse: googleapi.ServerResponse{ 7159 Header: res.Header, 7160 HTTPStatusCode: res.StatusCode, 7161 }, 7162 } 7163 target := &ret 7164 if err := gensupport.DecodeResponse(target, res); err != nil { 7165 return nil, err 7166 } 7167 return ret, nil 7168 // { 7169 // "description": "Update a Certificate. Currently, the only field you can update is the labels field.", 7170 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificates/{certificatesId}", 7171 // "httpMethod": "PATCH", 7172 // "id": "privateca.projects.locations.certificateAuthorities.certificates.patch", 7173 // "parameterOrder": [ 7174 // "name" 7175 // ], 7176 // "parameters": { 7177 // "name": { 7178 // "description": "Output only. The resource path for this Certificate in the format `projects/*/locations/*/certificateAuthorities/*/certificates/*`.", 7179 // "location": "path", 7180 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+$", 7181 // "required": true, 7182 // "type": "string" 7183 // }, 7184 // "requestId": { 7185 // "description": "Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", 7186 // "location": "query", 7187 // "type": "string" 7188 // }, 7189 // "updateMask": { 7190 // "description": "Required. A list of fields to be updated in this request.", 7191 // "format": "google-fieldmask", 7192 // "location": "query", 7193 // "type": "string" 7194 // } 7195 // }, 7196 // "path": "v1beta1/{+name}", 7197 // "request": { 7198 // "$ref": "Certificate" 7199 // }, 7200 // "response": { 7201 // "$ref": "Certificate" 7202 // }, 7203 // "scopes": [ 7204 // "https://www.googleapis.com/auth/cloud-platform" 7205 // ] 7206 // } 7207 7208} 7209 7210// method id "privateca.projects.locations.certificateAuthorities.certificates.revoke": 7211 7212type ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall struct { 7213 s *Service 7214 name string 7215 revokecertificaterequest *RevokeCertificateRequest 7216 urlParams_ gensupport.URLParams 7217 ctx_ context.Context 7218 header_ http.Header 7219} 7220 7221// Revoke: Revoke a Certificate. 7222// 7223// - name: The resource name for this Certificate in the format 7224// `projects/*/locations/*/certificateAuthorities/*/certificates/*`. 7225func (r *ProjectsLocationsCertificateAuthoritiesCertificatesService) Revoke(name string, revokecertificaterequest *RevokeCertificateRequest) *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall { 7226 c := &ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7227 c.name = name 7228 c.revokecertificaterequest = revokecertificaterequest 7229 return c 7230} 7231 7232// Fields allows partial responses to be retrieved. See 7233// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7234// for more information. 7235func (c *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall { 7236 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7237 return c 7238} 7239 7240// Context sets the context to be used in this call's Do method. Any 7241// pending HTTP request will be aborted if the provided context is 7242// canceled. 7243func (c *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall) Context(ctx context.Context) *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall { 7244 c.ctx_ = ctx 7245 return c 7246} 7247 7248// Header returns an http.Header that can be modified by the caller to 7249// add HTTP headers to the request. 7250func (c *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall) Header() http.Header { 7251 if c.header_ == nil { 7252 c.header_ = make(http.Header) 7253 } 7254 return c.header_ 7255} 7256 7257func (c *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall) doRequest(alt string) (*http.Response, error) { 7258 reqHeaders := make(http.Header) 7259 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7260 for k, v := range c.header_ { 7261 reqHeaders[k] = v 7262 } 7263 reqHeaders.Set("User-Agent", c.s.userAgent()) 7264 var body io.Reader = nil 7265 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokecertificaterequest) 7266 if err != nil { 7267 return nil, err 7268 } 7269 reqHeaders.Set("Content-Type", "application/json") 7270 c.urlParams_.Set("alt", alt) 7271 c.urlParams_.Set("prettyPrint", "false") 7272 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:revoke") 7273 urls += "?" + c.urlParams_.Encode() 7274 req, err := http.NewRequest("POST", urls, body) 7275 if err != nil { 7276 return nil, err 7277 } 7278 req.Header = reqHeaders 7279 googleapi.Expand(req.URL, map[string]string{ 7280 "name": c.name, 7281 }) 7282 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7283} 7284 7285// Do executes the "privateca.projects.locations.certificateAuthorities.certificates.revoke" call. 7286// Exactly one of *Certificate or error will be non-nil. Any non-2xx 7287// status code is an error. Response headers are in either 7288// *Certificate.ServerResponse.Header or (if a response was returned at 7289// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7290// to check whether the returned error was because 7291// http.StatusNotModified was returned. 7292func (c *ProjectsLocationsCertificateAuthoritiesCertificatesRevokeCall) Do(opts ...googleapi.CallOption) (*Certificate, error) { 7293 gensupport.SetOptions(c.urlParams_, opts...) 7294 res, err := c.doRequest("json") 7295 if res != nil && res.StatusCode == http.StatusNotModified { 7296 if res.Body != nil { 7297 res.Body.Close() 7298 } 7299 return nil, &googleapi.Error{ 7300 Code: res.StatusCode, 7301 Header: res.Header, 7302 } 7303 } 7304 if err != nil { 7305 return nil, err 7306 } 7307 defer googleapi.CloseBody(res) 7308 if err := googleapi.CheckResponse(res); err != nil { 7309 return nil, err 7310 } 7311 ret := &Certificate{ 7312 ServerResponse: googleapi.ServerResponse{ 7313 Header: res.Header, 7314 HTTPStatusCode: res.StatusCode, 7315 }, 7316 } 7317 target := &ret 7318 if err := gensupport.DecodeResponse(target, res); err != nil { 7319 return nil, err 7320 } 7321 return ret, nil 7322 // { 7323 // "description": "Revoke a Certificate.", 7324 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/certificateAuthorities/{certificateAuthoritiesId}/certificates/{certificatesId}:revoke", 7325 // "httpMethod": "POST", 7326 // "id": "privateca.projects.locations.certificateAuthorities.certificates.revoke", 7327 // "parameterOrder": [ 7328 // "name" 7329 // ], 7330 // "parameters": { 7331 // "name": { 7332 // "description": "Required. The resource name for this Certificate in the format `projects/*/locations/*/certificateAuthorities/*/certificates/*`.", 7333 // "location": "path", 7334 // "pattern": "^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+$", 7335 // "required": true, 7336 // "type": "string" 7337 // } 7338 // }, 7339 // "path": "v1beta1/{+name}:revoke", 7340 // "request": { 7341 // "$ref": "RevokeCertificateRequest" 7342 // }, 7343 // "response": { 7344 // "$ref": "Certificate" 7345 // }, 7346 // "scopes": [ 7347 // "https://www.googleapis.com/auth/cloud-platform" 7348 // ] 7349 // } 7350 7351} 7352 7353// method id "privateca.projects.locations.operations.cancel": 7354 7355type ProjectsLocationsOperationsCancelCall struct { 7356 s *Service 7357 name string 7358 canceloperationrequest *CancelOperationRequest 7359 urlParams_ gensupport.URLParams 7360 ctx_ context.Context 7361 header_ http.Header 7362} 7363 7364// Cancel: Starts asynchronous cancellation on a long-running operation. 7365// The server makes a best effort to cancel the operation, but success 7366// is not guaranteed. If the server doesn't support this method, it 7367// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 7368// Operations.GetOperation or other methods to check whether the 7369// cancellation succeeded or whether the operation completed despite 7370// cancellation. On successful cancellation, the operation is not 7371// deleted; instead, it becomes an operation with an Operation.error 7372// value with a google.rpc.Status.code of 1, corresponding to 7373// `Code.CANCELLED`. 7374// 7375// - name: The name of the operation resource to be cancelled. 7376func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 7377 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7378 c.name = name 7379 c.canceloperationrequest = canceloperationrequest 7380 return c 7381} 7382 7383// Fields allows partial responses to be retrieved. See 7384// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7385// for more information. 7386func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 7387 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7388 return c 7389} 7390 7391// Context sets the context to be used in this call's Do method. Any 7392// pending HTTP request will be aborted if the provided context is 7393// canceled. 7394func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 7395 c.ctx_ = ctx 7396 return c 7397} 7398 7399// Header returns an http.Header that can be modified by the caller to 7400// add HTTP headers to the request. 7401func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 7402 if c.header_ == nil { 7403 c.header_ = make(http.Header) 7404 } 7405 return c.header_ 7406} 7407 7408func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 7409 reqHeaders := make(http.Header) 7410 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7411 for k, v := range c.header_ { 7412 reqHeaders[k] = v 7413 } 7414 reqHeaders.Set("User-Agent", c.s.userAgent()) 7415 var body io.Reader = nil 7416 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 7417 if err != nil { 7418 return nil, err 7419 } 7420 reqHeaders.Set("Content-Type", "application/json") 7421 c.urlParams_.Set("alt", alt) 7422 c.urlParams_.Set("prettyPrint", "false") 7423 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 7424 urls += "?" + c.urlParams_.Encode() 7425 req, err := http.NewRequest("POST", urls, body) 7426 if err != nil { 7427 return nil, err 7428 } 7429 req.Header = reqHeaders 7430 googleapi.Expand(req.URL, map[string]string{ 7431 "name": c.name, 7432 }) 7433 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7434} 7435 7436// Do executes the "privateca.projects.locations.operations.cancel" call. 7437// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7438// code is an error. Response headers are in either 7439// *Empty.ServerResponse.Header or (if a response was returned at all) 7440// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7441// check whether the returned error was because http.StatusNotModified 7442// was returned. 7443func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7444 gensupport.SetOptions(c.urlParams_, opts...) 7445 res, err := c.doRequest("json") 7446 if res != nil && res.StatusCode == http.StatusNotModified { 7447 if res.Body != nil { 7448 res.Body.Close() 7449 } 7450 return nil, &googleapi.Error{ 7451 Code: res.StatusCode, 7452 Header: res.Header, 7453 } 7454 } 7455 if err != nil { 7456 return nil, err 7457 } 7458 defer googleapi.CloseBody(res) 7459 if err := googleapi.CheckResponse(res); err != nil { 7460 return nil, err 7461 } 7462 ret := &Empty{ 7463 ServerResponse: googleapi.ServerResponse{ 7464 Header: res.Header, 7465 HTTPStatusCode: res.StatusCode, 7466 }, 7467 } 7468 target := &ret 7469 if err := gensupport.DecodeResponse(target, res); err != nil { 7470 return nil, err 7471 } 7472 return ret, nil 7473 // { 7474 // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", 7475 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 7476 // "httpMethod": "POST", 7477 // "id": "privateca.projects.locations.operations.cancel", 7478 // "parameterOrder": [ 7479 // "name" 7480 // ], 7481 // "parameters": { 7482 // "name": { 7483 // "description": "The name of the operation resource to be cancelled.", 7484 // "location": "path", 7485 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 7486 // "required": true, 7487 // "type": "string" 7488 // } 7489 // }, 7490 // "path": "v1beta1/{+name}:cancel", 7491 // "request": { 7492 // "$ref": "CancelOperationRequest" 7493 // }, 7494 // "response": { 7495 // "$ref": "Empty" 7496 // }, 7497 // "scopes": [ 7498 // "https://www.googleapis.com/auth/cloud-platform" 7499 // ] 7500 // } 7501 7502} 7503 7504// method id "privateca.projects.locations.operations.delete": 7505 7506type ProjectsLocationsOperationsDeleteCall struct { 7507 s *Service 7508 name string 7509 urlParams_ gensupport.URLParams 7510 ctx_ context.Context 7511 header_ http.Header 7512} 7513 7514// Delete: Deletes a long-running operation. This method indicates that 7515// the client is no longer interested in the operation result. It does 7516// not cancel the operation. If the server doesn't support this method, 7517// it returns `google.rpc.Code.UNIMPLEMENTED`. 7518// 7519// - name: The name of the operation resource to be deleted. 7520func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { 7521 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7522 c.name = name 7523 return c 7524} 7525 7526// Fields allows partial responses to be retrieved. See 7527// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7528// for more information. 7529func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { 7530 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7531 return c 7532} 7533 7534// Context sets the context to be used in this call's Do method. Any 7535// pending HTTP request will be aborted if the provided context is 7536// canceled. 7537func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { 7538 c.ctx_ = ctx 7539 return c 7540} 7541 7542// Header returns an http.Header that can be modified by the caller to 7543// add HTTP headers to the request. 7544func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { 7545 if c.header_ == nil { 7546 c.header_ = make(http.Header) 7547 } 7548 return c.header_ 7549} 7550 7551func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 7552 reqHeaders := make(http.Header) 7553 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7554 for k, v := range c.header_ { 7555 reqHeaders[k] = v 7556 } 7557 reqHeaders.Set("User-Agent", c.s.userAgent()) 7558 var body io.Reader = nil 7559 c.urlParams_.Set("alt", alt) 7560 c.urlParams_.Set("prettyPrint", "false") 7561 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7562 urls += "?" + c.urlParams_.Encode() 7563 req, err := http.NewRequest("DELETE", urls, body) 7564 if err != nil { 7565 return nil, err 7566 } 7567 req.Header = reqHeaders 7568 googleapi.Expand(req.URL, map[string]string{ 7569 "name": c.name, 7570 }) 7571 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7572} 7573 7574// Do executes the "privateca.projects.locations.operations.delete" call. 7575// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7576// code is an error. Response headers are in either 7577// *Empty.ServerResponse.Header or (if a response was returned at all) 7578// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7579// check whether the returned error was because http.StatusNotModified 7580// was returned. 7581func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7582 gensupport.SetOptions(c.urlParams_, opts...) 7583 res, err := c.doRequest("json") 7584 if res != nil && res.StatusCode == http.StatusNotModified { 7585 if res.Body != nil { 7586 res.Body.Close() 7587 } 7588 return nil, &googleapi.Error{ 7589 Code: res.StatusCode, 7590 Header: res.Header, 7591 } 7592 } 7593 if err != nil { 7594 return nil, err 7595 } 7596 defer googleapi.CloseBody(res) 7597 if err := googleapi.CheckResponse(res); err != nil { 7598 return nil, err 7599 } 7600 ret := &Empty{ 7601 ServerResponse: googleapi.ServerResponse{ 7602 Header: res.Header, 7603 HTTPStatusCode: res.StatusCode, 7604 }, 7605 } 7606 target := &ret 7607 if err := gensupport.DecodeResponse(target, res); err != nil { 7608 return nil, err 7609 } 7610 return ret, nil 7611 // { 7612 // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", 7613 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 7614 // "httpMethod": "DELETE", 7615 // "id": "privateca.projects.locations.operations.delete", 7616 // "parameterOrder": [ 7617 // "name" 7618 // ], 7619 // "parameters": { 7620 // "name": { 7621 // "description": "The name of the operation resource to be deleted.", 7622 // "location": "path", 7623 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 7624 // "required": true, 7625 // "type": "string" 7626 // } 7627 // }, 7628 // "path": "v1beta1/{+name}", 7629 // "response": { 7630 // "$ref": "Empty" 7631 // }, 7632 // "scopes": [ 7633 // "https://www.googleapis.com/auth/cloud-platform" 7634 // ] 7635 // } 7636 7637} 7638 7639// method id "privateca.projects.locations.operations.get": 7640 7641type ProjectsLocationsOperationsGetCall struct { 7642 s *Service 7643 name string 7644 urlParams_ gensupport.URLParams 7645 ifNoneMatch_ string 7646 ctx_ context.Context 7647 header_ http.Header 7648} 7649 7650// Get: Gets the latest state of a long-running operation. Clients can 7651// use this method to poll the operation result at intervals as 7652// recommended by the API service. 7653// 7654// - name: The name of the operation resource. 7655func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 7656 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7657 c.name = name 7658 return c 7659} 7660 7661// Fields allows partial responses to be retrieved. See 7662// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7663// for more information. 7664func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 7665 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7666 return c 7667} 7668 7669// IfNoneMatch sets the optional parameter which makes the operation 7670// fail if the object's ETag matches the given value. This is useful for 7671// getting updates only after the object has changed since the last 7672// request. Use googleapi.IsNotModified to check whether the response 7673// error from Do is the result of In-None-Match. 7674func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 7675 c.ifNoneMatch_ = entityTag 7676 return c 7677} 7678 7679// Context sets the context to be used in this call's Do method. Any 7680// pending HTTP request will be aborted if the provided context is 7681// canceled. 7682func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 7683 c.ctx_ = ctx 7684 return c 7685} 7686 7687// Header returns an http.Header that can be modified by the caller to 7688// add HTTP headers to the request. 7689func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 7690 if c.header_ == nil { 7691 c.header_ = make(http.Header) 7692 } 7693 return c.header_ 7694} 7695 7696func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 7697 reqHeaders := make(http.Header) 7698 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7699 for k, v := range c.header_ { 7700 reqHeaders[k] = v 7701 } 7702 reqHeaders.Set("User-Agent", c.s.userAgent()) 7703 if c.ifNoneMatch_ != "" { 7704 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7705 } 7706 var body io.Reader = nil 7707 c.urlParams_.Set("alt", alt) 7708 c.urlParams_.Set("prettyPrint", "false") 7709 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7710 urls += "?" + c.urlParams_.Encode() 7711 req, err := http.NewRequest("GET", urls, body) 7712 if err != nil { 7713 return nil, err 7714 } 7715 req.Header = reqHeaders 7716 googleapi.Expand(req.URL, map[string]string{ 7717 "name": c.name, 7718 }) 7719 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7720} 7721 7722// Do executes the "privateca.projects.locations.operations.get" call. 7723// Exactly one of *Operation or error will be non-nil. Any non-2xx 7724// status code is an error. Response headers are in either 7725// *Operation.ServerResponse.Header or (if a response was returned at 7726// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7727// to check whether the returned error was because 7728// http.StatusNotModified was returned. 7729func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7730 gensupport.SetOptions(c.urlParams_, opts...) 7731 res, err := c.doRequest("json") 7732 if res != nil && res.StatusCode == http.StatusNotModified { 7733 if res.Body != nil { 7734 res.Body.Close() 7735 } 7736 return nil, &googleapi.Error{ 7737 Code: res.StatusCode, 7738 Header: res.Header, 7739 } 7740 } 7741 if err != nil { 7742 return nil, err 7743 } 7744 defer googleapi.CloseBody(res) 7745 if err := googleapi.CheckResponse(res); err != nil { 7746 return nil, err 7747 } 7748 ret := &Operation{ 7749 ServerResponse: googleapi.ServerResponse{ 7750 Header: res.Header, 7751 HTTPStatusCode: res.StatusCode, 7752 }, 7753 } 7754 target := &ret 7755 if err := gensupport.DecodeResponse(target, res); err != nil { 7756 return nil, err 7757 } 7758 return ret, nil 7759 // { 7760 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 7761 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 7762 // "httpMethod": "GET", 7763 // "id": "privateca.projects.locations.operations.get", 7764 // "parameterOrder": [ 7765 // "name" 7766 // ], 7767 // "parameters": { 7768 // "name": { 7769 // "description": "The name of the operation resource.", 7770 // "location": "path", 7771 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 7772 // "required": true, 7773 // "type": "string" 7774 // } 7775 // }, 7776 // "path": "v1beta1/{+name}", 7777 // "response": { 7778 // "$ref": "Operation" 7779 // }, 7780 // "scopes": [ 7781 // "https://www.googleapis.com/auth/cloud-platform" 7782 // ] 7783 // } 7784 7785} 7786 7787// method id "privateca.projects.locations.operations.list": 7788 7789type ProjectsLocationsOperationsListCall struct { 7790 s *Service 7791 name string 7792 urlParams_ gensupport.URLParams 7793 ifNoneMatch_ string 7794 ctx_ context.Context 7795 header_ http.Header 7796} 7797 7798// List: Lists operations that match the specified filter in the 7799// request. If the server doesn't support this method, it returns 7800// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to 7801// override the binding to use different resource name schemes, such as 7802// `users/*/operations`. To override the binding, API services can add a 7803// binding such as "/v1/{name=users/*}/operations" to their service 7804// configuration. For backwards compatibility, the default name includes 7805// the operations collection id, however overriding users must ensure 7806// the name binding is the parent resource, without the operations 7807// collection id. 7808// 7809// - name: The name of the operation's parent resource. 7810func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 7811 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7812 c.name = name 7813 return c 7814} 7815 7816// Filter sets the optional parameter "filter": The standard list 7817// filter. 7818func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 7819 c.urlParams_.Set("filter", filter) 7820 return c 7821} 7822 7823// PageSize sets the optional parameter "pageSize": The standard list 7824// page size. 7825func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 7826 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7827 return c 7828} 7829 7830// PageToken sets the optional parameter "pageToken": The standard list 7831// page token. 7832func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 7833 c.urlParams_.Set("pageToken", pageToken) 7834 return c 7835} 7836 7837// Fields allows partial responses to be retrieved. See 7838// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7839// for more information. 7840func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 7841 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7842 return c 7843} 7844 7845// IfNoneMatch sets the optional parameter which makes the operation 7846// fail if the object's ETag matches the given value. This is useful for 7847// getting updates only after the object has changed since the last 7848// request. Use googleapi.IsNotModified to check whether the response 7849// error from Do is the result of In-None-Match. 7850func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 7851 c.ifNoneMatch_ = entityTag 7852 return c 7853} 7854 7855// Context sets the context to be used in this call's Do method. Any 7856// pending HTTP request will be aborted if the provided context is 7857// canceled. 7858func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 7859 c.ctx_ = ctx 7860 return c 7861} 7862 7863// Header returns an http.Header that can be modified by the caller to 7864// add HTTP headers to the request. 7865func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 7866 if c.header_ == nil { 7867 c.header_ = make(http.Header) 7868 } 7869 return c.header_ 7870} 7871 7872func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 7873 reqHeaders := make(http.Header) 7874 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7875 for k, v := range c.header_ { 7876 reqHeaders[k] = v 7877 } 7878 reqHeaders.Set("User-Agent", c.s.userAgent()) 7879 if c.ifNoneMatch_ != "" { 7880 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7881 } 7882 var body io.Reader = nil 7883 c.urlParams_.Set("alt", alt) 7884 c.urlParams_.Set("prettyPrint", "false") 7885 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") 7886 urls += "?" + c.urlParams_.Encode() 7887 req, err := http.NewRequest("GET", urls, body) 7888 if err != nil { 7889 return nil, err 7890 } 7891 req.Header = reqHeaders 7892 googleapi.Expand(req.URL, map[string]string{ 7893 "name": c.name, 7894 }) 7895 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7896} 7897 7898// Do executes the "privateca.projects.locations.operations.list" call. 7899// Exactly one of *ListOperationsResponse or error will be non-nil. Any 7900// non-2xx status code is an error. Response headers are in either 7901// *ListOperationsResponse.ServerResponse.Header or (if a response was 7902// returned at all) in error.(*googleapi.Error).Header. Use 7903// googleapi.IsNotModified to check whether the returned error was 7904// because http.StatusNotModified was returned. 7905func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 7906 gensupport.SetOptions(c.urlParams_, opts...) 7907 res, err := c.doRequest("json") 7908 if res != nil && res.StatusCode == http.StatusNotModified { 7909 if res.Body != nil { 7910 res.Body.Close() 7911 } 7912 return nil, &googleapi.Error{ 7913 Code: res.StatusCode, 7914 Header: res.Header, 7915 } 7916 } 7917 if err != nil { 7918 return nil, err 7919 } 7920 defer googleapi.CloseBody(res) 7921 if err := googleapi.CheckResponse(res); err != nil { 7922 return nil, err 7923 } 7924 ret := &ListOperationsResponse{ 7925 ServerResponse: googleapi.ServerResponse{ 7926 Header: res.Header, 7927 HTTPStatusCode: res.StatusCode, 7928 }, 7929 } 7930 target := &ret 7931 if err := gensupport.DecodeResponse(target, res); err != nil { 7932 return nil, err 7933 } 7934 return ret, nil 7935 // { 7936 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 7937 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations", 7938 // "httpMethod": "GET", 7939 // "id": "privateca.projects.locations.operations.list", 7940 // "parameterOrder": [ 7941 // "name" 7942 // ], 7943 // "parameters": { 7944 // "filter": { 7945 // "description": "The standard list filter.", 7946 // "location": "query", 7947 // "type": "string" 7948 // }, 7949 // "name": { 7950 // "description": "The name of the operation's parent resource.", 7951 // "location": "path", 7952 // "pattern": "^projects/[^/]+/locations/[^/]+$", 7953 // "required": true, 7954 // "type": "string" 7955 // }, 7956 // "pageSize": { 7957 // "description": "The standard list page size.", 7958 // "format": "int32", 7959 // "location": "query", 7960 // "type": "integer" 7961 // }, 7962 // "pageToken": { 7963 // "description": "The standard list page token.", 7964 // "location": "query", 7965 // "type": "string" 7966 // } 7967 // }, 7968 // "path": "v1beta1/{+name}/operations", 7969 // "response": { 7970 // "$ref": "ListOperationsResponse" 7971 // }, 7972 // "scopes": [ 7973 // "https://www.googleapis.com/auth/cloud-platform" 7974 // ] 7975 // } 7976 7977} 7978 7979// Pages invokes f for each page of results. 7980// A non-nil error returned from f will halt the iteration. 7981// The provided context supersedes any context provided to the Context method. 7982func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 7983 c.ctx_ = ctx 7984 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7985 for { 7986 x, err := c.Do() 7987 if err != nil { 7988 return err 7989 } 7990 if err := f(x); err != nil { 7991 return err 7992 } 7993 if x.NextPageToken == "" { 7994 return nil 7995 } 7996 c.PageToken(x.NextPageToken) 7997 } 7998} 7999 8000// method id "privateca.projects.locations.reusableConfigs.get": 8001 8002type ProjectsLocationsReusableConfigsGetCall struct { 8003 s *Service 8004 name string 8005 urlParams_ gensupport.URLParams 8006 ifNoneMatch_ string 8007 ctx_ context.Context 8008 header_ http.Header 8009} 8010 8011// Get: Returns a ReusableConfig. 8012// 8013// - name: The name of the ReusableConfigs to get. 8014func (r *ProjectsLocationsReusableConfigsService) Get(name string) *ProjectsLocationsReusableConfigsGetCall { 8015 c := &ProjectsLocationsReusableConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8016 c.name = name 8017 return c 8018} 8019 8020// Fields allows partial responses to be retrieved. See 8021// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8022// for more information. 8023func (c *ProjectsLocationsReusableConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsGetCall { 8024 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8025 return c 8026} 8027 8028// IfNoneMatch sets the optional parameter which makes the operation 8029// fail if the object's ETag matches the given value. This is useful for 8030// getting updates only after the object has changed since the last 8031// request. Use googleapi.IsNotModified to check whether the response 8032// error from Do is the result of In-None-Match. 8033func (c *ProjectsLocationsReusableConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReusableConfigsGetCall { 8034 c.ifNoneMatch_ = entityTag 8035 return c 8036} 8037 8038// Context sets the context to be used in this call's Do method. Any 8039// pending HTTP request will be aborted if the provided context is 8040// canceled. 8041func (c *ProjectsLocationsReusableConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsGetCall { 8042 c.ctx_ = ctx 8043 return c 8044} 8045 8046// Header returns an http.Header that can be modified by the caller to 8047// add HTTP headers to the request. 8048func (c *ProjectsLocationsReusableConfigsGetCall) Header() http.Header { 8049 if c.header_ == nil { 8050 c.header_ = make(http.Header) 8051 } 8052 return c.header_ 8053} 8054 8055func (c *ProjectsLocationsReusableConfigsGetCall) doRequest(alt string) (*http.Response, error) { 8056 reqHeaders := make(http.Header) 8057 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8058 for k, v := range c.header_ { 8059 reqHeaders[k] = v 8060 } 8061 reqHeaders.Set("User-Agent", c.s.userAgent()) 8062 if c.ifNoneMatch_ != "" { 8063 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8064 } 8065 var body io.Reader = nil 8066 c.urlParams_.Set("alt", alt) 8067 c.urlParams_.Set("prettyPrint", "false") 8068 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 8069 urls += "?" + c.urlParams_.Encode() 8070 req, err := http.NewRequest("GET", urls, body) 8071 if err != nil { 8072 return nil, err 8073 } 8074 req.Header = reqHeaders 8075 googleapi.Expand(req.URL, map[string]string{ 8076 "name": c.name, 8077 }) 8078 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8079} 8080 8081// Do executes the "privateca.projects.locations.reusableConfigs.get" call. 8082// Exactly one of *ReusableConfig or error will be non-nil. Any non-2xx 8083// status code is an error. Response headers are in either 8084// *ReusableConfig.ServerResponse.Header or (if a response was returned 8085// at all) in error.(*googleapi.Error).Header. Use 8086// googleapi.IsNotModified to check whether the returned error was 8087// because http.StatusNotModified was returned. 8088func (c *ProjectsLocationsReusableConfigsGetCall) Do(opts ...googleapi.CallOption) (*ReusableConfig, error) { 8089 gensupport.SetOptions(c.urlParams_, opts...) 8090 res, err := c.doRequest("json") 8091 if res != nil && res.StatusCode == http.StatusNotModified { 8092 if res.Body != nil { 8093 res.Body.Close() 8094 } 8095 return nil, &googleapi.Error{ 8096 Code: res.StatusCode, 8097 Header: res.Header, 8098 } 8099 } 8100 if err != nil { 8101 return nil, err 8102 } 8103 defer googleapi.CloseBody(res) 8104 if err := googleapi.CheckResponse(res); err != nil { 8105 return nil, err 8106 } 8107 ret := &ReusableConfig{ 8108 ServerResponse: googleapi.ServerResponse{ 8109 Header: res.Header, 8110 HTTPStatusCode: res.StatusCode, 8111 }, 8112 } 8113 target := &ret 8114 if err := gensupport.DecodeResponse(target, res); err != nil { 8115 return nil, err 8116 } 8117 return ret, nil 8118 // { 8119 // "description": "Returns a ReusableConfig.", 8120 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/reusableConfigs/{reusableConfigsId}", 8121 // "httpMethod": "GET", 8122 // "id": "privateca.projects.locations.reusableConfigs.get", 8123 // "parameterOrder": [ 8124 // "name" 8125 // ], 8126 // "parameters": { 8127 // "name": { 8128 // "description": "Required. The name of the ReusableConfigs to get.", 8129 // "location": "path", 8130 // "pattern": "^projects/[^/]+/locations/[^/]+/reusableConfigs/[^/]+$", 8131 // "required": true, 8132 // "type": "string" 8133 // } 8134 // }, 8135 // "path": "v1beta1/{+name}", 8136 // "response": { 8137 // "$ref": "ReusableConfig" 8138 // }, 8139 // "scopes": [ 8140 // "https://www.googleapis.com/auth/cloud-platform" 8141 // ] 8142 // } 8143 8144} 8145 8146// method id "privateca.projects.locations.reusableConfigs.getIamPolicy": 8147 8148type ProjectsLocationsReusableConfigsGetIamPolicyCall struct { 8149 s *Service 8150 resource string 8151 urlParams_ gensupport.URLParams 8152 ifNoneMatch_ string 8153 ctx_ context.Context 8154 header_ http.Header 8155} 8156 8157// GetIamPolicy: Gets the access control policy for a resource. Returns 8158// an empty policy if the resource exists and does not have a policy 8159// set. 8160// 8161// - resource: REQUIRED: The resource for which the policy is being 8162// requested. See the operation documentation for the appropriate 8163// value for this field. 8164func (r *ProjectsLocationsReusableConfigsService) GetIamPolicy(resource string) *ProjectsLocationsReusableConfigsGetIamPolicyCall { 8165 c := &ProjectsLocationsReusableConfigsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8166 c.resource = resource 8167 return c 8168} 8169 8170// OptionsRequestedPolicyVersion sets the optional parameter 8171// "options.requestedPolicyVersion": The policy format version to be 8172// returned. Valid values are 0, 1, and 3. Requests specifying an 8173// invalid value will be rejected. Requests for policies with any 8174// conditional bindings must specify version 3. Policies without any 8175// conditional bindings may specify any valid value or leave the field 8176// unset. To learn which resources support conditions in their IAM 8177// policies, see the IAM documentation 8178// (https://cloud.google.com/iam/help/conditions/resource-policies). 8179func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsReusableConfigsGetIamPolicyCall { 8180 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 8181 return c 8182} 8183 8184// Fields allows partial responses to be retrieved. See 8185// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8186// for more information. 8187func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsGetIamPolicyCall { 8188 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8189 return c 8190} 8191 8192// IfNoneMatch sets the optional parameter which makes the operation 8193// fail if the object's ETag matches the given value. This is useful for 8194// getting updates only after the object has changed since the last 8195// request. Use googleapi.IsNotModified to check whether the response 8196// error from Do is the result of In-None-Match. 8197func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsReusableConfigsGetIamPolicyCall { 8198 c.ifNoneMatch_ = entityTag 8199 return c 8200} 8201 8202// Context sets the context to be used in this call's Do method. Any 8203// pending HTTP request will be aborted if the provided context is 8204// canceled. 8205func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsGetIamPolicyCall { 8206 c.ctx_ = ctx 8207 return c 8208} 8209 8210// Header returns an http.Header that can be modified by the caller to 8211// add HTTP headers to the request. 8212func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Header() http.Header { 8213 if c.header_ == nil { 8214 c.header_ = make(http.Header) 8215 } 8216 return c.header_ 8217} 8218 8219func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 8220 reqHeaders := make(http.Header) 8221 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8222 for k, v := range c.header_ { 8223 reqHeaders[k] = v 8224 } 8225 reqHeaders.Set("User-Agent", c.s.userAgent()) 8226 if c.ifNoneMatch_ != "" { 8227 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8228 } 8229 var body io.Reader = nil 8230 c.urlParams_.Set("alt", alt) 8231 c.urlParams_.Set("prettyPrint", "false") 8232 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") 8233 urls += "?" + c.urlParams_.Encode() 8234 req, err := http.NewRequest("GET", urls, body) 8235 if err != nil { 8236 return nil, err 8237 } 8238 req.Header = reqHeaders 8239 googleapi.Expand(req.URL, map[string]string{ 8240 "resource": c.resource, 8241 }) 8242 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8243} 8244 8245// Do executes the "privateca.projects.locations.reusableConfigs.getIamPolicy" call. 8246// Exactly one of *Policy or error will be non-nil. Any non-2xx status 8247// code is an error. Response headers are in either 8248// *Policy.ServerResponse.Header or (if a response was returned at all) 8249// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8250// check whether the returned error was because http.StatusNotModified 8251// was returned. 8252func (c *ProjectsLocationsReusableConfigsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 8253 gensupport.SetOptions(c.urlParams_, opts...) 8254 res, err := c.doRequest("json") 8255 if res != nil && res.StatusCode == http.StatusNotModified { 8256 if res.Body != nil { 8257 res.Body.Close() 8258 } 8259 return nil, &googleapi.Error{ 8260 Code: res.StatusCode, 8261 Header: res.Header, 8262 } 8263 } 8264 if err != nil { 8265 return nil, err 8266 } 8267 defer googleapi.CloseBody(res) 8268 if err := googleapi.CheckResponse(res); err != nil { 8269 return nil, err 8270 } 8271 ret := &Policy{ 8272 ServerResponse: googleapi.ServerResponse{ 8273 Header: res.Header, 8274 HTTPStatusCode: res.StatusCode, 8275 }, 8276 } 8277 target := &ret 8278 if err := gensupport.DecodeResponse(target, res); err != nil { 8279 return nil, err 8280 } 8281 return ret, nil 8282 // { 8283 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 8284 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/reusableConfigs/{reusableConfigsId}:getIamPolicy", 8285 // "httpMethod": "GET", 8286 // "id": "privateca.projects.locations.reusableConfigs.getIamPolicy", 8287 // "parameterOrder": [ 8288 // "resource" 8289 // ], 8290 // "parameters": { 8291 // "options.requestedPolicyVersion": { 8292 // "description": "Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", 8293 // "format": "int32", 8294 // "location": "query", 8295 // "type": "integer" 8296 // }, 8297 // "resource": { 8298 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 8299 // "location": "path", 8300 // "pattern": "^projects/[^/]+/locations/[^/]+/reusableConfigs/[^/]+$", 8301 // "required": true, 8302 // "type": "string" 8303 // } 8304 // }, 8305 // "path": "v1beta1/{+resource}:getIamPolicy", 8306 // "response": { 8307 // "$ref": "Policy" 8308 // }, 8309 // "scopes": [ 8310 // "https://www.googleapis.com/auth/cloud-platform" 8311 // ] 8312 // } 8313 8314} 8315 8316// method id "privateca.projects.locations.reusableConfigs.list": 8317 8318type ProjectsLocationsReusableConfigsListCall struct { 8319 s *Service 8320 parent string 8321 urlParams_ gensupport.URLParams 8322 ifNoneMatch_ string 8323 ctx_ context.Context 8324 header_ http.Header 8325} 8326 8327// List: Lists ReusableConfigs. 8328// 8329// - parent: The resource name of the location associated with the 8330// ReusableConfigs, in the format `projects/*/locations/*`. 8331func (r *ProjectsLocationsReusableConfigsService) List(parent string) *ProjectsLocationsReusableConfigsListCall { 8332 c := &ProjectsLocationsReusableConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8333 c.parent = parent 8334 return c 8335} 8336 8337// Filter sets the optional parameter "filter": Only include resources 8338// that match the filter in the response. 8339func (c *ProjectsLocationsReusableConfigsListCall) Filter(filter string) *ProjectsLocationsReusableConfigsListCall { 8340 c.urlParams_.Set("filter", filter) 8341 return c 8342} 8343 8344// OrderBy sets the optional parameter "orderBy": Specify how the 8345// results should be sorted. 8346func (c *ProjectsLocationsReusableConfigsListCall) OrderBy(orderBy string) *ProjectsLocationsReusableConfigsListCall { 8347 c.urlParams_.Set("orderBy", orderBy) 8348 return c 8349} 8350 8351// PageSize sets the optional parameter "pageSize": Limit on the number 8352// of ReusableConfigs to include in the response. Further 8353// ReusableConfigs can subsequently be obtained by including the 8354// ListReusableConfigsResponse.next_page_token in a subsequent request. 8355// If unspecified, the server will pick an appropriate default. 8356func (c *ProjectsLocationsReusableConfigsListCall) PageSize(pageSize int64) *ProjectsLocationsReusableConfigsListCall { 8357 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8358 return c 8359} 8360 8361// PageToken sets the optional parameter "pageToken": Pagination token, 8362// returned earlier via ListReusableConfigsResponse.next_page_token. 8363func (c *ProjectsLocationsReusableConfigsListCall) PageToken(pageToken string) *ProjectsLocationsReusableConfigsListCall { 8364 c.urlParams_.Set("pageToken", pageToken) 8365 return c 8366} 8367 8368// Fields allows partial responses to be retrieved. See 8369// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8370// for more information. 8371func (c *ProjectsLocationsReusableConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsListCall { 8372 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8373 return c 8374} 8375 8376// IfNoneMatch sets the optional parameter which makes the operation 8377// fail if the object's ETag matches the given value. This is useful for 8378// getting updates only after the object has changed since the last 8379// request. Use googleapi.IsNotModified to check whether the response 8380// error from Do is the result of In-None-Match. 8381func (c *ProjectsLocationsReusableConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReusableConfigsListCall { 8382 c.ifNoneMatch_ = entityTag 8383 return c 8384} 8385 8386// Context sets the context to be used in this call's Do method. Any 8387// pending HTTP request will be aborted if the provided context is 8388// canceled. 8389func (c *ProjectsLocationsReusableConfigsListCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsListCall { 8390 c.ctx_ = ctx 8391 return c 8392} 8393 8394// Header returns an http.Header that can be modified by the caller to 8395// add HTTP headers to the request. 8396func (c *ProjectsLocationsReusableConfigsListCall) Header() http.Header { 8397 if c.header_ == nil { 8398 c.header_ = make(http.Header) 8399 } 8400 return c.header_ 8401} 8402 8403func (c *ProjectsLocationsReusableConfigsListCall) doRequest(alt string) (*http.Response, error) { 8404 reqHeaders := make(http.Header) 8405 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8406 for k, v := range c.header_ { 8407 reqHeaders[k] = v 8408 } 8409 reqHeaders.Set("User-Agent", c.s.userAgent()) 8410 if c.ifNoneMatch_ != "" { 8411 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8412 } 8413 var body io.Reader = nil 8414 c.urlParams_.Set("alt", alt) 8415 c.urlParams_.Set("prettyPrint", "false") 8416 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/reusableConfigs") 8417 urls += "?" + c.urlParams_.Encode() 8418 req, err := http.NewRequest("GET", urls, body) 8419 if err != nil { 8420 return nil, err 8421 } 8422 req.Header = reqHeaders 8423 googleapi.Expand(req.URL, map[string]string{ 8424 "parent": c.parent, 8425 }) 8426 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8427} 8428 8429// Do executes the "privateca.projects.locations.reusableConfigs.list" call. 8430// Exactly one of *ListReusableConfigsResponse or error will be non-nil. 8431// Any non-2xx status code is an error. Response headers are in either 8432// *ListReusableConfigsResponse.ServerResponse.Header or (if a response 8433// was returned at all) in error.(*googleapi.Error).Header. Use 8434// googleapi.IsNotModified to check whether the returned error was 8435// because http.StatusNotModified was returned. 8436func (c *ProjectsLocationsReusableConfigsListCall) Do(opts ...googleapi.CallOption) (*ListReusableConfigsResponse, error) { 8437 gensupport.SetOptions(c.urlParams_, opts...) 8438 res, err := c.doRequest("json") 8439 if res != nil && res.StatusCode == http.StatusNotModified { 8440 if res.Body != nil { 8441 res.Body.Close() 8442 } 8443 return nil, &googleapi.Error{ 8444 Code: res.StatusCode, 8445 Header: res.Header, 8446 } 8447 } 8448 if err != nil { 8449 return nil, err 8450 } 8451 defer googleapi.CloseBody(res) 8452 if err := googleapi.CheckResponse(res); err != nil { 8453 return nil, err 8454 } 8455 ret := &ListReusableConfigsResponse{ 8456 ServerResponse: googleapi.ServerResponse{ 8457 Header: res.Header, 8458 HTTPStatusCode: res.StatusCode, 8459 }, 8460 } 8461 target := &ret 8462 if err := gensupport.DecodeResponse(target, res); err != nil { 8463 return nil, err 8464 } 8465 return ret, nil 8466 // { 8467 // "description": "Lists ReusableConfigs.", 8468 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/reusableConfigs", 8469 // "httpMethod": "GET", 8470 // "id": "privateca.projects.locations.reusableConfigs.list", 8471 // "parameterOrder": [ 8472 // "parent" 8473 // ], 8474 // "parameters": { 8475 // "filter": { 8476 // "description": "Optional. Only include resources that match the filter in the response.", 8477 // "location": "query", 8478 // "type": "string" 8479 // }, 8480 // "orderBy": { 8481 // "description": "Optional. Specify how the results should be sorted.", 8482 // "location": "query", 8483 // "type": "string" 8484 // }, 8485 // "pageSize": { 8486 // "description": "Optional. Limit on the number of ReusableConfigs to include in the response. Further ReusableConfigs can subsequently be obtained by including the ListReusableConfigsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.", 8487 // "format": "int32", 8488 // "location": "query", 8489 // "type": "integer" 8490 // }, 8491 // "pageToken": { 8492 // "description": "Optional. Pagination token, returned earlier via ListReusableConfigsResponse.next_page_token.", 8493 // "location": "query", 8494 // "type": "string" 8495 // }, 8496 // "parent": { 8497 // "description": "Required. The resource name of the location associated with the ReusableConfigs, in the format `projects/*/locations/*`.", 8498 // "location": "path", 8499 // "pattern": "^projects/[^/]+/locations/[^/]+$", 8500 // "required": true, 8501 // "type": "string" 8502 // } 8503 // }, 8504 // "path": "v1beta1/{+parent}/reusableConfigs", 8505 // "response": { 8506 // "$ref": "ListReusableConfigsResponse" 8507 // }, 8508 // "scopes": [ 8509 // "https://www.googleapis.com/auth/cloud-platform" 8510 // ] 8511 // } 8512 8513} 8514 8515// Pages invokes f for each page of results. 8516// A non-nil error returned from f will halt the iteration. 8517// The provided context supersedes any context provided to the Context method. 8518func (c *ProjectsLocationsReusableConfigsListCall) Pages(ctx context.Context, f func(*ListReusableConfigsResponse) error) error { 8519 c.ctx_ = ctx 8520 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8521 for { 8522 x, err := c.Do() 8523 if err != nil { 8524 return err 8525 } 8526 if err := f(x); err != nil { 8527 return err 8528 } 8529 if x.NextPageToken == "" { 8530 return nil 8531 } 8532 c.PageToken(x.NextPageToken) 8533 } 8534} 8535 8536// method id "privateca.projects.locations.reusableConfigs.setIamPolicy": 8537 8538type ProjectsLocationsReusableConfigsSetIamPolicyCall struct { 8539 s *Service 8540 resource string 8541 setiampolicyrequest *SetIamPolicyRequest 8542 urlParams_ gensupport.URLParams 8543 ctx_ context.Context 8544 header_ http.Header 8545} 8546 8547// SetIamPolicy: Sets the access control policy on the specified 8548// resource. Replaces any existing policy. Can return `NOT_FOUND`, 8549// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. 8550// 8551// - resource: REQUIRED: The resource for which the policy is being 8552// specified. See the operation documentation for the appropriate 8553// value for this field. 8554func (r *ProjectsLocationsReusableConfigsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsReusableConfigsSetIamPolicyCall { 8555 c := &ProjectsLocationsReusableConfigsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8556 c.resource = resource 8557 c.setiampolicyrequest = setiampolicyrequest 8558 return c 8559} 8560 8561// Fields allows partial responses to be retrieved. See 8562// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8563// for more information. 8564func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsSetIamPolicyCall { 8565 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8566 return c 8567} 8568 8569// Context sets the context to be used in this call's Do method. Any 8570// pending HTTP request will be aborted if the provided context is 8571// canceled. 8572func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsSetIamPolicyCall { 8573 c.ctx_ = ctx 8574 return c 8575} 8576 8577// Header returns an http.Header that can be modified by the caller to 8578// add HTTP headers to the request. 8579func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Header() http.Header { 8580 if c.header_ == nil { 8581 c.header_ = make(http.Header) 8582 } 8583 return c.header_ 8584} 8585 8586func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 8587 reqHeaders := make(http.Header) 8588 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8589 for k, v := range c.header_ { 8590 reqHeaders[k] = v 8591 } 8592 reqHeaders.Set("User-Agent", c.s.userAgent()) 8593 var body io.Reader = nil 8594 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 8595 if err != nil { 8596 return nil, err 8597 } 8598 reqHeaders.Set("Content-Type", "application/json") 8599 c.urlParams_.Set("alt", alt) 8600 c.urlParams_.Set("prettyPrint", "false") 8601 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") 8602 urls += "?" + c.urlParams_.Encode() 8603 req, err := http.NewRequest("POST", urls, body) 8604 if err != nil { 8605 return nil, err 8606 } 8607 req.Header = reqHeaders 8608 googleapi.Expand(req.URL, map[string]string{ 8609 "resource": c.resource, 8610 }) 8611 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8612} 8613 8614// Do executes the "privateca.projects.locations.reusableConfigs.setIamPolicy" call. 8615// Exactly one of *Policy or error will be non-nil. Any non-2xx status 8616// code is an error. Response headers are in either 8617// *Policy.ServerResponse.Header or (if a response was returned at all) 8618// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8619// check whether the returned error was because http.StatusNotModified 8620// was returned. 8621func (c *ProjectsLocationsReusableConfigsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 8622 gensupport.SetOptions(c.urlParams_, opts...) 8623 res, err := c.doRequest("json") 8624 if res != nil && res.StatusCode == http.StatusNotModified { 8625 if res.Body != nil { 8626 res.Body.Close() 8627 } 8628 return nil, &googleapi.Error{ 8629 Code: res.StatusCode, 8630 Header: res.Header, 8631 } 8632 } 8633 if err != nil { 8634 return nil, err 8635 } 8636 defer googleapi.CloseBody(res) 8637 if err := googleapi.CheckResponse(res); err != nil { 8638 return nil, err 8639 } 8640 ret := &Policy{ 8641 ServerResponse: googleapi.ServerResponse{ 8642 Header: res.Header, 8643 HTTPStatusCode: res.StatusCode, 8644 }, 8645 } 8646 target := &ret 8647 if err := gensupport.DecodeResponse(target, res); err != nil { 8648 return nil, err 8649 } 8650 return ret, nil 8651 // { 8652 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", 8653 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/reusableConfigs/{reusableConfigsId}:setIamPolicy", 8654 // "httpMethod": "POST", 8655 // "id": "privateca.projects.locations.reusableConfigs.setIamPolicy", 8656 // "parameterOrder": [ 8657 // "resource" 8658 // ], 8659 // "parameters": { 8660 // "resource": { 8661 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 8662 // "location": "path", 8663 // "pattern": "^projects/[^/]+/locations/[^/]+/reusableConfigs/[^/]+$", 8664 // "required": true, 8665 // "type": "string" 8666 // } 8667 // }, 8668 // "path": "v1beta1/{+resource}:setIamPolicy", 8669 // "request": { 8670 // "$ref": "SetIamPolicyRequest" 8671 // }, 8672 // "response": { 8673 // "$ref": "Policy" 8674 // }, 8675 // "scopes": [ 8676 // "https://www.googleapis.com/auth/cloud-platform" 8677 // ] 8678 // } 8679 8680} 8681 8682// method id "privateca.projects.locations.reusableConfigs.testIamPermissions": 8683 8684type ProjectsLocationsReusableConfigsTestIamPermissionsCall struct { 8685 s *Service 8686 resource string 8687 testiampermissionsrequest *TestIamPermissionsRequest 8688 urlParams_ gensupport.URLParams 8689 ctx_ context.Context 8690 header_ http.Header 8691} 8692 8693// TestIamPermissions: Returns permissions that a caller has on the 8694// specified resource. If the resource does not exist, this will return 8695// an empty set of permissions, not a `NOT_FOUND` error. Note: This 8696// operation is designed to be used for building permission-aware UIs 8697// and command-line tools, not for authorization checking. This 8698// operation may "fail open" without warning. 8699// 8700// - resource: REQUIRED: The resource for which the policy detail is 8701// being requested. See the operation documentation for the 8702// appropriate value for this field. 8703func (r *ProjectsLocationsReusableConfigsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsReusableConfigsTestIamPermissionsCall { 8704 c := &ProjectsLocationsReusableConfigsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8705 c.resource = resource 8706 c.testiampermissionsrequest = testiampermissionsrequest 8707 return c 8708} 8709 8710// Fields allows partial responses to be retrieved. See 8711// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8712// for more information. 8713func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsReusableConfigsTestIamPermissionsCall { 8714 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8715 return c 8716} 8717 8718// Context sets the context to be used in this call's Do method. Any 8719// pending HTTP request will be aborted if the provided context is 8720// canceled. 8721func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsReusableConfigsTestIamPermissionsCall { 8722 c.ctx_ = ctx 8723 return c 8724} 8725 8726// Header returns an http.Header that can be modified by the caller to 8727// add HTTP headers to the request. 8728func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Header() http.Header { 8729 if c.header_ == nil { 8730 c.header_ = make(http.Header) 8731 } 8732 return c.header_ 8733} 8734 8735func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 8736 reqHeaders := make(http.Header) 8737 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8738 for k, v := range c.header_ { 8739 reqHeaders[k] = v 8740 } 8741 reqHeaders.Set("User-Agent", c.s.userAgent()) 8742 var body io.Reader = nil 8743 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 8744 if err != nil { 8745 return nil, err 8746 } 8747 reqHeaders.Set("Content-Type", "application/json") 8748 c.urlParams_.Set("alt", alt) 8749 c.urlParams_.Set("prettyPrint", "false") 8750 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") 8751 urls += "?" + c.urlParams_.Encode() 8752 req, err := http.NewRequest("POST", urls, body) 8753 if err != nil { 8754 return nil, err 8755 } 8756 req.Header = reqHeaders 8757 googleapi.Expand(req.URL, map[string]string{ 8758 "resource": c.resource, 8759 }) 8760 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8761} 8762 8763// Do executes the "privateca.projects.locations.reusableConfigs.testIamPermissions" call. 8764// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 8765// Any non-2xx status code is an error. Response headers are in either 8766// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 8767// was returned at all) in error.(*googleapi.Error).Header. Use 8768// googleapi.IsNotModified to check whether the returned error was 8769// because http.StatusNotModified was returned. 8770func (c *ProjectsLocationsReusableConfigsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 8771 gensupport.SetOptions(c.urlParams_, opts...) 8772 res, err := c.doRequest("json") 8773 if res != nil && res.StatusCode == http.StatusNotModified { 8774 if res.Body != nil { 8775 res.Body.Close() 8776 } 8777 return nil, &googleapi.Error{ 8778 Code: res.StatusCode, 8779 Header: res.Header, 8780 } 8781 } 8782 if err != nil { 8783 return nil, err 8784 } 8785 defer googleapi.CloseBody(res) 8786 if err := googleapi.CheckResponse(res); err != nil { 8787 return nil, err 8788 } 8789 ret := &TestIamPermissionsResponse{ 8790 ServerResponse: googleapi.ServerResponse{ 8791 Header: res.Header, 8792 HTTPStatusCode: res.StatusCode, 8793 }, 8794 } 8795 target := &ret 8796 if err := gensupport.DecodeResponse(target, res); err != nil { 8797 return nil, err 8798 } 8799 return ret, nil 8800 // { 8801 // "description": "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. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 8802 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/reusableConfigs/{reusableConfigsId}:testIamPermissions", 8803 // "httpMethod": "POST", 8804 // "id": "privateca.projects.locations.reusableConfigs.testIamPermissions", 8805 // "parameterOrder": [ 8806 // "resource" 8807 // ], 8808 // "parameters": { 8809 // "resource": { 8810 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 8811 // "location": "path", 8812 // "pattern": "^projects/[^/]+/locations/[^/]+/reusableConfigs/[^/]+$", 8813 // "required": true, 8814 // "type": "string" 8815 // } 8816 // }, 8817 // "path": "v1beta1/{+resource}:testIamPermissions", 8818 // "request": { 8819 // "$ref": "TestIamPermissionsRequest" 8820 // }, 8821 // "response": { 8822 // "$ref": "TestIamPermissionsResponse" 8823 // }, 8824 // "scopes": [ 8825 // "https://www.googleapis.com/auth/cloud-platform" 8826 // ] 8827 // } 8828 8829} 8830