diff --git a/packages/google-cloud-deploy/README.md b/packages/google-cloud-deploy/README.md index 3edae56c5b7..78dff771967 100644 --- a/packages/google-cloud-deploy/README.md +++ b/packages/google-cloud-deploy/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Google Cloud Deploy API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -235,4 +235,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=clouddeploy.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto index 0c6c134caf1..4ca425d7c0d 100644 --- a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto @@ -26,6 +26,8 @@ import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/type/date.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; option go_package = "cloud.google.com/go/deploy/apiv1/deploypb;deploypb"; option java_multiple_files = true; @@ -293,6 +295,65 @@ service CloudDeploy { option (google.api.method_signature) = "name"; } + // Creates a new DeployPolicy in a given project and location. + rpc CreateDeployPolicy(CreateDeployPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/deployPolicies" + body: "deploy_policy" + }; + option (google.api.method_signature) = + "parent,deploy_policy,deploy_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "DeployPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single DeployPolicy. + rpc UpdateDeployPolicy(UpdateDeployPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{deploy_policy.name=projects/*/locations/*/deployPolicies/*}" + body: "deploy_policy" + }; + option (google.api.method_signature) = "deploy_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DeployPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single DeployPolicy. + rpc DeleteDeployPolicy(DeleteDeployPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/deployPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists DeployPolicies in a given project and location. + rpc ListDeployPolicies(ListDeployPoliciesRequest) + returns (ListDeployPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/deployPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single DeployPolicy. + rpc GetDeployPolicy(GetDeployPolicyRequest) returns (DeployPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deployPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + // Approves a Rollout. rpc ApproveRollout(ApproveRolloutRequest) returns (ApproveRolloutResponse) { option (google.api.http) = { @@ -1096,6 +1157,15 @@ message RollbackTargetRequest { // Optional. If set to true, the request is validated and the user is provided // with a `RollbackTargetResponse`. bool validate_only = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`. + repeated string override_deploy_policy = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // The response object from `RollbackTarget`. @@ -1864,7 +1934,132 @@ message DeleteCustomTargetTypeRequest { string etag = 5 [(google.api.field_behavior) = OPTIONAL]; } -// Contains criteria for selecting Targets. +// A `DeployPolicy` resource in the Cloud Deploy API. +// +// A `DeployPolicy` inhibits manual or automation-driven actions within a +// Delivery Pipeline or Target. +message DeployPolicy { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + pattern: "projects/{project}/locations/{location}/deployPolicies/{deploy_policy}" + style: DECLARATIVE_FRIENDLY + }; + + // What invoked the action. Filters enforcing the policy depending on what + // invoked the action. + enum Invoker { + // Unspecified. + INVOKER_UNSPECIFIED = 0; + + // The action is user-driven. For example, creating a rollout manually via a + // gcloud create command. + USER = 1; + + // Automated action by Cloud Deploy. + DEPLOY_AUTOMATION = 2; + } + + // Output only. Name of the `DeployPolicy`. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + // The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unique identifier of the `DeployPolicy`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the `DeployPolicy`. Max length is 255 characters. + string description = 3; + + // User annotations. These attributes can only be set and used by the + // user, and not by Cloud Deploy. Annotations must meet the following + // constraints: + // + // * Annotations are key/value pairs. + // * Valid annotation keys have two segments: an optional prefix and name, + // separated by a slash (`/`). + // * The name segment is required and must be 63 characters or less, + // beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with + // dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. + // * The prefix is optional. If specified, the prefix must be a DNS subdomain: + // a series of DNS labels separated by dots(`.`), not longer than 253 + // characters in total, followed by a slash (`/`). + // + // See + // https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set + // for more details. + map annotations = 4; + + // Labels are attributes that can be set and used by both the + // user and by Cloud Deploy. Labels must meet the following constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5; + + // Output only. Time at which the deploy policy was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Most recent time at which the deploy policy was updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // When suspended, the policy will not prevent actions from occurring, even + // if the action violates the policy. + bool suspended = 8; + + // Required. Selected resources to which the policy will be applied. At least + // one selector is required. If one selector matches the resource the policy + // applies. For example, if there are two selectors and the action being + // attempted matches one of them, the policy will apply to that action. + repeated DeployPolicyResourceSelector selectors = 12 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Rules to apply. At least one rule must be present. + repeated PolicyRule rules = 10 [(google.api.field_behavior) = REQUIRED]; + + // The weak etag of the `Automation` resource. + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 11; +} + +// Contains information on the resources to select for a deploy policy. +// Attributes provided must all match the resource in order for policy +// restrictions to apply. For example, if delivery pipelines attributes given +// are an id "prod" and labels "foo: bar", a delivery pipeline resource must +// match both that id and have that label in order to be subject to the policy. +message DeployPolicyResourceSelector { + // Optional. Contains attributes about a delivery pipeline. + DeliveryPipelineAttribute delivery_pipeline = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contains attributes about a target. + TargetAttribute target = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains criteria for selecting DeliveryPipelines. +message DeliveryPipelineAttribute { + // ID of the `DeliveryPipeline`. The value of this field could be one of the + // following: + // + // * The last segment of a pipeline name + // * "*", all delivery pipelines in a location + string id = 1; + + // DeliveryPipeline labels. + map labels = 2; +} + +// Contains criteria for selecting Targets. This could be used to select targets +// for a Deploy Policy or for an Automation. message TargetAttribute { // ID of the `Target`. The value of this field could be one of the // following: @@ -1877,6 +2072,138 @@ message TargetAttribute { map labels = 2; } +// Deploy Policy rule. +message PolicyRule { + oneof rule { + // Rollout restrictions. + RolloutRestriction rollout_restriction = 2; + } +} + +// Rollout restrictions. +message RolloutRestriction { + // Rollout actions to be restricted as part of the policy. + enum RolloutActions { + // Unspecified. + ROLLOUT_ACTIONS_UNSPECIFIED = 0; + + // Advance the rollout to the next phase. + ADVANCE = 1; + + // Approve the rollout. + APPROVE = 2; + + // Cancel the rollout. + CANCEL = 3; + + // Create a rollout. + CREATE = 4; + + // Ignore a job result on the rollout. + IGNORE_JOB = 5; + + // Retry a job for a rollout. + RETRY_JOB = 6; + + // Rollback a rollout. + ROLLBACK = 7; + + // Terminate a jobrun. + TERMINATE_JOBRUN = 8; + } + + // Required. Restriction rule ID. Required and must be unique within a + // DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. What invoked the action. If left empty, all invoker types will be + // restricted. + repeated DeployPolicy.Invoker invokers = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Rollout actions to be restricted as part of the policy. If left + // empty, all actions will be restricted. + repeated RolloutActions actions = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Time window within which actions are restricted. + TimeWindows time_windows = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Time windows within which actions are restricted. See the +// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times) +// for more information on how to configure dates/times. +message TimeWindows { + // Required. The time zone in IANA format [IANA Time Zone + // Database](https://www.iana.org/time-zones) (e.g. America/New_York). + string time_zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. One-time windows within which actions are restricted. + repeated OneTimeWindow one_time_windows = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Recurring weekly windows within which actions are restricted. + repeated WeeklyWindow weekly_windows = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// One-time window within which actions are restricted. For example, blocking +// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am. +message OneTimeWindow { + // Required. Start date. + google.type.Date start_date = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Start time (inclusive). Use 00:00 for the beginning of the day. + google.type.TimeOfDay start_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. End date. + google.type.Date end_date = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. End time (exclusive). You may use 24:00 for the end of the day. + google.type.TimeOfDay end_time = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Weekly windows. For example, blocking actions every Saturday and Sunday. +// Another example would be blocking actions every weekday from 5pm to midnight. +message WeeklyWindow { + // Optional. Days of week. If left empty, all days of the week will be + // included. + repeated google.type.DayOfWeek days_of_week = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Start time (inclusive). Use 00:00 for the beginning of the day. + // If you specify start_time you must also specify end_time. If left empty, + // this will block for the entire day for the days specified in days_of_week. + google.type.TimeOfDay start_time = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. End time (exclusive). Use 24:00 to indicate midnight. If you + // specify end_time you must also specify start_time. If left empty, this will + // block for the entire day for the days specified in days_of_week. + google.type.TimeOfDay end_time = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Returned from an action if one or more policies were +// violated, and therefore the action was prevented. Contains information about +// what policies were violated and why. +message PolicyViolation { + // Policy violation details. + repeated PolicyViolationDetails policy_violation_details = 1; +} + +// Policy violation details. +message PolicyViolationDetails { + // Name of the policy that was violated. + // Policy resource will be in the format of + // `projects/{project}/locations/{location}/policies/{policy}`. + string policy = 1; + + // Id of the rule that triggered the policy violation. + string rule_id = 2; + + // User readable message about why the request violated a policy. This is not + // intended for machine parsing. + string failure_message = 3; +} + // A `Release` resource in the Cloud Deploy API. // // A `Release` defines a specific Skaffold configuration instance @@ -2120,6 +2447,177 @@ message Release { [(google.api.field_behavior) = OPTIONAL]; } +// The request object for `CreateDeployPolicy`. +message CreateDeployPolicyRequest { + // Required. The parent collection in which the `DeployPolicy` must be + // created. The format is `projects/{project_id}/locations/{location_name}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; + + // Required. ID of the `DeployPolicy`. + string deploy_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `DeployPolicy` to create. + DeployPolicy deploy_policy = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server knows to ignore the + // request if it has already been completed. The server guarantees that for + // at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided + // with an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `UpdateDeployPolicy`. +message UpdateDeployPolicyRequest { + // Required. Field mask is used to specify the fields to be overwritten by the + // update in the `DeployPolicy` resource. The fields specified in the + // update_mask are relative to the resource, not the full request. A field + // will be overwritten if it's in the mask. If the user doesn't provide a mask + // then all fields are overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The `DeployPolicy` to update. + DeployPolicy deploy_policy = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server knows to ignore the + // request if it has already been completed. The server guarantees that for + // at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, updating a `DeployPolicy` that does not exist + // will result in the creation of a new `DeployPolicy`. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided + // with an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `DeleteDeployPolicy`. +message DeleteDeployPolicyRequest { + // Required. The name of the `DeployPolicy` to delete. The format is + // `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server knows to ignore the + // request if it has already been completed. The server guarantees that for + // at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, then deleting an already deleted or non-existing + // `DeployPolicy` will succeed. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the review, but do not + // actually post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This checksum is computed by the server based on the value of + // other fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `ListDeployPolicies`. +message ListDeployPoliciesRequest { + // Required. The parent, which owns this collection of deploy policies. Format + // must be `projects/{project_id}/locations/{location_name}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; + + // The maximum number of deploy policies to return. The service may return + // fewer than this value. If unspecified, at most 50 deploy policies will + // be returned. The maximum value is 1000; values above 1000 will be set + // to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListDeployPolicies` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3; + + // Filter deploy policies to be returned. See https://google.aip.dev/160 for + // more details. All fields can be used in the filter. + string filter = 4; + + // Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// The response object from `ListDeployPolicies`. +message ListDeployPoliciesResponse { + // The `DeployPolicy` objects. + repeated DeployPolicy deploy_policies = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request object for `GetDeployPolicy` +message GetDeployPolicyRequest { + // Required. Name of the `DeployPolicy`. Format must be + // `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; +} + // Description of an a image to use during Skaffold rendering. message BuildArtifact { // Image name in Skaffold configuration. @@ -2293,6 +2791,15 @@ message CreateReleaseRequest { // Optional. If set to true, the request is validated and the user is provided // with an expected result, but no actual change is made. bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // A `Rollout` resource in the Cloud Deploy API. @@ -2852,6 +3359,15 @@ message CreateRolloutRequest { // with an expected result, but no actual change is made. bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; + // Optional. The starting phase ID for the `Rollout`. If empty the `Rollout` // will start at the first phase. string starting_phase_id = 7 [(google.api.field_behavior) = OPTIONAL]; @@ -2900,6 +3416,15 @@ message ApproveRolloutRequest { // Required. True = approve; false = reject bool approved = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // The response object from `ApproveRollout`. @@ -2918,6 +3443,15 @@ message AdvanceRolloutRequest { // Required. The phase ID to advance the `Rollout` to. string phase_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // The response object from `AdvanceRollout`. @@ -2933,6 +3467,15 @@ message CancelRolloutRequest { type: "clouddeploy.googleapis.com/Rollout" } ]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // The response object from `CancelRollout`. @@ -2954,6 +3497,15 @@ message IgnoreJobRequest { // Required. The job ID for the Job to ignore. string job_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // The response object from `IgnoreJob`. @@ -2975,6 +3527,15 @@ message RetryJobRequest { // Required. The job ID for the Job to retry. string job_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // The response object from 'RetryJob'. @@ -3368,6 +3929,15 @@ message TerminateJobRunRequest { type: "clouddeploy.googleapis.com/JobRun" } ]; + + // Optional. Deploy policies to override. Format is + // `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + repeated string override_deploy_policy = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeployPolicy" + } + ]; } // The response object from `TerminateJobRun`. @@ -3862,6 +4432,11 @@ message AutomationRun { // only when an explanation is needed. string state_description = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Contains information about what policies prevented the + // `AutomationRun` from proceeding. + PolicyViolation policy_violation = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Time the `AutomationRun` expires. An `AutomationRun` expires // after 14 days from its creation date. google.protobuf.Timestamp expire_time = 11 diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto index b62c9d2e2f5..ec209b0634d 100644 --- a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto @@ -44,6 +44,9 @@ enum Type { // Rollout updated. TYPE_ROLLOUT_UPDATE = 7; + // Deploy Policy evaluation. + TYPE_DEPLOY_POLICY_EVALUATION = 8; + // Deprecated: This field is never used. Use release_render log type instead. TYPE_RENDER_STATUES_CHANGE = 2 [deprecated = true]; } diff --git a/packages/google-cloud-deploy/protos/protos.d.ts b/packages/google-cloud-deploy/protos/protos.d.ts index cfde244d5bb..c32c4e74716 100644 --- a/packages/google-cloud-deploy/protos/protos.d.ts +++ b/packages/google-cloud-deploy/protos/protos.d.ts @@ -150,6 +150,7 @@ export namespace google { TYPE_RESTRICTION_VIOLATED = 5, TYPE_RESOURCE_DELETED = 6, TYPE_ROLLOUT_UPDATE = 7, + TYPE_DEPLOY_POLICY_EVALUATION = 8, TYPE_RENDER_STATUES_CHANGE = 2 } @@ -586,6 +587,76 @@ export namespace google { */ public abandonRelease(request: google.cloud.deploy.v1.IAbandonReleaseRequest): Promise; + /** + * Calls CreateDeployPolicy. + * @param request CreateDeployPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDeployPolicy(request: google.cloud.deploy.v1.ICreateDeployPolicyRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateDeployPolicyCallback): void; + + /** + * Calls CreateDeployPolicy. + * @param request CreateDeployPolicyRequest message or plain object + * @returns Promise + */ + public createDeployPolicy(request: google.cloud.deploy.v1.ICreateDeployPolicyRequest): Promise; + + /** + * Calls UpdateDeployPolicy. + * @param request UpdateDeployPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDeployPolicy(request: google.cloud.deploy.v1.IUpdateDeployPolicyRequest, callback: google.cloud.deploy.v1.CloudDeploy.UpdateDeployPolicyCallback): void; + + /** + * Calls UpdateDeployPolicy. + * @param request UpdateDeployPolicyRequest message or plain object + * @returns Promise + */ + public updateDeployPolicy(request: google.cloud.deploy.v1.IUpdateDeployPolicyRequest): Promise; + + /** + * Calls DeleteDeployPolicy. + * @param request DeleteDeployPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDeployPolicy(request: google.cloud.deploy.v1.IDeleteDeployPolicyRequest, callback: google.cloud.deploy.v1.CloudDeploy.DeleteDeployPolicyCallback): void; + + /** + * Calls DeleteDeployPolicy. + * @param request DeleteDeployPolicyRequest message or plain object + * @returns Promise + */ + public deleteDeployPolicy(request: google.cloud.deploy.v1.IDeleteDeployPolicyRequest): Promise; + + /** + * Calls ListDeployPolicies. + * @param request ListDeployPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeployPoliciesResponse + */ + public listDeployPolicies(request: google.cloud.deploy.v1.IListDeployPoliciesRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListDeployPoliciesCallback): void; + + /** + * Calls ListDeployPolicies. + * @param request ListDeployPoliciesRequest message or plain object + * @returns Promise + */ + public listDeployPolicies(request: google.cloud.deploy.v1.IListDeployPoliciesRequest): Promise; + + /** + * Calls GetDeployPolicy. + * @param request GetDeployPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeployPolicy + */ + public getDeployPolicy(request: google.cloud.deploy.v1.IGetDeployPolicyRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetDeployPolicyCallback): void; + + /** + * Calls GetDeployPolicy. + * @param request GetDeployPolicyRequest message or plain object + * @returns Promise + */ + public getDeployPolicy(request: google.cloud.deploy.v1.IGetDeployPolicyRequest): Promise; + /** * Calls ApproveRollout. * @param request ApproveRolloutRequest message or plain object @@ -1009,6 +1080,41 @@ export namespace google { */ type AbandonReleaseCallback = (error: (Error|null), response?: google.cloud.deploy.v1.AbandonReleaseResponse) => void; + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createDeployPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDeployPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateDeployPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDeployPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteDeployPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDeployPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listDeployPolicies}. + * @param error Error, if any + * @param [response] ListDeployPoliciesResponse + */ + type ListDeployPoliciesCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListDeployPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getDeployPolicy}. + * @param error Error, if any + * @param [response] DeployPolicy + */ + type GetDeployPolicyCallback = (error: (Error|null), response?: google.cloud.deploy.v1.DeployPolicy) => void; + /** * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|approveRollout}. * @param error Error, if any @@ -4306,6 +4412,9 @@ export namespace google { /** RollbackTargetRequest validateOnly */ validateOnly?: (boolean|null); + + /** RollbackTargetRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents a RollbackTargetRequest. */ @@ -4338,6 +4447,9 @@ export namespace google { /** RollbackTargetRequest validateOnly. */ public validateOnly: boolean; + /** RollbackTargetRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new RollbackTargetRequest instance using the specified properties. * @param [properties] Properties to set @@ -7658,628 +7770,1771 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TargetAttribute. */ - interface ITargetAttribute { + /** Properties of a DeployPolicy. */ + interface IDeployPolicy { - /** TargetAttribute id */ - id?: (string|null); + /** DeployPolicy name */ + name?: (string|null); - /** TargetAttribute labels */ + /** DeployPolicy uid */ + uid?: (string|null); + + /** DeployPolicy description */ + description?: (string|null); + + /** DeployPolicy annotations */ + annotations?: ({ [k: string]: string }|null); + + /** DeployPolicy labels */ labels?: ({ [k: string]: string }|null); + + /** DeployPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DeployPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DeployPolicy suspended */ + suspended?: (boolean|null); + + /** DeployPolicy selectors */ + selectors?: (google.cloud.deploy.v1.IDeployPolicyResourceSelector[]|null); + + /** DeployPolicy rules */ + rules?: (google.cloud.deploy.v1.IPolicyRule[]|null); + + /** DeployPolicy etag */ + etag?: (string|null); } - /** Represents a TargetAttribute. */ - class TargetAttribute implements ITargetAttribute { + /** Represents a DeployPolicy. */ + class DeployPolicy implements IDeployPolicy { /** - * Constructs a new TargetAttribute. + * Constructs a new DeployPolicy. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.deploy.v1.ITargetAttribute); + constructor(properties?: google.cloud.deploy.v1.IDeployPolicy); - /** TargetAttribute id. */ - public id: string; + /** DeployPolicy name. */ + public name: string; - /** TargetAttribute labels. */ + /** DeployPolicy uid. */ + public uid: string; + + /** DeployPolicy description. */ + public description: string; + + /** DeployPolicy annotations. */ + public annotations: { [k: string]: string }; + + /** DeployPolicy labels. */ public labels: { [k: string]: string }; + /** DeployPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DeployPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DeployPolicy suspended. */ + public suspended: boolean; + + /** DeployPolicy selectors. */ + public selectors: google.cloud.deploy.v1.IDeployPolicyResourceSelector[]; + + /** DeployPolicy rules. */ + public rules: google.cloud.deploy.v1.IPolicyRule[]; + + /** DeployPolicy etag. */ + public etag: string; + /** - * Creates a new TargetAttribute instance using the specified properties. + * Creates a new DeployPolicy instance using the specified properties. * @param [properties] Properties to set - * @returns TargetAttribute instance + * @returns DeployPolicy instance */ - public static create(properties?: google.cloud.deploy.v1.ITargetAttribute): google.cloud.deploy.v1.TargetAttribute; + public static create(properties?: google.cloud.deploy.v1.IDeployPolicy): google.cloud.deploy.v1.DeployPolicy; /** - * Encodes the specified TargetAttribute message. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. - * @param message TargetAttribute message or plain object to encode + * Encodes the specified DeployPolicy message. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicy.verify|verify} messages. + * @param message DeployPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.deploy.v1.ITargetAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.deploy.v1.IDeployPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TargetAttribute message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. - * @param message TargetAttribute message or plain object to encode + * Encodes the specified DeployPolicy message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicy.verify|verify} messages. + * @param message DeployPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.deploy.v1.ITargetAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TargetAttribute message from the specified reader or buffer. + * Decodes a DeployPolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TargetAttribute + * @returns DeployPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetAttribute; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployPolicy; /** - * Decodes a TargetAttribute message from the specified reader or buffer, length delimited. + * Decodes a DeployPolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TargetAttribute + * @returns DeployPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetAttribute; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployPolicy; /** - * Verifies a TargetAttribute message. + * Verifies a DeployPolicy message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TargetAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a DeployPolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TargetAttribute + * @returns DeployPolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetAttribute; + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployPolicy; /** - * Creates a plain object from a TargetAttribute message. Also converts values to other types if specified. - * @param message TargetAttribute + * Creates a plain object from a DeployPolicy message. Also converts values to other types if specified. + * @param message DeployPolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.deploy.v1.TargetAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.deploy.v1.DeployPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TargetAttribute to JSON. + * Converts this DeployPolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TargetAttribute + * Gets the default type url for DeployPolicy * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Release. */ - interface IRelease { - - /** Release name */ - name?: (string|null); + namespace DeployPolicy { - /** Release uid */ - uid?: (string|null); + /** Invoker enum. */ + enum Invoker { + INVOKER_UNSPECIFIED = 0, + USER = 1, + DEPLOY_AUTOMATION = 2 + } + } - /** Release description */ - description?: (string|null); + /** Properties of a DeployPolicyResourceSelector. */ + interface IDeployPolicyResourceSelector { - /** Release annotations */ - annotations?: ({ [k: string]: string }|null); + /** DeployPolicyResourceSelector deliveryPipeline */ + deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipelineAttribute|null); - /** Release labels */ - labels?: ({ [k: string]: string }|null); + /** DeployPolicyResourceSelector target */ + target?: (google.cloud.deploy.v1.ITargetAttribute|null); + } - /** Release abandoned */ - abandoned?: (boolean|null); + /** Represents a DeployPolicyResourceSelector. */ + class DeployPolicyResourceSelector implements IDeployPolicyResourceSelector { - /** Release createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new DeployPolicyResourceSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployPolicyResourceSelector); - /** Release renderStartTime */ - renderStartTime?: (google.protobuf.ITimestamp|null); + /** DeployPolicyResourceSelector deliveryPipeline. */ + public deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipelineAttribute|null); - /** Release renderEndTime */ - renderEndTime?: (google.protobuf.ITimestamp|null); + /** DeployPolicyResourceSelector target. */ + public target?: (google.cloud.deploy.v1.ITargetAttribute|null); - /** Release skaffoldConfigUri */ - skaffoldConfigUri?: (string|null); + /** + * Creates a new DeployPolicyResourceSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployPolicyResourceSelector instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployPolicyResourceSelector): google.cloud.deploy.v1.DeployPolicyResourceSelector; - /** Release skaffoldConfigPath */ - skaffoldConfigPath?: (string|null); + /** + * Encodes the specified DeployPolicyResourceSelector message. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyResourceSelector.verify|verify} messages. + * @param message DeployPolicyResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployPolicyResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Release buildArtifacts */ - buildArtifacts?: (google.cloud.deploy.v1.IBuildArtifact[]|null); + /** + * Encodes the specified DeployPolicyResourceSelector message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyResourceSelector.verify|verify} messages. + * @param message DeployPolicyResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployPolicyResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Release deliveryPipelineSnapshot */ - deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + /** + * Decodes a DeployPolicyResourceSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployPolicyResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployPolicyResourceSelector; - /** Release targetSnapshots */ - targetSnapshots?: (google.cloud.deploy.v1.ITarget[]|null); + /** + * Decodes a DeployPolicyResourceSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployPolicyResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployPolicyResourceSelector; - /** Release customTargetTypeSnapshots */ - customTargetTypeSnapshots?: (google.cloud.deploy.v1.ICustomTargetType[]|null); + /** + * Verifies a DeployPolicyResourceSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Release renderState */ - renderState?: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState|null); + /** + * Creates a DeployPolicyResourceSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployPolicyResourceSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployPolicyResourceSelector; - /** Release etag */ - etag?: (string|null); + /** + * Creates a plain object from a DeployPolicyResourceSelector message. Also converts values to other types if specified. + * @param message DeployPolicyResourceSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployPolicyResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Release skaffoldVersion */ - skaffoldVersion?: (string|null); + /** + * Converts this DeployPolicyResourceSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Release targetArtifacts */ - targetArtifacts?: ({ [k: string]: google.cloud.deploy.v1.ITargetArtifact }|null); + /** + * Gets the default type url for DeployPolicyResourceSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Release targetRenders */ - targetRenders?: ({ [k: string]: google.cloud.deploy.v1.Release.ITargetRender }|null); + /** Properties of a DeliveryPipelineAttribute. */ + interface IDeliveryPipelineAttribute { - /** Release condition */ - condition?: (google.cloud.deploy.v1.Release.IReleaseCondition|null); + /** DeliveryPipelineAttribute id */ + id?: (string|null); - /** Release deployParameters */ - deployParameters?: ({ [k: string]: string }|null); + /** DeliveryPipelineAttribute labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a Release. */ - class Release implements IRelease { + /** Represents a DeliveryPipelineAttribute. */ + class DeliveryPipelineAttribute implements IDeliveryPipelineAttribute { /** - * Constructs a new Release. + * Constructs a new DeliveryPipelineAttribute. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.deploy.v1.IRelease); - - /** Release name. */ - public name: string; - - /** Release uid. */ - public uid: string; - - /** Release description. */ - public description: string; + constructor(properties?: google.cloud.deploy.v1.IDeliveryPipelineAttribute); - /** Release annotations. */ - public annotations: { [k: string]: string }; + /** DeliveryPipelineAttribute id. */ + public id: string; - /** Release labels. */ + /** DeliveryPipelineAttribute labels. */ public labels: { [k: string]: string }; - /** Release abandoned. */ - public abandoned: boolean; + /** + * Creates a new DeliveryPipelineAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns DeliveryPipelineAttribute instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeliveryPipelineAttribute): google.cloud.deploy.v1.DeliveryPipelineAttribute; - /** Release createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified DeliveryPipelineAttribute message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineAttribute.verify|verify} messages. + * @param message DeliveryPipelineAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeliveryPipelineAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - /** Release renderStartTime. */ - public renderStartTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified DeliveryPipelineAttribute message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineAttribute.verify|verify} messages. + * @param message DeliveryPipelineAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeliveryPipelineAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - /** Release renderEndTime. */ - public renderEndTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a DeliveryPipelineAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeliveryPipelineAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeliveryPipelineAttribute; - /** Release skaffoldConfigUri. */ - public skaffoldConfigUri: string; + /** + * Decodes a DeliveryPipelineAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeliveryPipelineAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeliveryPipelineAttribute; - /** Release skaffoldConfigPath. */ - public skaffoldConfigPath: string; + /** + * Verifies a DeliveryPipelineAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Release buildArtifacts. */ - public buildArtifacts: google.cloud.deploy.v1.IBuildArtifact[]; + /** + * Creates a DeliveryPipelineAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeliveryPipelineAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeliveryPipelineAttribute; - /** Release deliveryPipelineSnapshot. */ - public deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + /** + * Creates a plain object from a DeliveryPipelineAttribute message. Also converts values to other types if specified. + * @param message DeliveryPipelineAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeliveryPipelineAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Release targetSnapshots. */ - public targetSnapshots: google.cloud.deploy.v1.ITarget[]; + /** + * Converts this DeliveryPipelineAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Release customTargetTypeSnapshots. */ - public customTargetTypeSnapshots: google.cloud.deploy.v1.ICustomTargetType[]; + /** + * Gets the default type url for DeliveryPipelineAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Release renderState. */ - public renderState: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState); + /** Properties of a TargetAttribute. */ + interface ITargetAttribute { - /** Release etag. */ - public etag: string; + /** TargetAttribute id */ + id?: (string|null); - /** Release skaffoldVersion. */ - public skaffoldVersion: string; + /** TargetAttribute labels */ + labels?: ({ [k: string]: string }|null); + } - /** Release targetArtifacts. */ - public targetArtifacts: { [k: string]: google.cloud.deploy.v1.ITargetArtifact }; + /** Represents a TargetAttribute. */ + class TargetAttribute implements ITargetAttribute { - /** Release targetRenders. */ - public targetRenders: { [k: string]: google.cloud.deploy.v1.Release.ITargetRender }; + /** + * Constructs a new TargetAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITargetAttribute); - /** Release condition. */ - public condition?: (google.cloud.deploy.v1.Release.IReleaseCondition|null); + /** TargetAttribute id. */ + public id: string; - /** Release deployParameters. */ - public deployParameters: { [k: string]: string }; + /** TargetAttribute labels. */ + public labels: { [k: string]: string }; /** - * Creates a new Release instance using the specified properties. + * Creates a new TargetAttribute instance using the specified properties. * @param [properties] Properties to set - * @returns Release instance + * @returns TargetAttribute instance */ - public static create(properties?: google.cloud.deploy.v1.IRelease): google.cloud.deploy.v1.Release; + public static create(properties?: google.cloud.deploy.v1.ITargetAttribute): google.cloud.deploy.v1.TargetAttribute; /** - * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. - * @param message Release message or plain object to encode + * Encodes the specified TargetAttribute message. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. + * @param message TargetAttribute message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.deploy.v1.ITargetAttribute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. - * @param message Release message or plain object to encode + * Encodes the specified TargetAttribute message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. + * @param message TargetAttribute message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.deploy.v1.ITargetAttribute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Release message from the specified reader or buffer. + * Decodes a TargetAttribute message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Release + * @returns TargetAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetAttribute; /** - * Decodes a Release message from the specified reader or buffer, length delimited. + * Decodes a TargetAttribute message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Release + * @returns TargetAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetAttribute; /** - * Verifies a Release message. + * Verifies a TargetAttribute message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Release message from a plain object. Also converts values to their respective internal types. + * Creates a TargetAttribute message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Release + * @returns TargetAttribute */ - public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release; + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetAttribute; /** - * Creates a plain object from a Release message. Also converts values to other types if specified. - * @param message Release + * Creates a plain object from a TargetAttribute message. Also converts values to other types if specified. + * @param message TargetAttribute * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.deploy.v1.Release, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.deploy.v1.TargetAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Release to JSON. + * Converts this TargetAttribute to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Release + * Gets the default type url for TargetAttribute * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Release { + /** Properties of a PolicyRule. */ + interface IPolicyRule { - /** RenderState enum. */ - enum RenderState { - RENDER_STATE_UNSPECIFIED = 0, - SUCCEEDED = 1, - FAILED = 2, - IN_PROGRESS = 3 - } + /** PolicyRule rolloutRestriction */ + rolloutRestriction?: (google.cloud.deploy.v1.IRolloutRestriction|null); + } - /** Properties of a TargetRender. */ - interface ITargetRender { + /** Represents a PolicyRule. */ + class PolicyRule implements IPolicyRule { - /** TargetRender renderingBuild */ - renderingBuild?: (string|null); + /** + * Constructs a new PolicyRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPolicyRule); - /** TargetRender renderingState */ - renderingState?: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null); + /** PolicyRule rolloutRestriction. */ + public rolloutRestriction?: (google.cloud.deploy.v1.IRolloutRestriction|null); - /** TargetRender metadata */ - metadata?: (google.cloud.deploy.v1.IRenderMetadata|null); + /** PolicyRule rule. */ + public rule?: "rolloutRestriction"; - /** TargetRender failureCause */ - failureCause?: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause|null); + /** + * Creates a new PolicyRule instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyRule instance + */ + public static create(properties?: google.cloud.deploy.v1.IPolicyRule): google.cloud.deploy.v1.PolicyRule; - /** TargetRender failureMessage */ - failureMessage?: (string|null); - } + /** + * Encodes the specified PolicyRule message. Does not implicitly {@link google.cloud.deploy.v1.PolicyRule.verify|verify} messages. + * @param message PolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a TargetRender. */ - class TargetRender implements ITargetRender { + /** + * Encodes the specified PolicyRule message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PolicyRule.verify|verify} messages. + * @param message PolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new TargetRender. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.deploy.v1.Release.ITargetRender); + /** + * Decodes a PolicyRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PolicyRule; - /** TargetRender renderingBuild. */ - public renderingBuild: string; + /** + * Decodes a PolicyRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PolicyRule; - /** TargetRender renderingState. */ - public renderingState: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState); + /** + * Verifies a PolicyRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** TargetRender metadata. */ - public metadata?: (google.cloud.deploy.v1.IRenderMetadata|null); + /** + * Creates a PolicyRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PolicyRule; - /** TargetRender failureCause. */ - public failureCause: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause); + /** + * Creates a plain object from a PolicyRule message. Also converts values to other types if specified. + * @param message PolicyRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PolicyRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** TargetRender failureMessage. */ - public failureMessage: string; + /** + * Converts this PolicyRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a new TargetRender instance using the specified properties. - * @param [properties] Properties to set - * @returns TargetRender instance - */ - public static create(properties?: google.cloud.deploy.v1.Release.ITargetRender): google.cloud.deploy.v1.Release.TargetRender; + /** + * Gets the default type url for PolicyRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. - * @param message TargetRender message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a RolloutRestriction. */ + interface IRolloutRestriction { - /** - * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. - * @param message TargetRender message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + /** RolloutRestriction id */ + id?: (string|null); - /** - * Decodes a TargetRender message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TargetRender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.TargetRender; + /** RolloutRestriction invokers */ + invokers?: (google.cloud.deploy.v1.DeployPolicy.Invoker[]|null); - /** - * Decodes a TargetRender message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TargetRender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.TargetRender; + /** RolloutRestriction actions */ + actions?: (google.cloud.deploy.v1.RolloutRestriction.RolloutActions[]|null); - /** - * Verifies a TargetRender message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** RolloutRestriction timeWindows */ + timeWindows?: (google.cloud.deploy.v1.ITimeWindows|null); + } - /** - * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TargetRender - */ - public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.TargetRender; + /** Represents a RolloutRestriction. */ + class RolloutRestriction implements IRolloutRestriction { - /** - * Creates a plain object from a TargetRender message. Also converts values to other types if specified. - * @param message TargetRender - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.deploy.v1.Release.TargetRender, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new RolloutRestriction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRolloutRestriction); - /** - * Converts this TargetRender to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** RolloutRestriction id. */ + public id: string; - /** - * Gets the default type url for TargetRender - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** RolloutRestriction invokers. */ + public invokers: google.cloud.deploy.v1.DeployPolicy.Invoker[]; - namespace TargetRender { + /** RolloutRestriction actions. */ + public actions: google.cloud.deploy.v1.RolloutRestriction.RolloutActions[]; - /** TargetRenderState enum. */ - enum TargetRenderState { - TARGET_RENDER_STATE_UNSPECIFIED = 0, - SUCCEEDED = 1, - FAILED = 2, - IN_PROGRESS = 3 - } + /** RolloutRestriction timeWindows. */ + public timeWindows?: (google.cloud.deploy.v1.ITimeWindows|null); - /** FailureCause enum. */ - enum FailureCause { - FAILURE_CAUSE_UNSPECIFIED = 0, - CLOUD_BUILD_UNAVAILABLE = 1, - EXECUTION_FAILED = 2, - CLOUD_BUILD_REQUEST_FAILED = 3, - VERIFICATION_CONFIG_NOT_FOUND = 4, - CUSTOM_ACTION_NOT_FOUND = 5, - DEPLOYMENT_STRATEGY_NOT_SUPPORTED = 6, - RENDER_FEATURE_NOT_SUPPORTED = 7 - } - } + /** + * Creates a new RolloutRestriction instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutRestriction instance + */ + public static create(properties?: google.cloud.deploy.v1.IRolloutRestriction): google.cloud.deploy.v1.RolloutRestriction; - /** Properties of a ReleaseReadyCondition. */ - interface IReleaseReadyCondition { + /** + * Encodes the specified RolloutRestriction message. Does not implicitly {@link google.cloud.deploy.v1.RolloutRestriction.verify|verify} messages. + * @param message RolloutRestriction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRolloutRestriction, writer?: $protobuf.Writer): $protobuf.Writer; - /** ReleaseReadyCondition status */ - status?: (boolean|null); - } + /** + * Encodes the specified RolloutRestriction message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RolloutRestriction.verify|verify} messages. + * @param message RolloutRestriction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRolloutRestriction, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ReleaseReadyCondition. */ - class ReleaseReadyCondition implements IReleaseReadyCondition { + /** + * Decodes a RolloutRestriction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.RolloutRestriction; - /** - * Constructs a new ReleaseReadyCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.deploy.v1.Release.IReleaseReadyCondition); + /** + * Decodes a RolloutRestriction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.RolloutRestriction; - /** ReleaseReadyCondition status. */ - public status: boolean; + /** + * Verifies a RolloutRestriction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new ReleaseReadyCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ReleaseReadyCondition instance - */ - public static create(properties?: google.cloud.deploy.v1.Release.IReleaseReadyCondition): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + /** + * Creates a RolloutRestriction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutRestriction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.RolloutRestriction; - /** - * Encodes the specified ReleaseReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. - * @param message ReleaseReadyCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.deploy.v1.Release.IReleaseReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a RolloutRestriction message. Also converts values to other types if specified. + * @param message RolloutRestriction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.RolloutRestriction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified ReleaseReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. - * @param message ReleaseReadyCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.deploy.v1.Release.IReleaseReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this RolloutRestriction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes a ReleaseReadyCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReleaseReadyCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + /** + * Gets the default type url for RolloutRestriction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Decodes a ReleaseReadyCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReleaseReadyCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + namespace RolloutRestriction { - /** - * Verifies a ReleaseReadyCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** RolloutActions enum. */ + enum RolloutActions { + ROLLOUT_ACTIONS_UNSPECIFIED = 0, + ADVANCE = 1, + APPROVE = 2, + CANCEL = 3, + CREATE = 4, + IGNORE_JOB = 5, + RETRY_JOB = 6, + ROLLBACK = 7, + TERMINATE_JOBRUN = 8 + } + } - /** - * Creates a ReleaseReadyCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReleaseReadyCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + /** Properties of a TimeWindows. */ + interface ITimeWindows { - /** - * Creates a plain object from a ReleaseReadyCondition message. Also converts values to other types if specified. - * @param message ReleaseReadyCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.deploy.v1.Release.ReleaseReadyCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** TimeWindows timeZone */ + timeZone?: (string|null); - /** - * Converts this ReleaseReadyCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** TimeWindows oneTimeWindows */ + oneTimeWindows?: (google.cloud.deploy.v1.IOneTimeWindow[]|null); - /** - * Gets the default type url for ReleaseReadyCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** TimeWindows weeklyWindows */ + weeklyWindows?: (google.cloud.deploy.v1.IWeeklyWindow[]|null); + } - /** Properties of a SkaffoldSupportedCondition. */ - interface ISkaffoldSupportedCondition { + /** Represents a TimeWindows. */ + class TimeWindows implements ITimeWindows { - /** SkaffoldSupportedCondition status */ - status?: (boolean|null); + /** + * Constructs a new TimeWindows. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITimeWindows); - /** SkaffoldSupportedCondition skaffoldSupportState */ - skaffoldSupportState?: (google.cloud.deploy.v1.SkaffoldSupportState|keyof typeof google.cloud.deploy.v1.SkaffoldSupportState|null); + /** TimeWindows timeZone. */ + public timeZone: string; - /** SkaffoldSupportedCondition maintenanceModeTime */ - maintenanceModeTime?: (google.protobuf.ITimestamp|null); + /** TimeWindows oneTimeWindows. */ + public oneTimeWindows: google.cloud.deploy.v1.IOneTimeWindow[]; - /** SkaffoldSupportedCondition supportExpirationTime */ - supportExpirationTime?: (google.protobuf.ITimestamp|null); - } + /** TimeWindows weeklyWindows. */ + public weeklyWindows: google.cloud.deploy.v1.IWeeklyWindow[]; - /** Represents a SkaffoldSupportedCondition. */ - class SkaffoldSupportedCondition implements ISkaffoldSupportedCondition { + /** + * Creates a new TimeWindows instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindows instance + */ + public static create(properties?: google.cloud.deploy.v1.ITimeWindows): google.cloud.deploy.v1.TimeWindows; - /** - * Constructs a new SkaffoldSupportedCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition); + /** + * Encodes the specified TimeWindows message. Does not implicitly {@link google.cloud.deploy.v1.TimeWindows.verify|verify} messages. + * @param message TimeWindows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITimeWindows, writer?: $protobuf.Writer): $protobuf.Writer; - /** SkaffoldSupportedCondition status. */ - public status: boolean; + /** + * Encodes the specified TimeWindows message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TimeWindows.verify|verify} messages. + * @param message TimeWindows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITimeWindows, writer?: $protobuf.Writer): $protobuf.Writer; - /** SkaffoldSupportedCondition skaffoldSupportState. */ - public skaffoldSupportState: (google.cloud.deploy.v1.SkaffoldSupportState|keyof typeof google.cloud.deploy.v1.SkaffoldSupportState); + /** + * Decodes a TimeWindows message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeWindows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TimeWindows; - /** SkaffoldSupportedCondition maintenanceModeTime. */ - public maintenanceModeTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a TimeWindows message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeWindows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TimeWindows; - /** SkaffoldSupportedCondition supportExpirationTime. */ - public supportExpirationTime?: (google.protobuf.ITimestamp|null); + /** + * Verifies a TimeWindows message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new SkaffoldSupportedCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns SkaffoldSupportedCondition instance - */ - public static create(properties?: google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + /** + * Creates a TimeWindows message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindows + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TimeWindows; - /** + /** + * Creates a plain object from a TimeWindows message. Also converts values to other types if specified. + * @param message TimeWindows + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.TimeWindows, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindows to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeWindows + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OneTimeWindow. */ + interface IOneTimeWindow { + + /** OneTimeWindow startDate */ + startDate?: (google.type.IDate|null); + + /** OneTimeWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); + + /** OneTimeWindow endDate */ + endDate?: (google.type.IDate|null); + + /** OneTimeWindow endTime */ + endTime?: (google.type.ITimeOfDay|null); + } + + /** Represents an OneTimeWindow. */ + class OneTimeWindow implements IOneTimeWindow { + + /** + * Constructs a new OneTimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IOneTimeWindow); + + /** OneTimeWindow startDate. */ + public startDate?: (google.type.IDate|null); + + /** OneTimeWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); + + /** OneTimeWindow endDate. */ + public endDate?: (google.type.IDate|null); + + /** OneTimeWindow endTime. */ + public endTime?: (google.type.ITimeOfDay|null); + + /** + * Creates a new OneTimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns OneTimeWindow instance + */ + public static create(properties?: google.cloud.deploy.v1.IOneTimeWindow): google.cloud.deploy.v1.OneTimeWindow; + + /** + * Encodes the specified OneTimeWindow message. Does not implicitly {@link google.cloud.deploy.v1.OneTimeWindow.verify|verify} messages. + * @param message OneTimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IOneTimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneTimeWindow message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.OneTimeWindow.verify|verify} messages. + * @param message OneTimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IOneTimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneTimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneTimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.OneTimeWindow; + + /** + * Decodes an OneTimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneTimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.OneTimeWindow; + + /** + * Verifies an OneTimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneTimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneTimeWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.OneTimeWindow; + + /** + * Creates a plain object from an OneTimeWindow message. Also converts values to other types if specified. + * @param message OneTimeWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.OneTimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneTimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneTimeWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WeeklyWindow. */ + interface IWeeklyWindow { + + /** WeeklyWindow daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + + /** WeeklyWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); + + /** WeeklyWindow endTime */ + endTime?: (google.type.ITimeOfDay|null); + } + + /** Represents a WeeklyWindow. */ + class WeeklyWindow implements IWeeklyWindow { + + /** + * Constructs a new WeeklyWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IWeeklyWindow); + + /** WeeklyWindow daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; + + /** WeeklyWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); + + /** WeeklyWindow endTime. */ + public endTime?: (google.type.ITimeOfDay|null); + + /** + * Creates a new WeeklyWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns WeeklyWindow instance + */ + public static create(properties?: google.cloud.deploy.v1.IWeeklyWindow): google.cloud.deploy.v1.WeeklyWindow; + + /** + * Encodes the specified WeeklyWindow message. Does not implicitly {@link google.cloud.deploy.v1.WeeklyWindow.verify|verify} messages. + * @param message WeeklyWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IWeeklyWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklyWindow message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.WeeklyWindow.verify|verify} messages. + * @param message WeeklyWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IWeeklyWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeeklyWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeeklyWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.WeeklyWindow; + + /** + * Decodes a WeeklyWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeeklyWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.WeeklyWindow; + + /** + * Verifies a WeeklyWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeeklyWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeeklyWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.WeeklyWindow; + + /** + * Creates a plain object from a WeeklyWindow message. Also converts values to other types if specified. + * @param message WeeklyWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.WeeklyWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeeklyWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeeklyWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PolicyViolation. */ + interface IPolicyViolation { + + /** PolicyViolation policyViolationDetails */ + policyViolationDetails?: (google.cloud.deploy.v1.IPolicyViolationDetails[]|null); + } + + /** Represents a PolicyViolation. */ + class PolicyViolation implements IPolicyViolation { + + /** + * Constructs a new PolicyViolation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPolicyViolation); + + /** PolicyViolation policyViolationDetails. */ + public policyViolationDetails: google.cloud.deploy.v1.IPolicyViolationDetails[]; + + /** + * Creates a new PolicyViolation instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyViolation instance + */ + public static create(properties?: google.cloud.deploy.v1.IPolicyViolation): google.cloud.deploy.v1.PolicyViolation; + + /** + * Encodes the specified PolicyViolation message. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolation.verify|verify} messages. + * @param message PolicyViolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPolicyViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyViolation message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolation.verify|verify} messages. + * @param message PolicyViolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPolicyViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyViolation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PolicyViolation; + + /** + * Decodes a PolicyViolation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PolicyViolation; + + /** + * Verifies a PolicyViolation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyViolation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyViolation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PolicyViolation; + + /** + * Creates a plain object from a PolicyViolation message. Also converts values to other types if specified. + * @param message PolicyViolation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PolicyViolation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyViolation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyViolation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PolicyViolationDetails. */ + interface IPolicyViolationDetails { + + /** PolicyViolationDetails policy */ + policy?: (string|null); + + /** PolicyViolationDetails ruleId */ + ruleId?: (string|null); + + /** PolicyViolationDetails failureMessage */ + failureMessage?: (string|null); + } + + /** Represents a PolicyViolationDetails. */ + class PolicyViolationDetails implements IPolicyViolationDetails { + + /** + * Constructs a new PolicyViolationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPolicyViolationDetails); + + /** PolicyViolationDetails policy. */ + public policy: string; + + /** PolicyViolationDetails ruleId. */ + public ruleId: string; + + /** PolicyViolationDetails failureMessage. */ + public failureMessage: string; + + /** + * Creates a new PolicyViolationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyViolationDetails instance + */ + public static create(properties?: google.cloud.deploy.v1.IPolicyViolationDetails): google.cloud.deploy.v1.PolicyViolationDetails; + + /** + * Encodes the specified PolicyViolationDetails message. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolationDetails.verify|verify} messages. + * @param message PolicyViolationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPolicyViolationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyViolationDetails message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolationDetails.verify|verify} messages. + * @param message PolicyViolationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPolicyViolationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyViolationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyViolationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PolicyViolationDetails; + + /** + * Decodes a PolicyViolationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyViolationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PolicyViolationDetails; + + /** + * Verifies a PolicyViolationDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyViolationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyViolationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PolicyViolationDetails; + + /** + * Creates a plain object from a PolicyViolationDetails message. Also converts values to other types if specified. + * @param message PolicyViolationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PolicyViolationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyViolationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyViolationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Release. */ + interface IRelease { + + /** Release name */ + name?: (string|null); + + /** Release uid */ + uid?: (string|null); + + /** Release description */ + description?: (string|null); + + /** Release annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Release labels */ + labels?: ({ [k: string]: string }|null); + + /** Release abandoned */ + abandoned?: (boolean|null); + + /** Release createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Release renderStartTime */ + renderStartTime?: (google.protobuf.ITimestamp|null); + + /** Release renderEndTime */ + renderEndTime?: (google.protobuf.ITimestamp|null); + + /** Release skaffoldConfigUri */ + skaffoldConfigUri?: (string|null); + + /** Release skaffoldConfigPath */ + skaffoldConfigPath?: (string|null); + + /** Release buildArtifacts */ + buildArtifacts?: (google.cloud.deploy.v1.IBuildArtifact[]|null); + + /** Release deliveryPipelineSnapshot */ + deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** Release targetSnapshots */ + targetSnapshots?: (google.cloud.deploy.v1.ITarget[]|null); + + /** Release customTargetTypeSnapshots */ + customTargetTypeSnapshots?: (google.cloud.deploy.v1.ICustomTargetType[]|null); + + /** Release renderState */ + renderState?: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState|null); + + /** Release etag */ + etag?: (string|null); + + /** Release skaffoldVersion */ + skaffoldVersion?: (string|null); + + /** Release targetArtifacts */ + targetArtifacts?: ({ [k: string]: google.cloud.deploy.v1.ITargetArtifact }|null); + + /** Release targetRenders */ + targetRenders?: ({ [k: string]: google.cloud.deploy.v1.Release.ITargetRender }|null); + + /** Release condition */ + condition?: (google.cloud.deploy.v1.Release.IReleaseCondition|null); + + /** Release deployParameters */ + deployParameters?: ({ [k: string]: string }|null); + } + + /** Represents a Release. */ + class Release implements IRelease { + + /** + * Constructs a new Release. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRelease); + + /** Release name. */ + public name: string; + + /** Release uid. */ + public uid: string; + + /** Release description. */ + public description: string; + + /** Release annotations. */ + public annotations: { [k: string]: string }; + + /** Release labels. */ + public labels: { [k: string]: string }; + + /** Release abandoned. */ + public abandoned: boolean; + + /** Release createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Release renderStartTime. */ + public renderStartTime?: (google.protobuf.ITimestamp|null); + + /** Release renderEndTime. */ + public renderEndTime?: (google.protobuf.ITimestamp|null); + + /** Release skaffoldConfigUri. */ + public skaffoldConfigUri: string; + + /** Release skaffoldConfigPath. */ + public skaffoldConfigPath: string; + + /** Release buildArtifacts. */ + public buildArtifacts: google.cloud.deploy.v1.IBuildArtifact[]; + + /** Release deliveryPipelineSnapshot. */ + public deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** Release targetSnapshots. */ + public targetSnapshots: google.cloud.deploy.v1.ITarget[]; + + /** Release customTargetTypeSnapshots. */ + public customTargetTypeSnapshots: google.cloud.deploy.v1.ICustomTargetType[]; + + /** Release renderState. */ + public renderState: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState); + + /** Release etag. */ + public etag: string; + + /** Release skaffoldVersion. */ + public skaffoldVersion: string; + + /** Release targetArtifacts. */ + public targetArtifacts: { [k: string]: google.cloud.deploy.v1.ITargetArtifact }; + + /** Release targetRenders. */ + public targetRenders: { [k: string]: google.cloud.deploy.v1.Release.ITargetRender }; + + /** Release condition. */ + public condition?: (google.cloud.deploy.v1.Release.IReleaseCondition|null); + + /** Release deployParameters. */ + public deployParameters: { [k: string]: string }; + + /** + * Creates a new Release instance using the specified properties. + * @param [properties] Properties to set + * @returns Release instance + */ + public static create(properties?: google.cloud.deploy.v1.IRelease): google.cloud.deploy.v1.Release; + + /** + * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @param message Release message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @param message Release message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Release message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release; + + /** + * Decodes a Release message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release; + + /** + * Verifies a Release message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Release message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Release + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release; + + /** + * Creates a plain object from a Release message. Also converts values to other types if specified. + * @param message Release + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Release to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Release + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Release { + + /** RenderState enum. */ + enum RenderState { + RENDER_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3 + } + + /** Properties of a TargetRender. */ + interface ITargetRender { + + /** TargetRender renderingBuild */ + renderingBuild?: (string|null); + + /** TargetRender renderingState */ + renderingState?: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null); + + /** TargetRender metadata */ + metadata?: (google.cloud.deploy.v1.IRenderMetadata|null); + + /** TargetRender failureCause */ + failureCause?: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause|null); + + /** TargetRender failureMessage */ + failureMessage?: (string|null); + } + + /** Represents a TargetRender. */ + class TargetRender implements ITargetRender { + + /** + * Constructs a new TargetRender. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.Release.ITargetRender); + + /** TargetRender renderingBuild. */ + public renderingBuild: string; + + /** TargetRender renderingState. */ + public renderingState: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState); + + /** TargetRender metadata. */ + public metadata?: (google.cloud.deploy.v1.IRenderMetadata|null); + + /** TargetRender failureCause. */ + public failureCause: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause); + + /** TargetRender failureMessage. */ + public failureMessage: string; + + /** + * Creates a new TargetRender instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetRender instance + */ + public static create(properties?: google.cloud.deploy.v1.Release.ITargetRender): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @param message TargetRender message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @param message TargetRender message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetRender message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Decodes a TargetRender message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Verifies a TargetRender message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetRender + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Creates a plain object from a TargetRender message. Also converts values to other types if specified. + * @param message TargetRender + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release.TargetRender, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetRender to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetRender + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TargetRender { + + /** TargetRenderState enum. */ + enum TargetRenderState { + TARGET_RENDER_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3 + } + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2, + CLOUD_BUILD_REQUEST_FAILED = 3, + VERIFICATION_CONFIG_NOT_FOUND = 4, + CUSTOM_ACTION_NOT_FOUND = 5, + DEPLOYMENT_STRATEGY_NOT_SUPPORTED = 6, + RENDER_FEATURE_NOT_SUPPORTED = 7 + } + } + + /** Properties of a ReleaseReadyCondition. */ + interface IReleaseReadyCondition { + + /** ReleaseReadyCondition status */ + status?: (boolean|null); + } + + /** Represents a ReleaseReadyCondition. */ + class ReleaseReadyCondition implements IReleaseReadyCondition { + + /** + * Constructs a new ReleaseReadyCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.Release.IReleaseReadyCondition); + + /** ReleaseReadyCondition status. */ + public status: boolean; + + /** + * Creates a new ReleaseReadyCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseReadyCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.Release.IReleaseReadyCondition): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + + /** + * Encodes the specified ReleaseReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. + * @param message ReleaseReadyCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.Release.IReleaseReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. + * @param message ReleaseReadyCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.Release.IReleaseReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseReadyCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + + /** + * Decodes a ReleaseReadyCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + + /** + * Verifies a ReleaseReadyCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseReadyCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseReadyCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.ReleaseReadyCondition; + + /** + * Creates a plain object from a ReleaseReadyCondition message. Also converts values to other types if specified. + * @param message ReleaseReadyCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release.ReleaseReadyCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseReadyCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseReadyCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SkaffoldSupportedCondition. */ + interface ISkaffoldSupportedCondition { + + /** SkaffoldSupportedCondition status */ + status?: (boolean|null); + + /** SkaffoldSupportedCondition skaffoldSupportState */ + skaffoldSupportState?: (google.cloud.deploy.v1.SkaffoldSupportState|keyof typeof google.cloud.deploy.v1.SkaffoldSupportState|null); + + /** SkaffoldSupportedCondition maintenanceModeTime */ + maintenanceModeTime?: (google.protobuf.ITimestamp|null); + + /** SkaffoldSupportedCondition supportExpirationTime */ + supportExpirationTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SkaffoldSupportedCondition. */ + class SkaffoldSupportedCondition implements ISkaffoldSupportedCondition { + + /** + * Constructs a new SkaffoldSupportedCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition); + + /** SkaffoldSupportedCondition status. */ + public status: boolean; + + /** SkaffoldSupportedCondition skaffoldSupportState. */ + public skaffoldSupportState: (google.cloud.deploy.v1.SkaffoldSupportState|keyof typeof google.cloud.deploy.v1.SkaffoldSupportState); + + /** SkaffoldSupportedCondition maintenanceModeTime. */ + public maintenanceModeTime?: (google.protobuf.ITimestamp|null); + + /** SkaffoldSupportedCondition supportExpirationTime. */ + public supportExpirationTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SkaffoldSupportedCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns SkaffoldSupportedCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + + /** * Encodes the specified SkaffoldSupportedCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify|verify} messages. * @param message SkaffoldSupportedCondition message or plain object to encode * @param [writer] Writer to encode to @@ -8287,171 +9542,861 @@ export namespace google { */ public static encode(message: google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified SkaffoldSupportedCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify|verify} messages. - * @param message SkaffoldSupportedCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified SkaffoldSupportedCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify|verify} messages. + * @param message SkaffoldSupportedCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkaffoldSupportedCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + + /** + * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkaffoldSupportedCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + + /** + * Verifies a SkaffoldSupportedCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkaffoldSupportedCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkaffoldSupportedCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + + /** + * Creates a plain object from a SkaffoldSupportedCondition message. Also converts values to other types if specified. + * @param message SkaffoldSupportedCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release.SkaffoldSupportedCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkaffoldSupportedCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkaffoldSupportedCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReleaseCondition. */ + interface IReleaseCondition { + + /** ReleaseCondition releaseReadyCondition */ + releaseReadyCondition?: (google.cloud.deploy.v1.Release.IReleaseReadyCondition|null); + + /** ReleaseCondition skaffoldSupportedCondition */ + skaffoldSupportedCondition?: (google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null); + } + + /** Represents a ReleaseCondition. */ + class ReleaseCondition implements IReleaseCondition { + + /** + * Constructs a new ReleaseCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.Release.IReleaseCondition); + + /** ReleaseCondition releaseReadyCondition. */ + public releaseReadyCondition?: (google.cloud.deploy.v1.Release.IReleaseReadyCondition|null); + + /** ReleaseCondition skaffoldSupportedCondition. */ + public skaffoldSupportedCondition?: (google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null); + + /** + * Creates a new ReleaseCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.Release.IReleaseCondition): google.cloud.deploy.v1.Release.ReleaseCondition; + + /** + * Encodes the specified ReleaseCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. + * @param message ReleaseCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.Release.IReleaseCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. + * @param message ReleaseCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.Release.IReleaseCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.ReleaseCondition; + + /** + * Decodes a ReleaseCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.ReleaseCondition; + + /** + * Verifies a ReleaseCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.ReleaseCondition; + + /** + * Creates a plain object from a ReleaseCondition message. Also converts values to other types if specified. + * @param message ReleaseCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release.ReleaseCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateDeployPolicyRequest. */ + interface ICreateDeployPolicyRequest { + + /** CreateDeployPolicyRequest parent */ + parent?: (string|null); + + /** CreateDeployPolicyRequest deployPolicyId */ + deployPolicyId?: (string|null); + + /** CreateDeployPolicyRequest deployPolicy */ + deployPolicy?: (google.cloud.deploy.v1.IDeployPolicy|null); + + /** CreateDeployPolicyRequest requestId */ + requestId?: (string|null); + + /** CreateDeployPolicyRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateDeployPolicyRequest. */ + class CreateDeployPolicyRequest implements ICreateDeployPolicyRequest { + + /** + * Constructs a new CreateDeployPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateDeployPolicyRequest); + + /** CreateDeployPolicyRequest parent. */ + public parent: string; + + /** CreateDeployPolicyRequest deployPolicyId. */ + public deployPolicyId: string; + + /** CreateDeployPolicyRequest deployPolicy. */ + public deployPolicy?: (google.cloud.deploy.v1.IDeployPolicy|null); + + /** CreateDeployPolicyRequest requestId. */ + public requestId: string; + + /** CreateDeployPolicyRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateDeployPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeployPolicyRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateDeployPolicyRequest): google.cloud.deploy.v1.CreateDeployPolicyRequest; + + /** + * Encodes the specified CreateDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateDeployPolicyRequest.verify|verify} messages. + * @param message CreateDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateDeployPolicyRequest.verify|verify} messages. + * @param message CreateDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeployPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateDeployPolicyRequest; + + /** + * Decodes a CreateDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateDeployPolicyRequest; + + /** + * Verifies a CreateDeployPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeployPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateDeployPolicyRequest; + + /** + * Creates a plain object from a CreateDeployPolicyRequest message. Also converts values to other types if specified. + * @param message CreateDeployPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateDeployPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeployPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeployPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeployPolicyRequest. */ + interface IUpdateDeployPolicyRequest { + + /** UpdateDeployPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDeployPolicyRequest deployPolicy */ + deployPolicy?: (google.cloud.deploy.v1.IDeployPolicy|null); + + /** UpdateDeployPolicyRequest requestId */ + requestId?: (string|null); + + /** UpdateDeployPolicyRequest allowMissing */ + allowMissing?: (boolean|null); + + /** UpdateDeployPolicyRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateDeployPolicyRequest. */ + class UpdateDeployPolicyRequest implements IUpdateDeployPolicyRequest { + + /** + * Constructs a new UpdateDeployPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IUpdateDeployPolicyRequest); + + /** UpdateDeployPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDeployPolicyRequest deployPolicy. */ + public deployPolicy?: (google.cloud.deploy.v1.IDeployPolicy|null); + + /** UpdateDeployPolicyRequest requestId. */ + public requestId: string; + + /** UpdateDeployPolicyRequest allowMissing. */ + public allowMissing: boolean; + + /** UpdateDeployPolicyRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateDeployPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeployPolicyRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IUpdateDeployPolicyRequest): google.cloud.deploy.v1.UpdateDeployPolicyRequest; + + /** + * Encodes the specified UpdateDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeployPolicyRequest.verify|verify} messages. + * @param message UpdateDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IUpdateDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeployPolicyRequest.verify|verify} messages. + * @param message UpdateDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IUpdateDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeployPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.UpdateDeployPolicyRequest; + + /** + * Decodes an UpdateDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.UpdateDeployPolicyRequest; + + /** + * Verifies an UpdateDeployPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeployPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.UpdateDeployPolicyRequest; + + /** + * Creates a plain object from an UpdateDeployPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateDeployPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.UpdateDeployPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeployPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeployPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeployPolicyRequest. */ + interface IDeleteDeployPolicyRequest { + + /** DeleteDeployPolicyRequest name */ + name?: (string|null); + + /** DeleteDeployPolicyRequest requestId */ + requestId?: (string|null); + + /** DeleteDeployPolicyRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteDeployPolicyRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteDeployPolicyRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteDeployPolicyRequest. */ + class DeleteDeployPolicyRequest implements IDeleteDeployPolicyRequest { + + /** + * Constructs a new DeleteDeployPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeleteDeployPolicyRequest); + + /** DeleteDeployPolicyRequest name. */ + public name: string; + + /** DeleteDeployPolicyRequest requestId. */ + public requestId: string; + + /** DeleteDeployPolicyRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteDeployPolicyRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteDeployPolicyRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteDeployPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeployPolicyRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeleteDeployPolicyRequest): google.cloud.deploy.v1.DeleteDeployPolicyRequest; + + /** + * Encodes the specified DeleteDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeployPolicyRequest.verify|verify} messages. + * @param message DeleteDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeleteDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeployPolicyRequest.verify|verify} messages. + * @param message DeleteDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeleteDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeployPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeleteDeployPolicyRequest; + + /** + * Decodes a DeleteDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeleteDeployPolicyRequest; + + /** + * Verifies a DeleteDeployPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeployPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeleteDeployPolicyRequest; + + /** + * Creates a plain object from a DeleteDeployPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteDeployPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeleteDeployPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeployPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeployPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeployPoliciesRequest. */ + interface IListDeployPoliciesRequest { + + /** ListDeployPoliciesRequest parent */ + parent?: (string|null); + + /** ListDeployPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListDeployPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListDeployPoliciesRequest filter */ + filter?: (string|null); + + /** ListDeployPoliciesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDeployPoliciesRequest. */ + class ListDeployPoliciesRequest implements IListDeployPoliciesRequest { + + /** + * Constructs a new ListDeployPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListDeployPoliciesRequest); + + /** ListDeployPoliciesRequest parent. */ + public parent: string; - /** - * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SkaffoldSupportedCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + /** ListDeployPoliciesRequest pageSize. */ + public pageSize: number; - /** - * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SkaffoldSupportedCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + /** ListDeployPoliciesRequest pageToken. */ + public pageToken: string; - /** - * Verifies a SkaffoldSupportedCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListDeployPoliciesRequest filter. */ + public filter: string; - /** - * Creates a SkaffoldSupportedCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SkaffoldSupportedCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.SkaffoldSupportedCondition; + /** ListDeployPoliciesRequest orderBy. */ + public orderBy: string; - /** - * Creates a plain object from a SkaffoldSupportedCondition message. Also converts values to other types if specified. - * @param message SkaffoldSupportedCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.deploy.v1.Release.SkaffoldSupportedCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new ListDeployPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeployPoliciesRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListDeployPoliciesRequest): google.cloud.deploy.v1.ListDeployPoliciesRequest; - /** - * Converts this SkaffoldSupportedCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Encodes the specified ListDeployPoliciesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesRequest.verify|verify} messages. + * @param message ListDeployPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListDeployPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Gets the default type url for SkaffoldSupportedCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Encodes the specified ListDeployPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesRequest.verify|verify} messages. + * @param message ListDeployPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListDeployPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a ReleaseCondition. */ - interface IReleaseCondition { + /** + * Decodes a ListDeployPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeployPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListDeployPoliciesRequest; - /** ReleaseCondition releaseReadyCondition */ - releaseReadyCondition?: (google.cloud.deploy.v1.Release.IReleaseReadyCondition|null); + /** + * Decodes a ListDeployPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeployPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListDeployPoliciesRequest; - /** ReleaseCondition skaffoldSupportedCondition */ - skaffoldSupportedCondition?: (google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null); - } + /** + * Verifies a ListDeployPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a ReleaseCondition. */ - class ReleaseCondition implements IReleaseCondition { + /** + * Creates a ListDeployPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeployPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListDeployPoliciesRequest; - /** - * Constructs a new ReleaseCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.deploy.v1.Release.IReleaseCondition); + /** + * Creates a plain object from a ListDeployPoliciesRequest message. Also converts values to other types if specified. + * @param message ListDeployPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListDeployPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ReleaseCondition releaseReadyCondition. */ - public releaseReadyCondition?: (google.cloud.deploy.v1.Release.IReleaseReadyCondition|null); + /** + * Converts this ListDeployPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ReleaseCondition skaffoldSupportedCondition. */ - public skaffoldSupportedCondition?: (google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null); + /** + * Gets the default type url for ListDeployPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a new ReleaseCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ReleaseCondition instance - */ - public static create(properties?: google.cloud.deploy.v1.Release.IReleaseCondition): google.cloud.deploy.v1.Release.ReleaseCondition; + /** Properties of a ListDeployPoliciesResponse. */ + interface IListDeployPoliciesResponse { - /** - * Encodes the specified ReleaseCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. - * @param message ReleaseCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.deploy.v1.Release.IReleaseCondition, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListDeployPoliciesResponse deployPolicies */ + deployPolicies?: (google.cloud.deploy.v1.IDeployPolicy[]|null); - /** - * Encodes the specified ReleaseCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. - * @param message ReleaseCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.deploy.v1.Release.IReleaseCondition, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListDeployPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); - /** - * Decodes a ReleaseCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReleaseCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.ReleaseCondition; + /** ListDeployPoliciesResponse unreachable */ + unreachable?: (string[]|null); + } - /** - * Decodes a ReleaseCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReleaseCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.ReleaseCondition; + /** Represents a ListDeployPoliciesResponse. */ + class ListDeployPoliciesResponse implements IListDeployPoliciesResponse { + + /** + * Constructs a new ListDeployPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListDeployPoliciesResponse); + + /** ListDeployPoliciesResponse deployPolicies. */ + public deployPolicies: google.cloud.deploy.v1.IDeployPolicy[]; + + /** ListDeployPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDeployPoliciesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDeployPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeployPoliciesResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListDeployPoliciesResponse): google.cloud.deploy.v1.ListDeployPoliciesResponse; + + /** + * Encodes the specified ListDeployPoliciesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesResponse.verify|verify} messages. + * @param message ListDeployPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListDeployPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeployPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesResponse.verify|verify} messages. + * @param message ListDeployPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListDeployPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeployPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeployPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListDeployPoliciesResponse; + + /** + * Decodes a ListDeployPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeployPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListDeployPoliciesResponse; + + /** + * Verifies a ListDeployPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeployPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeployPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListDeployPoliciesResponse; + + /** + * Creates a plain object from a ListDeployPoliciesResponse message. Also converts values to other types if specified. + * @param message ListDeployPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListDeployPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeployPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeployPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeployPolicyRequest. */ + interface IGetDeployPolicyRequest { + + /** GetDeployPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetDeployPolicyRequest. */ + class GetDeployPolicyRequest implements IGetDeployPolicyRequest { + + /** + * Constructs a new GetDeployPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetDeployPolicyRequest); + + /** GetDeployPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetDeployPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeployPolicyRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetDeployPolicyRequest): google.cloud.deploy.v1.GetDeployPolicyRequest; + + /** + * Encodes the specified GetDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetDeployPolicyRequest.verify|verify} messages. + * @param message GetDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetDeployPolicyRequest.verify|verify} messages. + * @param message GetDeployPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetDeployPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeployPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetDeployPolicyRequest; - /** - * Verifies a ReleaseCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a GetDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetDeployPolicyRequest; - /** - * Creates a ReleaseCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReleaseCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.ReleaseCondition; + /** + * Verifies a GetDeployPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a ReleaseCondition message. Also converts values to other types if specified. - * @param message ReleaseCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.deploy.v1.Release.ReleaseCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a GetDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeployPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetDeployPolicyRequest; - /** - * Converts this ReleaseCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a GetDeployPolicyRequest message. Also converts values to other types if specified. + * @param message GetDeployPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetDeployPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for ReleaseCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this GetDeployPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeployPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BuildArtifact. */ @@ -9434,6 +11379,9 @@ export namespace google { /** CreateReleaseRequest validateOnly */ validateOnly?: (boolean|null); + + /** CreateReleaseRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents a CreateReleaseRequest. */ @@ -9460,6 +11408,9 @@ export namespace google { /** CreateReleaseRequest validateOnly. */ public validateOnly: boolean; + /** CreateReleaseRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new CreateReleaseRequest instance using the specified properties. * @param [properties] Properties to set @@ -11866,6 +13817,9 @@ export namespace google { /** CreateRolloutRequest validateOnly */ validateOnly?: (boolean|null); + /** CreateRolloutRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); + /** CreateRolloutRequest startingPhaseId */ startingPhaseId?: (string|null); } @@ -11894,6 +13848,9 @@ export namespace google { /** CreateRolloutRequest validateOnly. */ public validateOnly: boolean; + /** CreateRolloutRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** CreateRolloutRequest startingPhaseId. */ public startingPhaseId: string; @@ -12116,6 +14073,9 @@ export namespace google { /** ApproveRolloutRequest approved */ approved?: (boolean|null); + + /** ApproveRolloutRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents an ApproveRolloutRequest. */ @@ -12133,6 +14093,9 @@ export namespace google { /** ApproveRolloutRequest approved. */ public approved: boolean; + /** ApproveRolloutRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new ApproveRolloutRequest instance using the specified properties. * @param [properties] Properties to set @@ -12310,6 +14273,9 @@ export namespace google { /** AdvanceRolloutRequest phaseId */ phaseId?: (string|null); + + /** AdvanceRolloutRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents an AdvanceRolloutRequest. */ @@ -12327,6 +14293,9 @@ export namespace google { /** AdvanceRolloutRequest phaseId. */ public phaseId: string; + /** AdvanceRolloutRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new AdvanceRolloutRequest instance using the specified properties. * @param [properties] Properties to set @@ -12501,6 +14470,9 @@ export namespace google { /** CancelRolloutRequest name */ name?: (string|null); + + /** CancelRolloutRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents a CancelRolloutRequest. */ @@ -12515,6 +14487,9 @@ export namespace google { /** CancelRolloutRequest name. */ public name: string; + /** CancelRolloutRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new CancelRolloutRequest instance using the specified properties. * @param [properties] Properties to set @@ -12695,6 +14670,9 @@ export namespace google { /** IgnoreJobRequest jobId */ jobId?: (string|null); + + /** IgnoreJobRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents an IgnoreJobRequest. */ @@ -12715,6 +14693,9 @@ export namespace google { /** IgnoreJobRequest jobId. */ public jobId: string; + /** IgnoreJobRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new IgnoreJobRequest instance using the specified properties. * @param [properties] Properties to set @@ -12895,6 +14876,9 @@ export namespace google { /** RetryJobRequest jobId */ jobId?: (string|null); + + /** RetryJobRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents a RetryJobRequest. */ @@ -12915,6 +14899,9 @@ export namespace google { /** RetryJobRequest jobId. */ public jobId: string; + /** RetryJobRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new RetryJobRequest instance using the specified properties. * @param [properties] Properties to set @@ -14518,6 +16505,9 @@ export namespace google { /** TerminateJobRunRequest name */ name?: (string|null); + + /** TerminateJobRunRequest overrideDeployPolicy */ + overrideDeployPolicy?: (string[]|null); } /** Represents a TerminateJobRunRequest. */ @@ -14532,6 +16522,9 @@ export namespace google { /** TerminateJobRunRequest name. */ public name: string; + /** TerminateJobRunRequest overrideDeployPolicy. */ + public overrideDeployPolicy: string[]; + /** * Creates a new TerminateJobRunRequest instance using the specified properties. * @param [properties] Properties to set @@ -16556,6 +18549,9 @@ export namespace google { /** AutomationRun stateDescription */ stateDescription?: (string|null); + /** AutomationRun policyViolation */ + policyViolation?: (google.cloud.deploy.v1.IPolicyViolation|null); + /** AutomationRun expireTime */ expireTime?: (google.protobuf.ITimestamp|null); @@ -16614,6 +18610,9 @@ export namespace google { /** AutomationRun stateDescription. */ public stateDescription: string; + /** AutomationRun policyViolation. */ + public policyViolation?: (google.cloud.deploy.v1.IPolicyViolation|null); + /** AutomationRun expireTime. */ public expireTime?: (google.protobuf.ITimestamp|null); @@ -18291,6 +20290,192 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DeployPolicyEvaluationEvent. */ + interface IDeployPolicyEvaluationEvent { + + /** DeployPolicyEvaluationEvent message */ + message?: (string|null); + + /** DeployPolicyEvaluationEvent ruleType */ + ruleType?: (string|null); + + /** DeployPolicyEvaluationEvent rule */ + rule?: (string|null); + + /** DeployPolicyEvaluationEvent pipelineUid */ + pipelineUid?: (string|null); + + /** DeployPolicyEvaluationEvent deliveryPipeline */ + deliveryPipeline?: (string|null); + + /** DeployPolicyEvaluationEvent targetUid */ + targetUid?: (string|null); + + /** DeployPolicyEvaluationEvent target */ + target?: (string|null); + + /** DeployPolicyEvaluationEvent invoker */ + invoker?: (google.cloud.deploy.v1.DeployPolicy.Invoker|keyof typeof google.cloud.deploy.v1.DeployPolicy.Invoker|null); + + /** DeployPolicyEvaluationEvent deployPolicy */ + deployPolicy?: (string|null); + + /** DeployPolicyEvaluationEvent deployPolicyUid */ + deployPolicyUid?: (string|null); + + /** DeployPolicyEvaluationEvent allowed */ + allowed?: (boolean|null); + + /** DeployPolicyEvaluationEvent verdict */ + verdict?: (google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict|keyof typeof google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict|null); + + /** DeployPolicyEvaluationEvent overrides */ + overrides?: (google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride[]|null); + } + + /** Represents a DeployPolicyEvaluationEvent. */ + class DeployPolicyEvaluationEvent implements IDeployPolicyEvaluationEvent { + + /** + * Constructs a new DeployPolicyEvaluationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployPolicyEvaluationEvent); + + /** DeployPolicyEvaluationEvent message. */ + public message: string; + + /** DeployPolicyEvaluationEvent ruleType. */ + public ruleType: string; + + /** DeployPolicyEvaluationEvent rule. */ + public rule: string; + + /** DeployPolicyEvaluationEvent pipelineUid. */ + public pipelineUid: string; + + /** DeployPolicyEvaluationEvent deliveryPipeline. */ + public deliveryPipeline: string; + + /** DeployPolicyEvaluationEvent targetUid. */ + public targetUid: string; + + /** DeployPolicyEvaluationEvent target. */ + public target: string; + + /** DeployPolicyEvaluationEvent invoker. */ + public invoker: (google.cloud.deploy.v1.DeployPolicy.Invoker|keyof typeof google.cloud.deploy.v1.DeployPolicy.Invoker); + + /** DeployPolicyEvaluationEvent deployPolicy. */ + public deployPolicy: string; + + /** DeployPolicyEvaluationEvent deployPolicyUid. */ + public deployPolicyUid: string; + + /** DeployPolicyEvaluationEvent allowed. */ + public allowed: boolean; + + /** DeployPolicyEvaluationEvent verdict. */ + public verdict: (google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict|keyof typeof google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict); + + /** DeployPolicyEvaluationEvent overrides. */ + public overrides: google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride[]; + + /** + * Creates a new DeployPolicyEvaluationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployPolicyEvaluationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployPolicyEvaluationEvent): google.cloud.deploy.v1.DeployPolicyEvaluationEvent; + + /** + * Encodes the specified DeployPolicyEvaluationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyEvaluationEvent.verify|verify} messages. + * @param message DeployPolicyEvaluationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployPolicyEvaluationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployPolicyEvaluationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyEvaluationEvent.verify|verify} messages. + * @param message DeployPolicyEvaluationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployPolicyEvaluationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployPolicyEvaluationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployPolicyEvaluationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployPolicyEvaluationEvent; + + /** + * Decodes a DeployPolicyEvaluationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployPolicyEvaluationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployPolicyEvaluationEvent; + + /** + * Verifies a DeployPolicyEvaluationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployPolicyEvaluationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployPolicyEvaluationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployPolicyEvaluationEvent; + + /** + * Creates a plain object from a DeployPolicyEvaluationEvent message. Also converts values to other types if specified. + * @param message DeployPolicyEvaluationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployPolicyEvaluationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployPolicyEvaluationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployPolicyEvaluationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployPolicyEvaluationEvent { + + /** PolicyVerdict enum. */ + enum PolicyVerdict { + POLICY_VERDICT_UNSPECIFIED = 0, + ALLOWED_BY_POLICY = 1, + DENIED_BY_POLICY = 2 + } + + /** PolicyVerdictOverride enum. */ + enum PolicyVerdictOverride { + POLICY_VERDICT_OVERRIDE_UNSPECIFIED = 0, + POLICY_OVERRIDDEN = 1, + POLICY_SUSPENDED = 2 + } + } + /** Properties of a DeployPolicyNotificationEvent. */ interface IDeployPolicyNotificationEvent { @@ -27122,5 +29307,132 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeOfDay; + + /** + * Verifies a TimeOfDay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeOfDay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } diff --git a/packages/google-cloud-deploy/protos/protos.js b/packages/google-cloud-deploy/protos/protos.js index 72885c1ea29..14fcbfecf4d 100644 --- a/packages/google-cloud-deploy/protos/protos.js +++ b/packages/google-cloud-deploy/protos/protos.js @@ -262,6 +262,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -321,6 +322,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -399,6 +404,7 @@ * @property {number} TYPE_RESTRICTION_VIOLATED=5 TYPE_RESTRICTION_VIOLATED value * @property {number} TYPE_RESOURCE_DELETED=6 TYPE_RESOURCE_DELETED value * @property {number} TYPE_ROLLOUT_UPDATE=7 TYPE_ROLLOUT_UPDATE value + * @property {number} TYPE_DEPLOY_POLICY_EVALUATION=8 TYPE_DEPLOY_POLICY_EVALUATION value * @property {number} TYPE_RENDER_STATUES_CHANGE=2 TYPE_RENDER_STATUES_CHANGE value */ v1.Type = (function() { @@ -410,6 +416,7 @@ values[valuesById[5] = "TYPE_RESTRICTION_VIOLATED"] = 5; values[valuesById[6] = "TYPE_RESOURCE_DELETED"] = 6; values[valuesById[7] = "TYPE_ROLLOUT_UPDATE"] = 7; + values[valuesById[8] = "TYPE_DEPLOY_POLICY_EVALUATION"] = 8; values[valuesById[2] = "TYPE_RENDER_STATUES_CHANGE"] = 2; return values; })(); @@ -664,6 +671,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -729,6 +737,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -1497,6 +1509,171 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createDeployPolicy}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateDeployPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDeployPolicy. + * @function createDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateDeployPolicyRequest} request CreateDeployPolicyRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateDeployPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createDeployPolicy = function createDeployPolicy(request, callback) { + return this.rpcCall(createDeployPolicy, $root.google.cloud.deploy.v1.CreateDeployPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDeployPolicy" }); + + /** + * Calls CreateDeployPolicy. + * @function createDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateDeployPolicyRequest} request CreateDeployPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateDeployPolicy}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef UpdateDeployPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDeployPolicy. + * @function updateDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateDeployPolicyRequest} request UpdateDeployPolicyRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.UpdateDeployPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.updateDeployPolicy = function updateDeployPolicy(request, callback) { + return this.rpcCall(updateDeployPolicy, $root.google.cloud.deploy.v1.UpdateDeployPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDeployPolicy" }); + + /** + * Calls UpdateDeployPolicy. + * @function updateDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateDeployPolicyRequest} request UpdateDeployPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteDeployPolicy}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef DeleteDeployPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDeployPolicy. + * @function deleteDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteDeployPolicyRequest} request DeleteDeployPolicyRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.DeleteDeployPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.deleteDeployPolicy = function deleteDeployPolicy(request, callback) { + return this.rpcCall(deleteDeployPolicy, $root.google.cloud.deploy.v1.DeleteDeployPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDeployPolicy" }); + + /** + * Calls DeleteDeployPolicy. + * @function deleteDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteDeployPolicyRequest} request DeleteDeployPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listDeployPolicies}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListDeployPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListDeployPoliciesResponse} [response] ListDeployPoliciesResponse + */ + + /** + * Calls ListDeployPolicies. + * @function listDeployPolicies + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListDeployPoliciesRequest} request ListDeployPoliciesRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListDeployPoliciesCallback} callback Node-style callback called with the error, if any, and ListDeployPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listDeployPolicies = function listDeployPolicies(request, callback) { + return this.rpcCall(listDeployPolicies, $root.google.cloud.deploy.v1.ListDeployPoliciesRequest, $root.google.cloud.deploy.v1.ListDeployPoliciesResponse, request, callback); + }, "name", { value: "ListDeployPolicies" }); + + /** + * Calls ListDeployPolicies. + * @function listDeployPolicies + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListDeployPoliciesRequest} request ListDeployPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getDeployPolicy}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetDeployPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.DeployPolicy} [response] DeployPolicy + */ + + /** + * Calls GetDeployPolicy. + * @function getDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetDeployPolicyRequest} request GetDeployPolicyRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetDeployPolicyCallback} callback Node-style callback called with the error, if any, and DeployPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getDeployPolicy = function getDeployPolicy(request, callback) { + return this.rpcCall(getDeployPolicy, $root.google.cloud.deploy.v1.GetDeployPolicyRequest, $root.google.cloud.deploy.v1.DeployPolicy, request, callback); + }, "name", { value: "GetDeployPolicy" }); + + /** + * Calls GetDeployPolicy. + * @function getDeployPolicy + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetDeployPolicyRequest} request GetDeployPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|approveRollout}. * @memberof google.cloud.deploy.v1.CloudDeploy @@ -10073,6 +10250,7 @@ * @property {string|null} [rolloutToRollBack] RollbackTargetRequest rolloutToRollBack * @property {google.cloud.deploy.v1.IRollbackTargetConfig|null} [rollbackConfig] RollbackTargetRequest rollbackConfig * @property {boolean|null} [validateOnly] RollbackTargetRequest validateOnly + * @property {Array.|null} [overrideDeployPolicy] RollbackTargetRequest overrideDeployPolicy */ /** @@ -10084,6 +10262,7 @@ * @param {google.cloud.deploy.v1.IRollbackTargetRequest=} [properties] Properties to set */ function RollbackTargetRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10146,6 +10325,14 @@ */ RollbackTargetRequest.prototype.validateOnly = false; + /** + * RollbackTargetRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.RollbackTargetRequest + * @instance + */ + RollbackTargetRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new RollbackTargetRequest instance using the specified properties. * @function create @@ -10184,6 +10371,9 @@ $root.google.cloud.deploy.v1.RollbackTargetConfig.encode(message.rollbackConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.validateOnly); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.overrideDeployPolicy[i]); return writer; }; @@ -10246,6 +10436,12 @@ message.validateOnly = reader.bool(); break; } + case 9: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -10304,6 +10500,13 @@ if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -10336,6 +10539,13 @@ } if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.RollbackTargetRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -10352,6 +10562,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) { object.name = ""; object.targetId = ""; @@ -10375,6 +10587,11 @@ object.rollbackConfig = $root.google.cloud.deploy.v1.RollbackTargetConfig.toObject(message.rollbackConfig, options); if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -18678,26 +18895,38 @@ return DeleteCustomTargetTypeRequest; })(); - v1.TargetAttribute = (function() { + v1.DeployPolicy = (function() { /** - * Properties of a TargetAttribute. + * Properties of a DeployPolicy. * @memberof google.cloud.deploy.v1 - * @interface ITargetAttribute - * @property {string|null} [id] TargetAttribute id - * @property {Object.|null} [labels] TargetAttribute labels - */ - - /** - * Constructs a new TargetAttribute. + * @interface IDeployPolicy + * @property {string|null} [name] DeployPolicy name + * @property {string|null} [uid] DeployPolicy uid + * @property {string|null} [description] DeployPolicy description + * @property {Object.|null} [annotations] DeployPolicy annotations + * @property {Object.|null} [labels] DeployPolicy labels + * @property {google.protobuf.ITimestamp|null} [createTime] DeployPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DeployPolicy updateTime + * @property {boolean|null} [suspended] DeployPolicy suspended + * @property {Array.|null} [selectors] DeployPolicy selectors + * @property {Array.|null} [rules] DeployPolicy rules + * @property {string|null} [etag] DeployPolicy etag + */ + + /** + * Constructs a new DeployPolicy. * @memberof google.cloud.deploy.v1 - * @classdesc Represents a TargetAttribute. - * @implements ITargetAttribute + * @classdesc Represents a DeployPolicy. + * @implements IDeployPolicy * @constructor - * @param {google.cloud.deploy.v1.ITargetAttribute=} [properties] Properties to set + * @param {google.cloud.deploy.v1.IDeployPolicy=} [properties] Properties to set */ - function TargetAttribute(properties) { + function DeployPolicy(properties) { + this.annotations = {}; this.labels = {}; + this.selectors = []; + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18705,89 +18934,213 @@ } /** - * TargetAttribute id. - * @member {string} id - * @memberof google.cloud.deploy.v1.TargetAttribute + * DeployPolicy name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeployPolicy * @instance */ - TargetAttribute.prototype.id = ""; + DeployPolicy.prototype.name = ""; /** - * TargetAttribute labels. + * DeployPolicy uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.uid = ""; + + /** + * DeployPolicy description. + * @member {string} description + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.description = ""; + + /** + * DeployPolicy annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.annotations = $util.emptyObject; + + /** + * DeployPolicy labels. * @member {Object.} labels - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @instance */ - TargetAttribute.prototype.labels = $util.emptyObject; + DeployPolicy.prototype.labels = $util.emptyObject; /** - * Creates a new TargetAttribute instance using the specified properties. + * DeployPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.createTime = null; + + /** + * DeployPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.updateTime = null; + + /** + * DeployPolicy suspended. + * @member {boolean} suspended + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.suspended = false; + + /** + * DeployPolicy selectors. + * @member {Array.} selectors + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.selectors = $util.emptyArray; + + /** + * DeployPolicy rules. + * @member {Array.} rules + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.rules = $util.emptyArray; + + /** + * DeployPolicy etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeployPolicy + * @instance + */ + DeployPolicy.prototype.etag = ""; + + /** + * Creates a new DeployPolicy instance using the specified properties. * @function create - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static - * @param {google.cloud.deploy.v1.ITargetAttribute=} [properties] Properties to set - * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute instance + * @param {google.cloud.deploy.v1.IDeployPolicy=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployPolicy} DeployPolicy instance */ - TargetAttribute.create = function create(properties) { - return new TargetAttribute(properties); + DeployPolicy.create = function create(properties) { + return new DeployPolicy(properties); }; /** - * Encodes the specified TargetAttribute message. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. + * Encodes the specified DeployPolicy message. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static - * @param {google.cloud.deploy.v1.ITargetAttribute} message TargetAttribute message or plain object to encode + * @param {google.cloud.deploy.v1.IDeployPolicy} message DeployPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TargetAttribute.encode = function encode(message, writer) { + DeployPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.suspended); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.deploy.v1.PolicyRule.encode(message.rules[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.selectors != null && message.selectors.length) + for (var i = 0; i < message.selectors.length; ++i) + $root.google.cloud.deploy.v1.DeployPolicyResourceSelector.encode(message.selectors[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified TargetAttribute message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. + * Encodes the specified DeployPolicy message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static - * @param {google.cloud.deploy.v1.ITargetAttribute} message TargetAttribute message or plain object to encode + * @param {google.cloud.deploy.v1.IDeployPolicy} message DeployPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TargetAttribute.encodeDelimited = function encodeDelimited(message, writer) { + DeployPolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TargetAttribute message from the specified reader or buffer. + * Decodes a DeployPolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute + * @returns {google.cloud.deploy.v1.DeployPolicy} DeployPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TargetAttribute.decode = function decode(reader, length) { + DeployPolicy.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetAttribute(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployPolicy(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.id = reader.string(); + message.name = reader.string(); break; } case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 5: { if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; @@ -18810,6 +19163,34 @@ message.labels[key] = value; break; } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.suspended = reader.bool(); + break; + } + case 12: { + if (!(message.selectors && message.selectors.length)) + message.selectors = []; + message.selectors.push($root.google.cloud.deploy.v1.DeployPolicyResourceSelector.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.deploy.v1.PolicyRule.decode(reader, reader.uint32())); + break; + } + case 11: { + message.etag = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18819,35 +19200,49 @@ }; /** - * Decodes a TargetAttribute message from the specified reader or buffer, length delimited. + * Decodes a DeployPolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute + * @returns {google.cloud.deploy.v1.DeployPolicy} DeployPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TargetAttribute.decodeDelimited = function decodeDelimited(reader) { + DeployPolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TargetAttribute message. + * Verifies a DeployPolicy message. * @function verify - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TargetAttribute.verify = function verify(message) { + DeployPolicy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; @@ -18856,137 +19251,244 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; + if (message.selectors != null && message.hasOwnProperty("selectors")) { + if (!Array.isArray(message.selectors)) + return "selectors: array expected"; + for (var i = 0; i < message.selectors.length; ++i) { + var error = $root.google.cloud.deploy.v1.DeployPolicyResourceSelector.verify(message.selectors[i]); + if (error) + return "selectors." + error; + } + } + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.cloud.deploy.v1.PolicyRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; return null; }; /** - * Creates a TargetAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a DeployPolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute + * @returns {google.cloud.deploy.v1.DeployPolicy} DeployPolicy */ - TargetAttribute.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.deploy.v1.TargetAttribute) + DeployPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployPolicy) return object; - var message = new $root.google.cloud.deploy.v1.TargetAttribute(); - if (object.id != null) - message.id = String(object.id); + var message = new $root.google.cloud.deploy.v1.DeployPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } if (object.labels) { if (typeof object.labels !== "object") - throw TypeError(".google.cloud.deploy.v1.TargetAttribute.labels: object expected"); + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.suspended != null) + message.suspended = Boolean(object.suspended); + if (object.selectors) { + if (!Array.isArray(object.selectors)) + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.selectors: array expected"); + message.selectors = []; + for (var i = 0; i < object.selectors.length; ++i) { + if (typeof object.selectors[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.selectors: object expected"); + message.selectors[i] = $root.google.cloud.deploy.v1.DeployPolicyResourceSelector.fromObject(object.selectors[i]); + } + } + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployPolicy.rules: object expected"); + message.rules[i] = $root.google.cloud.deploy.v1.PolicyRule.fromObject(object.rules[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a TargetAttribute message. Also converts values to other types if specified. + * Creates a plain object from a DeployPolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static - * @param {google.cloud.deploy.v1.TargetAttribute} message TargetAttribute + * @param {google.cloud.deploy.v1.DeployPolicy} message DeployPolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TargetAttribute.toObject = function toObject(message, options) { + DeployPolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) + if (options.arrays || options.defaults) { + object.rules = []; + object.selectors = []; + } + if (options.objects || options.defaults) { + object.annotations = {}; object.labels = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.suspended = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.deploy.v1.PolicyRule.toObject(message.rules[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.selectors && message.selectors.length) { + object.selectors = []; + for (var j = 0; j < message.selectors.length; ++j) + object.selectors[j] = $root.google.cloud.deploy.v1.DeployPolicyResourceSelector.toObject(message.selectors[j], options); + } return object; }; /** - * Converts this TargetAttribute to JSON. + * Converts this DeployPolicy to JSON. * @function toJSON - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @instance * @returns {Object.} JSON object */ - TargetAttribute.prototype.toJSON = function toJSON() { + DeployPolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TargetAttribute + * Gets the default type url for DeployPolicy * @function getTypeUrl - * @memberof google.cloud.deploy.v1.TargetAttribute + * @memberof google.cloud.deploy.v1.DeployPolicy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TargetAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeployPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.deploy.v1.TargetAttribute"; + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployPolicy"; }; - return TargetAttribute; + /** + * Invoker enum. + * @name google.cloud.deploy.v1.DeployPolicy.Invoker + * @enum {number} + * @property {number} INVOKER_UNSPECIFIED=0 INVOKER_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} DEPLOY_AUTOMATION=2 DEPLOY_AUTOMATION value + */ + DeployPolicy.Invoker = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVOKER_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "DEPLOY_AUTOMATION"] = 2; + return values; + })(); + + return DeployPolicy; })(); - v1.Release = (function() { + v1.DeployPolicyResourceSelector = (function() { /** - * Properties of a Release. + * Properties of a DeployPolicyResourceSelector. * @memberof google.cloud.deploy.v1 - * @interface IRelease - * @property {string|null} [name] Release name - * @property {string|null} [uid] Release uid - * @property {string|null} [description] Release description - * @property {Object.|null} [annotations] Release annotations - * @property {Object.|null} [labels] Release labels - * @property {boolean|null} [abandoned] Release abandoned - * @property {google.protobuf.ITimestamp|null} [createTime] Release createTime - * @property {google.protobuf.ITimestamp|null} [renderStartTime] Release renderStartTime - * @property {google.protobuf.ITimestamp|null} [renderEndTime] Release renderEndTime - * @property {string|null} [skaffoldConfigUri] Release skaffoldConfigUri - * @property {string|null} [skaffoldConfigPath] Release skaffoldConfigPath - * @property {Array.|null} [buildArtifacts] Release buildArtifacts - * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipelineSnapshot] Release deliveryPipelineSnapshot - * @property {Array.|null} [targetSnapshots] Release targetSnapshots - * @property {Array.|null} [customTargetTypeSnapshots] Release customTargetTypeSnapshots - * @property {google.cloud.deploy.v1.Release.RenderState|null} [renderState] Release renderState - * @property {string|null} [etag] Release etag - * @property {string|null} [skaffoldVersion] Release skaffoldVersion - * @property {Object.|null} [targetArtifacts] Release targetArtifacts - * @property {Object.|null} [targetRenders] Release targetRenders - * @property {google.cloud.deploy.v1.Release.IReleaseCondition|null} [condition] Release condition - * @property {Object.|null} [deployParameters] Release deployParameters + * @interface IDeployPolicyResourceSelector + * @property {google.cloud.deploy.v1.IDeliveryPipelineAttribute|null} [deliveryPipeline] DeployPolicyResourceSelector deliveryPipeline + * @property {google.cloud.deploy.v1.ITargetAttribute|null} [target] DeployPolicyResourceSelector target */ /** - * Constructs a new Release. + * Constructs a new DeployPolicyResourceSelector. * @memberof google.cloud.deploy.v1 - * @classdesc Represents a Release. - * @implements IRelease + * @classdesc Represents a DeployPolicyResourceSelector. + * @implements IDeployPolicyResourceSelector * @constructor - * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set + * @param {google.cloud.deploy.v1.IDeployPolicyResourceSelector=} [properties] Properties to set */ - function Release(properties) { - this.annotations = {}; - this.labels = {}; - this.buildArtifacts = []; - this.targetSnapshots = []; - this.customTargetTypeSnapshots = []; - this.targetArtifacts = {}; - this.targetRenders = {}; - this.deployParameters = {}; + function DeployPolicyResourceSelector(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18994,331 +19496,327 @@ } /** - * Release name. - * @member {string} name - * @memberof google.cloud.deploy.v1.Release - * @instance - */ - Release.prototype.name = ""; - - /** - * Release uid. - * @member {string} uid - * @memberof google.cloud.deploy.v1.Release - * @instance - */ - Release.prototype.uid = ""; - - /** - * Release description. - * @member {string} description - * @memberof google.cloud.deploy.v1.Release - * @instance - */ - Release.prototype.description = ""; - - /** - * Release annotations. - * @member {Object.} annotations - * @memberof google.cloud.deploy.v1.Release - * @instance - */ - Release.prototype.annotations = $util.emptyObject; - - /** - * Release labels. - * @member {Object.} labels - * @memberof google.cloud.deploy.v1.Release + * DeployPolicyResourceSelector deliveryPipeline. + * @member {google.cloud.deploy.v1.IDeliveryPipelineAttribute|null|undefined} deliveryPipeline + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector * @instance */ - Release.prototype.labels = $util.emptyObject; + DeployPolicyResourceSelector.prototype.deliveryPipeline = null; /** - * Release abandoned. - * @member {boolean} abandoned - * @memberof google.cloud.deploy.v1.Release + * DeployPolicyResourceSelector target. + * @member {google.cloud.deploy.v1.ITargetAttribute|null|undefined} target + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector * @instance */ - Release.prototype.abandoned = false; + DeployPolicyResourceSelector.prototype.target = null; /** - * Release createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.deploy.v1.Release - * @instance + * Creates a new DeployPolicyResourceSelector instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {google.cloud.deploy.v1.IDeployPolicyResourceSelector=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployPolicyResourceSelector} DeployPolicyResourceSelector instance */ - Release.prototype.createTime = null; + DeployPolicyResourceSelector.create = function create(properties) { + return new DeployPolicyResourceSelector(properties); + }; /** - * Release renderStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} renderStartTime - * @memberof google.cloud.deploy.v1.Release - * @instance + * Encodes the specified DeployPolicyResourceSelector message. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyResourceSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {google.cloud.deploy.v1.IDeployPolicyResourceSelector} message DeployPolicyResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Release.prototype.renderStartTime = null; + DeployPolicyResourceSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + $root.google.cloud.deploy.v1.DeliveryPipelineAttribute.encode(message.deliveryPipeline, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.deploy.v1.TargetAttribute.encode(message.target, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Release renderEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} renderEndTime - * @memberof google.cloud.deploy.v1.Release - * @instance + * Encodes the specified DeployPolicyResourceSelector message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyResourceSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {google.cloud.deploy.v1.IDeployPolicyResourceSelector} message DeployPolicyResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Release.prototype.renderEndTime = null; + DeployPolicyResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Release skaffoldConfigUri. - * @member {string} skaffoldConfigUri - * @memberof google.cloud.deploy.v1.Release - * @instance + * Decodes a DeployPolicyResourceSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeployPolicyResourceSelector} DeployPolicyResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Release.prototype.skaffoldConfigUri = ""; + DeployPolicyResourceSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployPolicyResourceSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipelineAttribute.decode(reader, reader.uint32()); + break; + } + case 2: { + message.target = $root.google.cloud.deploy.v1.TargetAttribute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Release skaffoldConfigPath. - * @member {string} skaffoldConfigPath - * @memberof google.cloud.deploy.v1.Release - * @instance + * Decodes a DeployPolicyResourceSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeployPolicyResourceSelector} DeployPolicyResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Release.prototype.skaffoldConfigPath = ""; + DeployPolicyResourceSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Release buildArtifacts. - * @member {Array.} buildArtifacts - * @memberof google.cloud.deploy.v1.Release - * @instance + * Verifies a DeployPolicyResourceSelector message. + * @function verify + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Release.prototype.buildArtifacts = $util.emptyArray; + DeployPolicyResourceSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipelineAttribute.verify(message.deliveryPipeline); + if (error) + return "deliveryPipeline." + error; + } + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.deploy.v1.TargetAttribute.verify(message.target); + if (error) + return "target." + error; + } + return null; + }; /** - * Release deliveryPipelineSnapshot. - * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipelineSnapshot - * @memberof google.cloud.deploy.v1.Release - * @instance + * Creates a DeployPolicyResourceSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeployPolicyResourceSelector} DeployPolicyResourceSelector */ - Release.prototype.deliveryPipelineSnapshot = null; + DeployPolicyResourceSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployPolicyResourceSelector) + return object; + var message = new $root.google.cloud.deploy.v1.DeployPolicyResourceSelector(); + if (object.deliveryPipeline != null) { + if (typeof object.deliveryPipeline !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployPolicyResourceSelector.deliveryPipeline: object expected"); + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipelineAttribute.fromObject(object.deliveryPipeline); + } + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployPolicyResourceSelector.target: object expected"); + message.target = $root.google.cloud.deploy.v1.TargetAttribute.fromObject(object.target); + } + return message; + }; /** - * Release targetSnapshots. - * @member {Array.} targetSnapshots - * @memberof google.cloud.deploy.v1.Release - * @instance + * Creates a plain object from a DeployPolicyResourceSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {google.cloud.deploy.v1.DeployPolicyResourceSelector} message DeployPolicyResourceSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Release.prototype.targetSnapshots = $util.emptyArray; + DeployPolicyResourceSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deliveryPipeline = null; + object.target = null; + } + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipelineAttribute.toObject(message.deliveryPipeline, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.deploy.v1.TargetAttribute.toObject(message.target, options); + return object; + }; /** - * Release customTargetTypeSnapshots. - * @member {Array.} customTargetTypeSnapshots - * @memberof google.cloud.deploy.v1.Release + * Converts this DeployPolicyResourceSelector to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector * @instance + * @returns {Object.} JSON object */ - Release.prototype.customTargetTypeSnapshots = $util.emptyArray; + DeployPolicyResourceSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Release renderState. - * @member {google.cloud.deploy.v1.Release.RenderState} renderState - * @memberof google.cloud.deploy.v1.Release - * @instance + * Gets the default type url for DeployPolicyResourceSelector + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeployPolicyResourceSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Release.prototype.renderState = 0; + DeployPolicyResourceSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployPolicyResourceSelector"; + }; - /** - * Release etag. - * @member {string} etag - * @memberof google.cloud.deploy.v1.Release - * @instance - */ - Release.prototype.etag = ""; + return DeployPolicyResourceSelector; + })(); - /** - * Release skaffoldVersion. - * @member {string} skaffoldVersion - * @memberof google.cloud.deploy.v1.Release - * @instance - */ - Release.prototype.skaffoldVersion = ""; + v1.DeliveryPipelineAttribute = (function() { /** - * Release targetArtifacts. - * @member {Object.} targetArtifacts - * @memberof google.cloud.deploy.v1.Release - * @instance + * Properties of a DeliveryPipelineAttribute. + * @memberof google.cloud.deploy.v1 + * @interface IDeliveryPipelineAttribute + * @property {string|null} [id] DeliveryPipelineAttribute id + * @property {Object.|null} [labels] DeliveryPipelineAttribute labels */ - Release.prototype.targetArtifacts = $util.emptyObject; /** - * Release targetRenders. - * @member {Object.} targetRenders - * @memberof google.cloud.deploy.v1.Release - * @instance + * Constructs a new DeliveryPipelineAttribute. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeliveryPipelineAttribute. + * @implements IDeliveryPipelineAttribute + * @constructor + * @param {google.cloud.deploy.v1.IDeliveryPipelineAttribute=} [properties] Properties to set */ - Release.prototype.targetRenders = $util.emptyObject; + function DeliveryPipelineAttribute(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Release condition. - * @member {google.cloud.deploy.v1.Release.IReleaseCondition|null|undefined} condition - * @memberof google.cloud.deploy.v1.Release + * DeliveryPipelineAttribute id. + * @member {string} id + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @instance */ - Release.prototype.condition = null; + DeliveryPipelineAttribute.prototype.id = ""; /** - * Release deployParameters. - * @member {Object.} deployParameters - * @memberof google.cloud.deploy.v1.Release + * DeliveryPipelineAttribute labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @instance */ - Release.prototype.deployParameters = $util.emptyObject; + DeliveryPipelineAttribute.prototype.labels = $util.emptyObject; /** - * Creates a new Release instance using the specified properties. + * Creates a new DeliveryPipelineAttribute instance using the specified properties. * @function create - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static - * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set - * @returns {google.cloud.deploy.v1.Release} Release instance + * @param {google.cloud.deploy.v1.IDeliveryPipelineAttribute=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeliveryPipelineAttribute} DeliveryPipelineAttribute instance */ - Release.create = function create(properties) { - return new Release(properties); + DeliveryPipelineAttribute.create = function create(properties) { + return new DeliveryPipelineAttribute(properties); }; /** - * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * Encodes the specified DeliveryPipelineAttribute message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineAttribute.verify|verify} messages. * @function encode - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static - * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {google.cloud.deploy.v1.IDeliveryPipelineAttribute} message DeliveryPipelineAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Release.encode = function encode(message, writer) { + DeliveryPipelineAttribute.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.renderStartTime != null && Object.hasOwnProperty.call(message, "renderStartTime")) - $root.google.protobuf.Timestamp.encode(message.renderStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.renderEndTime != null && Object.hasOwnProperty.call(message, "renderEndTime")) - $root.google.protobuf.Timestamp.encode(message.renderEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.skaffoldConfigPath != null && Object.hasOwnProperty.call(message, "skaffoldConfigPath")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.skaffoldConfigPath); - if (message.buildArtifacts != null && message.buildArtifacts.length) - for (var i = 0; i < message.buildArtifacts.length; ++i) - $root.google.cloud.deploy.v1.BuildArtifact.encode(message.buildArtifacts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.deliveryPipelineSnapshot != null && Object.hasOwnProperty.call(message, "deliveryPipelineSnapshot")) - $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipelineSnapshot, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.targetSnapshots != null && message.targetSnapshots.length) - for (var i = 0; i < message.targetSnapshots.length; ++i) - $root.google.cloud.deploy.v1.Target.encode(message.targetSnapshots[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.renderState != null && Object.hasOwnProperty.call(message, "renderState")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.renderState); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.etag); - if (message.skaffoldConfigUri != null && Object.hasOwnProperty.call(message, "skaffoldConfigUri")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.skaffoldConfigUri); - if (message.skaffoldVersion != null && Object.hasOwnProperty.call(message, "skaffoldVersion")) - writer.uint32(/* id 19, wireType 2 =*/154).string(message.skaffoldVersion); - if (message.targetArtifacts != null && Object.hasOwnProperty.call(message, "targetArtifacts")) - for (var keys = Object.keys(message.targetArtifacts), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.deploy.v1.TargetArtifact.encode(message.targetArtifacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.targetRenders != null && Object.hasOwnProperty.call(message, "targetRenders")) - for (var keys = Object.keys(message.targetRenders), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.deploy.v1.Release.TargetRender.encode(message.targetRenders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.abandoned != null && Object.hasOwnProperty.call(message, "abandoned")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.abandoned); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.cloud.deploy.v1.Release.ReleaseCondition.encode(message.condition, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.deployParameters != null && Object.hasOwnProperty.call(message, "deployParameters")) - for (var keys = Object.keys(message.deployParameters), i = 0; i < keys.length; ++i) - writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.deployParameters[keys[i]]).ldelim(); - if (message.customTargetTypeSnapshots != null && message.customTargetTypeSnapshots.length) - for (var i = 0; i < message.customTargetTypeSnapshots.length; ++i) - $root.google.cloud.deploy.v1.CustomTargetType.encode(message.customTargetTypeSnapshots[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * Encodes the specified DeliveryPipelineAttribute message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineAttribute.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static - * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {google.cloud.deploy.v1.IDeliveryPipelineAttribute} message DeliveryPipelineAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Release.encodeDelimited = function encodeDelimited(message, writer) { + DeliveryPipelineAttribute.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Release message from the specified reader or buffer. + * Decodes a DeliveryPipelineAttribute message from the specified reader or buffer. * @function decode - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.deploy.v1.Release} Release + * @returns {google.cloud.deploy.v1.DeliveryPipelineAttribute} DeliveryPipelineAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Release.decode = function decode(reader, length) { + DeliveryPipelineAttribute.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeliveryPipelineAttribute(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.id = reader.string(); break; } case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 5: { if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; @@ -19341,137 +19839,6 @@ message.labels[key] = value; break; } - case 23: { - message.abandoned = reader.bool(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.renderStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.renderEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 17: { - message.skaffoldConfigUri = reader.string(); - break; - } - case 9: { - message.skaffoldConfigPath = reader.string(); - break; - } - case 10: { - if (!(message.buildArtifacts && message.buildArtifacts.length)) - message.buildArtifacts = []; - message.buildArtifacts.push($root.google.cloud.deploy.v1.BuildArtifact.decode(reader, reader.uint32())); - break; - } - case 11: { - message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); - break; - } - case 12: { - if (!(message.targetSnapshots && message.targetSnapshots.length)) - message.targetSnapshots = []; - message.targetSnapshots.push($root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32())); - break; - } - case 27: { - if (!(message.customTargetTypeSnapshots && message.customTargetTypeSnapshots.length)) - message.customTargetTypeSnapshots = []; - message.customTargetTypeSnapshots.push($root.google.cloud.deploy.v1.CustomTargetType.decode(reader, reader.uint32())); - break; - } - case 13: { - message.renderState = reader.int32(); - break; - } - case 16: { - message.etag = reader.string(); - break; - } - case 19: { - message.skaffoldVersion = reader.string(); - break; - } - case 20: { - if (message.targetArtifacts === $util.emptyObject) - message.targetArtifacts = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.deploy.v1.TargetArtifact.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.targetArtifacts[key] = value; - break; - } - case 22: { - if (message.targetRenders === $util.emptyObject) - message.targetRenders = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.deploy.v1.Release.TargetRender.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.targetRenders[key] = value; - break; - } - case 24: { - message.condition = $root.google.cloud.deploy.v1.Release.ReleaseCondition.decode(reader, reader.uint32()); - break; - } - case 25: { - if (message.deployParameters === $util.emptyObject) - message.deployParameters = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.deployParameters[key] = value; - break; - } default: reader.skipType(tag & 7); break; @@ -19481,49 +19848,35 @@ }; /** - * Decodes a Release message from the specified reader or buffer, length delimited. + * Decodes a DeliveryPipelineAttribute message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.deploy.v1.Release} Release + * @returns {google.cloud.deploy.v1.DeliveryPipelineAttribute} DeliveryPipelineAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Release.decodeDelimited = function decodeDelimited(reader) { + DeliveryPipelineAttribute.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Release message. + * Verifies a DeliveryPipelineAttribute message. * @function verify - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Release.verify = function verify(message) { + DeliveryPipelineAttribute.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; @@ -19532,635 +19885,802 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.abandoned != null && message.hasOwnProperty("abandoned")) - if (typeof message.abandoned !== "boolean") - return "abandoned: boolean expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.renderStartTime); - if (error) - return "renderStartTime." + error; - } - if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.renderEndTime); - if (error) - return "renderEndTime." + error; - } - if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) - if (!$util.isString(message.skaffoldConfigUri)) - return "skaffoldConfigUri: string expected"; - if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) - if (!$util.isString(message.skaffoldConfigPath)) - return "skaffoldConfigPath: string expected"; - if (message.buildArtifacts != null && message.hasOwnProperty("buildArtifacts")) { - if (!Array.isArray(message.buildArtifacts)) - return "buildArtifacts: array expected"; - for (var i = 0; i < message.buildArtifacts.length; ++i) { - var error = $root.google.cloud.deploy.v1.BuildArtifact.verify(message.buildArtifacts[i]); - if (error) - return "buildArtifacts." + error; - } - } - if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) { - var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipelineSnapshot); - if (error) - return "deliveryPipelineSnapshot." + error; - } - if (message.targetSnapshots != null && message.hasOwnProperty("targetSnapshots")) { - if (!Array.isArray(message.targetSnapshots)) - return "targetSnapshots: array expected"; - for (var i = 0; i < message.targetSnapshots.length; ++i) { - var error = $root.google.cloud.deploy.v1.Target.verify(message.targetSnapshots[i]); - if (error) - return "targetSnapshots." + error; - } - } - if (message.customTargetTypeSnapshots != null && message.hasOwnProperty("customTargetTypeSnapshots")) { - if (!Array.isArray(message.customTargetTypeSnapshots)) - return "customTargetTypeSnapshots: array expected"; - for (var i = 0; i < message.customTargetTypeSnapshots.length; ++i) { - var error = $root.google.cloud.deploy.v1.CustomTargetType.verify(message.customTargetTypeSnapshots[i]); - if (error) - return "customTargetTypeSnapshots." + error; - } - } - if (message.renderState != null && message.hasOwnProperty("renderState")) - switch (message.renderState) { - default: - return "renderState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) - if (!$util.isString(message.skaffoldVersion)) - return "skaffoldVersion: string expected"; - if (message.targetArtifacts != null && message.hasOwnProperty("targetArtifacts")) { - if (!$util.isObject(message.targetArtifacts)) - return "targetArtifacts: object expected"; - var key = Object.keys(message.targetArtifacts); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.deploy.v1.TargetArtifact.verify(message.targetArtifacts[key[i]]); - if (error) - return "targetArtifacts." + error; - } - } - if (message.targetRenders != null && message.hasOwnProperty("targetRenders")) { - if (!$util.isObject(message.targetRenders)) - return "targetRenders: object expected"; - var key = Object.keys(message.targetRenders); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.deploy.v1.Release.TargetRender.verify(message.targetRenders[key[i]]); - if (error) - return "targetRenders." + error; - } - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.cloud.deploy.v1.Release.ReleaseCondition.verify(message.condition); - if (error) - return "condition." + error; - } - if (message.deployParameters != null && message.hasOwnProperty("deployParameters")) { - if (!$util.isObject(message.deployParameters)) - return "deployParameters: object expected"; - var key = Object.keys(message.deployParameters); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.deployParameters[key[i]])) - return "deployParameters: string{k:string} expected"; - } return null; }; /** - * Creates a Release message from a plain object. Also converts values to their respective internal types. + * Creates a DeliveryPipelineAttribute message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static * @param {Object.} object Plain object - * @returns {google.cloud.deploy.v1.Release} Release + * @returns {google.cloud.deploy.v1.DeliveryPipelineAttribute} DeliveryPipelineAttribute */ - Release.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.deploy.v1.Release) + DeliveryPipelineAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeliveryPipelineAttribute) return object; - var message = new $root.google.cloud.deploy.v1.Release(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.description != null) - message.description = String(object.description); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } + var message = new $root.google.cloud.deploy.v1.DeliveryPipelineAttribute(); + if (object.id != null) + message.id = String(object.id); if (object.labels) { if (typeof object.labels !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.labels: object expected"); + throw TypeError(".google.cloud.deploy.v1.DeliveryPipelineAttribute.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } - if (object.abandoned != null) - message.abandoned = Boolean(object.abandoned); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.renderStartTime != null) { - if (typeof object.renderStartTime !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.renderStartTime: object expected"); - message.renderStartTime = $root.google.protobuf.Timestamp.fromObject(object.renderStartTime); - } - if (object.renderEndTime != null) { - if (typeof object.renderEndTime !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.renderEndTime: object expected"); - message.renderEndTime = $root.google.protobuf.Timestamp.fromObject(object.renderEndTime); - } - if (object.skaffoldConfigUri != null) - message.skaffoldConfigUri = String(object.skaffoldConfigUri); - if (object.skaffoldConfigPath != null) - message.skaffoldConfigPath = String(object.skaffoldConfigPath); - if (object.buildArtifacts) { - if (!Array.isArray(object.buildArtifacts)) - throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: array expected"); - message.buildArtifacts = []; - for (var i = 0; i < object.buildArtifacts.length; ++i) { - if (typeof object.buildArtifacts[i] !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: object expected"); - message.buildArtifacts[i] = $root.google.cloud.deploy.v1.BuildArtifact.fromObject(object.buildArtifacts[i]); - } - } - if (object.deliveryPipelineSnapshot != null) { - if (typeof object.deliveryPipelineSnapshot !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.deliveryPipelineSnapshot: object expected"); - message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipelineSnapshot); - } - if (object.targetSnapshots) { - if (!Array.isArray(object.targetSnapshots)) - throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: array expected"); - message.targetSnapshots = []; - for (var i = 0; i < object.targetSnapshots.length; ++i) { - if (typeof object.targetSnapshots[i] !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: object expected"); - message.targetSnapshots[i] = $root.google.cloud.deploy.v1.Target.fromObject(object.targetSnapshots[i]); - } - } - if (object.customTargetTypeSnapshots) { - if (!Array.isArray(object.customTargetTypeSnapshots)) - throw TypeError(".google.cloud.deploy.v1.Release.customTargetTypeSnapshots: array expected"); - message.customTargetTypeSnapshots = []; - for (var i = 0; i < object.customTargetTypeSnapshots.length; ++i) { - if (typeof object.customTargetTypeSnapshots[i] !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.customTargetTypeSnapshots: object expected"); - message.customTargetTypeSnapshots[i] = $root.google.cloud.deploy.v1.CustomTargetType.fromObject(object.customTargetTypeSnapshots[i]); - } - } - switch (object.renderState) { - default: - if (typeof object.renderState === "number") { - message.renderState = object.renderState; - break; - } - break; - case "RENDER_STATE_UNSPECIFIED": - case 0: - message.renderState = 0; - break; - case "SUCCEEDED": - case 1: - message.renderState = 1; - break; - case "FAILED": - case 2: - message.renderState = 2; - break; - case "IN_PROGRESS": - case 3: - message.renderState = 3; - break; - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.skaffoldVersion != null) - message.skaffoldVersion = String(object.skaffoldVersion); - if (object.targetArtifacts) { - if (typeof object.targetArtifacts !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); - message.targetArtifacts = {}; - for (var keys = Object.keys(object.targetArtifacts), i = 0; i < keys.length; ++i) { - if (typeof object.targetArtifacts[keys[i]] !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); - message.targetArtifacts[keys[i]] = $root.google.cloud.deploy.v1.TargetArtifact.fromObject(object.targetArtifacts[keys[i]]); - } - } - if (object.targetRenders) { - if (typeof object.targetRenders !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); - message.targetRenders = {}; - for (var keys = Object.keys(object.targetRenders), i = 0; i < keys.length; ++i) { - if (typeof object.targetRenders[keys[i]] !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); - message.targetRenders[keys[i]] = $root.google.cloud.deploy.v1.Release.TargetRender.fromObject(object.targetRenders[keys[i]]); - } - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.condition: object expected"); - message.condition = $root.google.cloud.deploy.v1.Release.ReleaseCondition.fromObject(object.condition); - } - if (object.deployParameters) { - if (typeof object.deployParameters !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.deployParameters: object expected"); - message.deployParameters = {}; - for (var keys = Object.keys(object.deployParameters), i = 0; i < keys.length; ++i) - message.deployParameters[keys[i]] = String(object.deployParameters[keys[i]]); - } return message; }; /** - * Creates a plain object from a Release message. Also converts values to other types if specified. + * Creates a plain object from a DeliveryPipelineAttribute message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute * @static - * @param {google.cloud.deploy.v1.Release} message Release + * @param {google.cloud.deploy.v1.DeliveryPipelineAttribute} message DeliveryPipelineAttribute * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Release.toObject = function toObject(message, options) { + DeliveryPipelineAttribute.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.buildArtifacts = []; - object.targetSnapshots = []; - object.customTargetTypeSnapshots = []; - } - if (options.objects || options.defaults) { - object.annotations = {}; + if (options.objects || options.defaults) object.labels = {}; - object.targetArtifacts = {}; - object.targetRenders = {}; - object.deployParameters = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - object.description = ""; - object.createTime = null; - object.renderStartTime = null; - object.renderEndTime = null; - object.skaffoldConfigPath = ""; - object.deliveryPipelineSnapshot = null; - object.renderState = options.enums === String ? "RENDER_STATE_UNSPECIFIED" : 0; - object.etag = ""; - object.skaffoldConfigUri = ""; - object.skaffoldVersion = ""; - object.abandoned = false; - object.condition = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; var keys2; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) - object.renderStartTime = $root.google.protobuf.Timestamp.toObject(message.renderStartTime, options); - if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) - object.renderEndTime = $root.google.protobuf.Timestamp.toObject(message.renderEndTime, options); - if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) - object.skaffoldConfigPath = message.skaffoldConfigPath; - if (message.buildArtifacts && message.buildArtifacts.length) { - object.buildArtifacts = []; - for (var j = 0; j < message.buildArtifacts.length; ++j) - object.buildArtifacts[j] = $root.google.cloud.deploy.v1.BuildArtifact.toObject(message.buildArtifacts[j], options); + return object; + }; + + /** + * Converts this DeliveryPipelineAttribute to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute + * @instance + * @returns {Object.} JSON object + */ + DeliveryPipelineAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeliveryPipelineAttribute + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeliveryPipelineAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeliveryPipelineAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) - object.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipelineSnapshot, options); - if (message.targetSnapshots && message.targetSnapshots.length) { - object.targetSnapshots = []; - for (var j = 0; j < message.targetSnapshots.length; ++j) - object.targetSnapshots[j] = $root.google.cloud.deploy.v1.Target.toObject(message.targetSnapshots[j], options); + return typeUrlPrefix + "/google.cloud.deploy.v1.DeliveryPipelineAttribute"; + }; + + return DeliveryPipelineAttribute; + })(); + + v1.TargetAttribute = (function() { + + /** + * Properties of a TargetAttribute. + * @memberof google.cloud.deploy.v1 + * @interface ITargetAttribute + * @property {string|null} [id] TargetAttribute id + * @property {Object.|null} [labels] TargetAttribute labels + */ + + /** + * Constructs a new TargetAttribute. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TargetAttribute. + * @implements ITargetAttribute + * @constructor + * @param {google.cloud.deploy.v1.ITargetAttribute=} [properties] Properties to set + */ + function TargetAttribute(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetAttribute id. + * @member {string} id + * @memberof google.cloud.deploy.v1.TargetAttribute + * @instance + */ + TargetAttribute.prototype.id = ""; + + /** + * TargetAttribute labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.TargetAttribute + * @instance + */ + TargetAttribute.prototype.labels = $util.emptyObject; + + /** + * Creates a new TargetAttribute instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {google.cloud.deploy.v1.ITargetAttribute=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute instance + */ + TargetAttribute.create = function create(properties) { + return new TargetAttribute(properties); + }; + + /** + * Encodes the specified TargetAttribute message. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {google.cloud.deploy.v1.ITargetAttribute} message TargetAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetAttribute message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {google.cloud.deploy.v1.ITargetAttribute} message TargetAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetAttribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetAttribute(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (message.renderState != null && message.hasOwnProperty("renderState")) - object.renderState = options.enums === String ? $root.google.cloud.deploy.v1.Release.RenderState[message.renderState] === undefined ? message.renderState : $root.google.cloud.deploy.v1.Release.RenderState[message.renderState] : message.renderState; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) - object.skaffoldConfigUri = message.skaffoldConfigUri; - if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) - object.skaffoldVersion = message.skaffoldVersion; - if (message.targetArtifacts && (keys2 = Object.keys(message.targetArtifacts)).length) { - object.targetArtifacts = {}; - for (var j = 0; j < keys2.length; ++j) - object.targetArtifacts[keys2[j]] = $root.google.cloud.deploy.v1.TargetArtifact.toObject(message.targetArtifacts[keys2[j]], options); + return message; + }; + + /** + * Decodes a TargetAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetAttribute message. + * @function verify + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; } - if (message.targetRenders && (keys2 = Object.keys(message.targetRenders)).length) { - object.targetRenders = {}; - for (var j = 0; j < keys2.length; ++j) - object.targetRenders[keys2[j]] = $root.google.cloud.deploy.v1.Release.TargetRender.toObject(message.targetRenders[keys2[j]], options); + return null; + }; + + /** + * Creates a TargetAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TargetAttribute} TargetAttribute + */ + TargetAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TargetAttribute) + return object; + var message = new $root.google.cloud.deploy.v1.TargetAttribute(); + if (object.id != null) + message.id = String(object.id); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.TargetAttribute.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); } - if (message.abandoned != null && message.hasOwnProperty("abandoned")) - object.abandoned = message.abandoned; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.cloud.deploy.v1.Release.ReleaseCondition.toObject(message.condition, options); - if (message.deployParameters && (keys2 = Object.keys(message.deployParameters)).length) { - object.deployParameters = {}; + return message; + }; + + /** + * Creates a plain object from a TargetAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TargetAttribute + * @static + * @param {google.cloud.deploy.v1.TargetAttribute} message TargetAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; for (var j = 0; j < keys2.length; ++j) - object.deployParameters[keys2[j]] = message.deployParameters[keys2[j]]; - } - if (message.customTargetTypeSnapshots && message.customTargetTypeSnapshots.length) { - object.customTargetTypeSnapshots = []; - for (var j = 0; j < message.customTargetTypeSnapshots.length; ++j) - object.customTargetTypeSnapshots[j] = $root.google.cloud.deploy.v1.CustomTargetType.toObject(message.customTargetTypeSnapshots[j], options); + object.labels[keys2[j]] = message.labels[keys2[j]]; } return object; }; /** - * Converts this Release to JSON. + * Converts this TargetAttribute to JSON. * @function toJSON - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.TargetAttribute * @instance * @returns {Object.} JSON object */ - Release.prototype.toJSON = function toJSON() { + TargetAttribute.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Release + * Gets the default type url for TargetAttribute * @function getTypeUrl - * @memberof google.cloud.deploy.v1.Release + * @memberof google.cloud.deploy.v1.TargetAttribute * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Release.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TargetAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.deploy.v1.Release"; + return typeUrlPrefix + "/google.cloud.deploy.v1.TargetAttribute"; }; + return TargetAttribute; + })(); + + v1.PolicyRule = (function() { + /** - * RenderState enum. - * @name google.cloud.deploy.v1.Release.RenderState - * @enum {number} - * @property {number} RENDER_STATE_UNSPECIFIED=0 RENDER_STATE_UNSPECIFIED value - * @property {number} SUCCEEDED=1 SUCCEEDED value - * @property {number} FAILED=2 FAILED value - * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * Properties of a PolicyRule. + * @memberof google.cloud.deploy.v1 + * @interface IPolicyRule + * @property {google.cloud.deploy.v1.IRolloutRestriction|null} [rolloutRestriction] PolicyRule rolloutRestriction */ - Release.RenderState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RENDER_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SUCCEEDED"] = 1; - values[valuesById[2] = "FAILED"] = 2; - values[valuesById[3] = "IN_PROGRESS"] = 3; - return values; - })(); - Release.TargetRender = (function() { + /** + * Constructs a new PolicyRule. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PolicyRule. + * @implements IPolicyRule + * @constructor + * @param {google.cloud.deploy.v1.IPolicyRule=} [properties] Properties to set + */ + function PolicyRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a TargetRender. - * @memberof google.cloud.deploy.v1.Release - * @interface ITargetRender - * @property {string|null} [renderingBuild] TargetRender renderingBuild - * @property {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null} [renderingState] TargetRender renderingState - * @property {google.cloud.deploy.v1.IRenderMetadata|null} [metadata] TargetRender metadata - * @property {google.cloud.deploy.v1.Release.TargetRender.FailureCause|null} [failureCause] TargetRender failureCause - * @property {string|null} [failureMessage] TargetRender failureMessage - */ + /** + * PolicyRule rolloutRestriction. + * @member {google.cloud.deploy.v1.IRolloutRestriction|null|undefined} rolloutRestriction + * @memberof google.cloud.deploy.v1.PolicyRule + * @instance + */ + PolicyRule.prototype.rolloutRestriction = null; - /** - * Constructs a new TargetRender. - * @memberof google.cloud.deploy.v1.Release - * @classdesc Represents a TargetRender. - * @implements ITargetRender - * @constructor - * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set - */ - function TargetRender(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * TargetRender renderingBuild. - * @member {string} renderingBuild - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @instance - */ - TargetRender.prototype.renderingBuild = ""; + /** + * PolicyRule rule. + * @member {"rolloutRestriction"|undefined} rule + * @memberof google.cloud.deploy.v1.PolicyRule + * @instance + */ + Object.defineProperty(PolicyRule.prototype, "rule", { + get: $util.oneOfGetter($oneOfFields = ["rolloutRestriction"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * TargetRender renderingState. - * @member {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState} renderingState - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @instance - */ - TargetRender.prototype.renderingState = 0; + /** + * Creates a new PolicyRule instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {google.cloud.deploy.v1.IPolicyRule=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PolicyRule} PolicyRule instance + */ + PolicyRule.create = function create(properties) { + return new PolicyRule(properties); + }; - /** - * TargetRender metadata. - * @member {google.cloud.deploy.v1.IRenderMetadata|null|undefined} metadata - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @instance - */ - TargetRender.prototype.metadata = null; + /** + * Encodes the specified PolicyRule message. Does not implicitly {@link google.cloud.deploy.v1.PolicyRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {google.cloud.deploy.v1.IPolicyRule} message PolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rolloutRestriction != null && Object.hasOwnProperty.call(message, "rolloutRestriction")) + $root.google.cloud.deploy.v1.RolloutRestriction.encode(message.rolloutRestriction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * TargetRender failureCause. - * @member {google.cloud.deploy.v1.Release.TargetRender.FailureCause} failureCause - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @instance - */ - TargetRender.prototype.failureCause = 0; + /** + * Encodes the specified PolicyRule message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PolicyRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {google.cloud.deploy.v1.IPolicyRule} message PolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * TargetRender failureMessage. - * @member {string} failureMessage - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @instance - */ - TargetRender.prototype.failureMessage = ""; + /** + * Decodes a PolicyRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PolicyRule} PolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PolicyRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.rolloutRestriction = $root.google.cloud.deploy.v1.RolloutRestriction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new TargetRender instance using the specified properties. - * @function create - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set - * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender instance - */ - TargetRender.create = function create(properties) { - return new TargetRender(properties); - }; + /** + * Decodes a PolicyRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PolicyRule} PolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. - * @function encode - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TargetRender.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.renderingBuild != null && Object.hasOwnProperty.call(message, "renderingBuild")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderingBuild); - if (message.renderingState != null && Object.hasOwnProperty.call(message, "renderingState")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.renderingState); - if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCause); - if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.failureMessage); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.deploy.v1.RenderMetadata.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Verifies a PolicyRule message. + * @function verify + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rolloutRestriction != null && message.hasOwnProperty("rolloutRestriction")) { + properties.rule = 1; + { + var error = $root.google.cloud.deploy.v1.RolloutRestriction.verify(message.rolloutRestriction); + if (error) + return "rolloutRestriction." + error; + } + } + return null; + }; - /** - * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TargetRender.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a PolicyRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PolicyRule} PolicyRule + */ + PolicyRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PolicyRule) + return object; + var message = new $root.google.cloud.deploy.v1.PolicyRule(); + if (object.rolloutRestriction != null) { + if (typeof object.rolloutRestriction !== "object") + throw TypeError(".google.cloud.deploy.v1.PolicyRule.rolloutRestriction: object expected"); + message.rolloutRestriction = $root.google.cloud.deploy.v1.RolloutRestriction.fromObject(object.rolloutRestriction); + } + return message; + }; - /** - * Decodes a TargetRender message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TargetRender.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.TargetRender(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.renderingBuild = reader.string(); - break; - } - case 2: { - message.renderingState = reader.int32(); - break; - } - case 6: { - message.metadata = $root.google.cloud.deploy.v1.RenderMetadata.decode(reader, reader.uint32()); - break; - } - case 4: { - message.failureCause = reader.int32(); - break; - } - case 5: { - message.failureMessage = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Creates a plain object from a PolicyRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {google.cloud.deploy.v1.PolicyRule} message PolicyRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rolloutRestriction != null && message.hasOwnProperty("rolloutRestriction")) { + object.rolloutRestriction = $root.google.cloud.deploy.v1.RolloutRestriction.toObject(message.rolloutRestriction, options); + if (options.oneofs) + object.rule = "rolloutRestriction"; + } + return object; + }; + + /** + * Converts this PolicyRule to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PolicyRule + * @instance + * @returns {Object.} JSON object + */ + PolicyRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyRule + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PolicyRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PolicyRule"; + }; + + return PolicyRule; + })(); + + v1.RolloutRestriction = (function() { + + /** + * Properties of a RolloutRestriction. + * @memberof google.cloud.deploy.v1 + * @interface IRolloutRestriction + * @property {string|null} [id] RolloutRestriction id + * @property {Array.|null} [invokers] RolloutRestriction invokers + * @property {Array.|null} [actions] RolloutRestriction actions + * @property {google.cloud.deploy.v1.ITimeWindows|null} [timeWindows] RolloutRestriction timeWindows + */ + + /** + * Constructs a new RolloutRestriction. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a RolloutRestriction. + * @implements IRolloutRestriction + * @constructor + * @param {google.cloud.deploy.v1.IRolloutRestriction=} [properties] Properties to set + */ + function RolloutRestriction(properties) { + this.invokers = []; + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutRestriction id. + * @member {string} id + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @instance + */ + RolloutRestriction.prototype.id = ""; + + /** + * RolloutRestriction invokers. + * @member {Array.} invokers + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @instance + */ + RolloutRestriction.prototype.invokers = $util.emptyArray; + + /** + * RolloutRestriction actions. + * @member {Array.} actions + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @instance + */ + RolloutRestriction.prototype.actions = $util.emptyArray; + + /** + * RolloutRestriction timeWindows. + * @member {google.cloud.deploy.v1.ITimeWindows|null|undefined} timeWindows + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @instance + */ + RolloutRestriction.prototype.timeWindows = null; + + /** + * Creates a new RolloutRestriction instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {google.cloud.deploy.v1.IRolloutRestriction=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.RolloutRestriction} RolloutRestriction instance + */ + RolloutRestriction.create = function create(properties) { + return new RolloutRestriction(properties); + }; + + /** + * Encodes the specified RolloutRestriction message. Does not implicitly {@link google.cloud.deploy.v1.RolloutRestriction.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {google.cloud.deploy.v1.IRolloutRestriction} message RolloutRestriction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutRestriction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.invokers != null && message.invokers.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.invokers.length; ++i) + writer.int32(message.invokers[i]); + writer.ldelim(); + } + if (message.actions != null && message.actions.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.actions.length; ++i) + writer.int32(message.actions[i]); + writer.ldelim(); + } + if (message.timeWindows != null && Object.hasOwnProperty.call(message, "timeWindows")) + $root.google.cloud.deploy.v1.TimeWindows.encode(message.timeWindows, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RolloutRestriction message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RolloutRestriction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {google.cloud.deploy.v1.IRolloutRestriction} message RolloutRestriction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutRestriction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutRestriction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.RolloutRestriction} RolloutRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutRestriction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.RolloutRestriction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.invokers && message.invokers.length)) + message.invokers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.invokers.push(reader.int32()); + } else + message.invokers.push(reader.int32()); + break; + } + case 3: { + if (!(message.actions && message.actions.length)) + message.actions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.actions.push(reader.int32()); + } else + message.actions.push(reader.int32()); + break; + } + case 4: { + message.timeWindows = $root.google.cloud.deploy.v1.TimeWindows.decode(reader, reader.uint32()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a TargetRender message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TargetRender.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a RolloutRestriction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.RolloutRestriction} RolloutRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutRestriction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a TargetRender message. - * @function verify - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TargetRender.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) - if (!$util.isString(message.renderingBuild)) - return "renderingBuild: string expected"; - if (message.renderingState != null && message.hasOwnProperty("renderingState")) - switch (message.renderingState) { + /** + * Verifies a RolloutRestriction message. + * @function verify + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutRestriction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.invokers != null && message.hasOwnProperty("invokers")) { + if (!Array.isArray(message.invokers)) + return "invokers: array expected"; + for (var i = 0; i < message.invokers.length; ++i) + switch (message.invokers[i]) { default: - return "renderingState: enum value expected"; + return "invokers: enum value[] expected"; case 0: case 1: case 2: - case 3: break; } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.deploy.v1.RenderMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.failureCause != null && message.hasOwnProperty("failureCause")) - switch (message.failureCause) { + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) + switch (message.actions[i]) { default: - return "failureCause: enum value expected"; + return "actions: enum value[] expected"; case 0: case 1: case 2: @@ -20169,961 +20689,5477 @@ case 5: case 6: case 7: + case 8: break; } - if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) - if (!$util.isString(message.failureMessage)) - return "failureMessage: string expected"; - return null; - }; + } + if (message.timeWindows != null && message.hasOwnProperty("timeWindows")) { + var error = $root.google.cloud.deploy.v1.TimeWindows.verify(message.timeWindows); + if (error) + return "timeWindows." + error; + } + return null; + }; - /** - * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender - */ - TargetRender.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.deploy.v1.Release.TargetRender) - return object; - var message = new $root.google.cloud.deploy.v1.Release.TargetRender(); - if (object.renderingBuild != null) - message.renderingBuild = String(object.renderingBuild); - switch (object.renderingState) { - default: - if (typeof object.renderingState === "number") { - message.renderingState = object.renderingState; + /** + * Creates a RolloutRestriction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.RolloutRestriction} RolloutRestriction + */ + RolloutRestriction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.RolloutRestriction) + return object; + var message = new $root.google.cloud.deploy.v1.RolloutRestriction(); + if (object.id != null) + message.id = String(object.id); + if (object.invokers) { + if (!Array.isArray(object.invokers)) + throw TypeError(".google.cloud.deploy.v1.RolloutRestriction.invokers: array expected"); + message.invokers = []; + for (var i = 0; i < object.invokers.length; ++i) + switch (object.invokers[i]) { + default: + if (typeof object.invokers[i] === "number") { + message.invokers[i] = object.invokers[i]; + break; + } + case "INVOKER_UNSPECIFIED": + case 0: + message.invokers[i] = 0; + break; + case "USER": + case 1: + message.invokers[i] = 1; + break; + case "DEPLOY_AUTOMATION": + case 2: + message.invokers[i] = 2; break; } - break; - case "TARGET_RENDER_STATE_UNSPECIFIED": - case 0: - message.renderingState = 0; - break; - case "SUCCEEDED": - case 1: - message.renderingState = 1; - break; - case "FAILED": - case 2: - message.renderingState = 2; - break; - case "IN_PROGRESS": - case 3: - message.renderingState = 3; - break; - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.TargetRender.metadata: object expected"); - message.metadata = $root.google.cloud.deploy.v1.RenderMetadata.fromObject(object.metadata); - } - switch (object.failureCause) { - default: - if (typeof object.failureCause === "number") { - message.failureCause = object.failureCause; + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.deploy.v1.RolloutRestriction.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) + switch (object.actions[i]) { + default: + if (typeof object.actions[i] === "number") { + message.actions[i] = object.actions[i]; + break; + } + case "ROLLOUT_ACTIONS_UNSPECIFIED": + case 0: + message.actions[i] = 0; + break; + case "ADVANCE": + case 1: + message.actions[i] = 1; + break; + case "APPROVE": + case 2: + message.actions[i] = 2; + break; + case "CANCEL": + case 3: + message.actions[i] = 3; + break; + case "CREATE": + case 4: + message.actions[i] = 4; + break; + case "IGNORE_JOB": + case 5: + message.actions[i] = 5; + break; + case "RETRY_JOB": + case 6: + message.actions[i] = 6; + break; + case "ROLLBACK": + case 7: + message.actions[i] = 7; + break; + case "TERMINATE_JOBRUN": + case 8: + message.actions[i] = 8; break; } - break; - case "FAILURE_CAUSE_UNSPECIFIED": - case 0: - message.failureCause = 0; - break; - case "CLOUD_BUILD_UNAVAILABLE": - case 1: - message.failureCause = 1; - break; - case "EXECUTION_FAILED": - case 2: - message.failureCause = 2; - break; - case "CLOUD_BUILD_REQUEST_FAILED": - case 3: - message.failureCause = 3; - break; - case "VERIFICATION_CONFIG_NOT_FOUND": - case 4: - message.failureCause = 4; - break; - case "CUSTOM_ACTION_NOT_FOUND": - case 5: - message.failureCause = 5; - break; - case "DEPLOYMENT_STRATEGY_NOT_SUPPORTED": - case 6: - message.failureCause = 6; - break; - case "RENDER_FEATURE_NOT_SUPPORTED": - case 7: - message.failureCause = 7; - break; - } - if (object.failureMessage != null) - message.failureMessage = String(object.failureMessage); - return message; - }; + } + if (object.timeWindows != null) { + if (typeof object.timeWindows !== "object") + throw TypeError(".google.cloud.deploy.v1.RolloutRestriction.timeWindows: object expected"); + message.timeWindows = $root.google.cloud.deploy.v1.TimeWindows.fromObject(object.timeWindows); + } + return message; + }; - /** - * Creates a plain object from a TargetRender message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {google.cloud.deploy.v1.Release.TargetRender} message TargetRender - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TargetRender.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.renderingBuild = ""; - object.renderingState = options.enums === String ? "TARGET_RENDER_STATE_UNSPECIFIED" : 0; - object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; - object.failureMessage = ""; - object.metadata = null; - } - if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) - object.renderingBuild = message.renderingBuild; - if (message.renderingState != null && message.hasOwnProperty("renderingState")) - object.renderingState = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.TargetRenderState[message.renderingState] === undefined ? message.renderingState : $root.google.cloud.deploy.v1.Release.TargetRender.TargetRenderState[message.renderingState] : message.renderingState; - if (message.failureCause != null && message.hasOwnProperty("failureCause")) - object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.FailureCause[message.failureCause] === undefined ? message.failureCause : $root.google.cloud.deploy.v1.Release.TargetRender.FailureCause[message.failureCause] : message.failureCause; - if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) - object.failureMessage = message.failureMessage; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.deploy.v1.RenderMetadata.toObject(message.metadata, options); - return object; - }; + /** + * Creates a plain object from a RolloutRestriction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {google.cloud.deploy.v1.RolloutRestriction} message RolloutRestriction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutRestriction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.invokers = []; + object.actions = []; + } + if (options.defaults) { + object.id = ""; + object.timeWindows = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.invokers && message.invokers.length) { + object.invokers = []; + for (var j = 0; j < message.invokers.length; ++j) + object.invokers[j] = options.enums === String ? $root.google.cloud.deploy.v1.DeployPolicy.Invoker[message.invokers[j]] === undefined ? message.invokers[j] : $root.google.cloud.deploy.v1.DeployPolicy.Invoker[message.invokers[j]] : message.invokers[j]; + } + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = options.enums === String ? $root.google.cloud.deploy.v1.RolloutRestriction.RolloutActions[message.actions[j]] === undefined ? message.actions[j] : $root.google.cloud.deploy.v1.RolloutRestriction.RolloutActions[message.actions[j]] : message.actions[j]; + } + if (message.timeWindows != null && message.hasOwnProperty("timeWindows")) + object.timeWindows = $root.google.cloud.deploy.v1.TimeWindows.toObject(message.timeWindows, options); + return object; + }; - /** - * Converts this TargetRender to JSON. - * @function toJSON - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @instance - * @returns {Object.} JSON object - */ - TargetRender.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this RolloutRestriction to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @instance + * @returns {Object.} JSON object + */ + RolloutRestriction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for TargetRender - * @function getTypeUrl - * @memberof google.cloud.deploy.v1.Release.TargetRender - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TargetRender.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.deploy.v1.Release.TargetRender"; - }; + /** + * Gets the default type url for RolloutRestriction + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.RolloutRestriction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutRestriction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.RolloutRestriction"; + }; - /** - * TargetRenderState enum. - * @name google.cloud.deploy.v1.Release.TargetRender.TargetRenderState - * @enum {number} - * @property {number} TARGET_RENDER_STATE_UNSPECIFIED=0 TARGET_RENDER_STATE_UNSPECIFIED value - * @property {number} SUCCEEDED=1 SUCCEEDED value - * @property {number} FAILED=2 FAILED value - * @property {number} IN_PROGRESS=3 IN_PROGRESS value - */ - TargetRender.TargetRenderState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_RENDER_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SUCCEEDED"] = 1; - values[valuesById[2] = "FAILED"] = 2; - values[valuesById[3] = "IN_PROGRESS"] = 3; - return values; - })(); + /** + * RolloutActions enum. + * @name google.cloud.deploy.v1.RolloutRestriction.RolloutActions + * @enum {number} + * @property {number} ROLLOUT_ACTIONS_UNSPECIFIED=0 ROLLOUT_ACTIONS_UNSPECIFIED value + * @property {number} ADVANCE=1 ADVANCE value + * @property {number} APPROVE=2 APPROVE value + * @property {number} CANCEL=3 CANCEL value + * @property {number} CREATE=4 CREATE value + * @property {number} IGNORE_JOB=5 IGNORE_JOB value + * @property {number} RETRY_JOB=6 RETRY_JOB value + * @property {number} ROLLBACK=7 ROLLBACK value + * @property {number} TERMINATE_JOBRUN=8 TERMINATE_JOBRUN value + */ + RolloutRestriction.RolloutActions = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLLOUT_ACTIONS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADVANCE"] = 1; + values[valuesById[2] = "APPROVE"] = 2; + values[valuesById[3] = "CANCEL"] = 3; + values[valuesById[4] = "CREATE"] = 4; + values[valuesById[5] = "IGNORE_JOB"] = 5; + values[valuesById[6] = "RETRY_JOB"] = 6; + values[valuesById[7] = "ROLLBACK"] = 7; + values[valuesById[8] = "TERMINATE_JOBRUN"] = 8; + return values; + })(); - /** - * FailureCause enum. - * @name google.cloud.deploy.v1.Release.TargetRender.FailureCause - * @enum {number} - * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value - * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value - * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value - * @property {number} CLOUD_BUILD_REQUEST_FAILED=3 CLOUD_BUILD_REQUEST_FAILED value - * @property {number} VERIFICATION_CONFIG_NOT_FOUND=4 VERIFICATION_CONFIG_NOT_FOUND value - * @property {number} CUSTOM_ACTION_NOT_FOUND=5 CUSTOM_ACTION_NOT_FOUND value - * @property {number} DEPLOYMENT_STRATEGY_NOT_SUPPORTED=6 DEPLOYMENT_STRATEGY_NOT_SUPPORTED value - * @property {number} RENDER_FEATURE_NOT_SUPPORTED=7 RENDER_FEATURE_NOT_SUPPORTED value - */ - TargetRender.FailureCause = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; - values[valuesById[2] = "EXECUTION_FAILED"] = 2; - values[valuesById[3] = "CLOUD_BUILD_REQUEST_FAILED"] = 3; - values[valuesById[4] = "VERIFICATION_CONFIG_NOT_FOUND"] = 4; - values[valuesById[5] = "CUSTOM_ACTION_NOT_FOUND"] = 5; - values[valuesById[6] = "DEPLOYMENT_STRATEGY_NOT_SUPPORTED"] = 6; - values[valuesById[7] = "RENDER_FEATURE_NOT_SUPPORTED"] = 7; - return values; - })(); + return RolloutRestriction; + })(); - return TargetRender; - })(); + v1.TimeWindows = (function() { - Release.ReleaseReadyCondition = (function() { + /** + * Properties of a TimeWindows. + * @memberof google.cloud.deploy.v1 + * @interface ITimeWindows + * @property {string|null} [timeZone] TimeWindows timeZone + * @property {Array.|null} [oneTimeWindows] TimeWindows oneTimeWindows + * @property {Array.|null} [weeklyWindows] TimeWindows weeklyWindows + */ - /** - * Properties of a ReleaseReadyCondition. - * @memberof google.cloud.deploy.v1.Release - * @interface IReleaseReadyCondition - * @property {boolean|null} [status] ReleaseReadyCondition status - */ + /** + * Constructs a new TimeWindows. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TimeWindows. + * @implements ITimeWindows + * @constructor + * @param {google.cloud.deploy.v1.ITimeWindows=} [properties] Properties to set + */ + function TimeWindows(properties) { + this.oneTimeWindows = []; + this.weeklyWindows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ReleaseReadyCondition. - * @memberof google.cloud.deploy.v1.Release - * @classdesc Represents a ReleaseReadyCondition. - * @implements IReleaseReadyCondition - * @constructor - * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition=} [properties] Properties to set - */ - function ReleaseReadyCondition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * TimeWindows timeZone. + * @member {string} timeZone + * @memberof google.cloud.deploy.v1.TimeWindows + * @instance + */ + TimeWindows.prototype.timeZone = ""; - /** - * ReleaseReadyCondition status. - * @member {boolean} status - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @instance - */ - ReleaseReadyCondition.prototype.status = false; + /** + * TimeWindows oneTimeWindows. + * @member {Array.} oneTimeWindows + * @memberof google.cloud.deploy.v1.TimeWindows + * @instance + */ + TimeWindows.prototype.oneTimeWindows = $util.emptyArray; - /** - * Creates a new ReleaseReadyCondition instance using the specified properties. - * @function create - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition=} [properties] Properties to set - * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition instance - */ - ReleaseReadyCondition.create = function create(properties) { - return new ReleaseReadyCondition(properties); - }; + /** + * TimeWindows weeklyWindows. + * @member {Array.} weeklyWindows + * @memberof google.cloud.deploy.v1.TimeWindows + * @instance + */ + TimeWindows.prototype.weeklyWindows = $util.emptyArray; - /** - * Encodes the specified ReleaseReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition} message ReleaseReadyCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReleaseReadyCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.status); - return writer; - }; + /** + * Creates a new TimeWindows instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {google.cloud.deploy.v1.ITimeWindows=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TimeWindows} TimeWindows instance + */ + TimeWindows.create = function create(properties) { + return new TimeWindows(properties); + }; - /** - * Encodes the specified ReleaseReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition} message ReleaseReadyCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReleaseReadyCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified TimeWindows message. Does not implicitly {@link google.cloud.deploy.v1.TimeWindows.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {google.cloud.deploy.v1.ITimeWindows} message TimeWindows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindows.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + if (message.oneTimeWindows != null && message.oneTimeWindows.length) + for (var i = 0; i < message.oneTimeWindows.length; ++i) + $root.google.cloud.deploy.v1.OneTimeWindow.encode(message.oneTimeWindows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.weeklyWindows != null && message.weeklyWindows.length) + for (var i = 0; i < message.weeklyWindows.length; ++i) + $root.google.cloud.deploy.v1.WeeklyWindow.encode(message.weeklyWindows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Decodes a ReleaseReadyCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReleaseReadyCondition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.status = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified TimeWindows message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TimeWindows.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {google.cloud.deploy.v1.ITimeWindows} message TimeWindows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindows.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeWindows message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TimeWindows} TimeWindows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindows.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TimeWindows(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeZone = reader.string(); + break; + } + case 2: { + if (!(message.oneTimeWindows && message.oneTimeWindows.length)) + message.oneTimeWindows = []; + message.oneTimeWindows.push($root.google.cloud.deploy.v1.OneTimeWindow.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.weeklyWindows && message.weeklyWindows.length)) + message.weeklyWindows = []; + message.weeklyWindows.push($root.google.cloud.deploy.v1.WeeklyWindow.decode(reader, reader.uint32())); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a ReleaseReadyCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReleaseReadyCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a ReleaseReadyCondition message. - * @function verify - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReleaseReadyCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (typeof message.status !== "boolean") - return "status: boolean expected"; - return null; - }; + /** + * Decodes a TimeWindows message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TimeWindows} TimeWindows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindows.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a ReleaseReadyCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition - */ - ReleaseReadyCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition) - return object; - var message = new $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition(); - if (object.status != null) - message.status = Boolean(object.status); - return message; - }; + /** + * Verifies a TimeWindows message. + * @function verify + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeWindows.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.oneTimeWindows != null && message.hasOwnProperty("oneTimeWindows")) { + if (!Array.isArray(message.oneTimeWindows)) + return "oneTimeWindows: array expected"; + for (var i = 0; i < message.oneTimeWindows.length; ++i) { + var error = $root.google.cloud.deploy.v1.OneTimeWindow.verify(message.oneTimeWindows[i]); + if (error) + return "oneTimeWindows." + error; + } + } + if (message.weeklyWindows != null && message.hasOwnProperty("weeklyWindows")) { + if (!Array.isArray(message.weeklyWindows)) + return "weeklyWindows: array expected"; + for (var i = 0; i < message.weeklyWindows.length; ++i) { + var error = $root.google.cloud.deploy.v1.WeeklyWindow.verify(message.weeklyWindows[i]); + if (error) + return "weeklyWindows." + error; + } + } + return null; + }; - /** - * Creates a plain object from a ReleaseReadyCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {google.cloud.deploy.v1.Release.ReleaseReadyCondition} message ReleaseReadyCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReleaseReadyCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.status = false; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; + /** + * Creates a TimeWindows message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TimeWindows} TimeWindows + */ + TimeWindows.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TimeWindows) return object; - }; + var message = new $root.google.cloud.deploy.v1.TimeWindows(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.oneTimeWindows) { + if (!Array.isArray(object.oneTimeWindows)) + throw TypeError(".google.cloud.deploy.v1.TimeWindows.oneTimeWindows: array expected"); + message.oneTimeWindows = []; + for (var i = 0; i < object.oneTimeWindows.length; ++i) { + if (typeof object.oneTimeWindows[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.TimeWindows.oneTimeWindows: object expected"); + message.oneTimeWindows[i] = $root.google.cloud.deploy.v1.OneTimeWindow.fromObject(object.oneTimeWindows[i]); + } + } + if (object.weeklyWindows) { + if (!Array.isArray(object.weeklyWindows)) + throw TypeError(".google.cloud.deploy.v1.TimeWindows.weeklyWindows: array expected"); + message.weeklyWindows = []; + for (var i = 0; i < object.weeklyWindows.length; ++i) { + if (typeof object.weeklyWindows[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.TimeWindows.weeklyWindows: object expected"); + message.weeklyWindows[i] = $root.google.cloud.deploy.v1.WeeklyWindow.fromObject(object.weeklyWindows[i]); + } + } + return message; + }; - /** - * Converts this ReleaseReadyCondition to JSON. - * @function toJSON - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @instance - * @returns {Object.} JSON object - */ - ReleaseReadyCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a TimeWindows message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {google.cloud.deploy.v1.TimeWindows} message TimeWindows + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeWindows.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.oneTimeWindows = []; + object.weeklyWindows = []; + } + if (options.defaults) + object.timeZone = ""; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.oneTimeWindows && message.oneTimeWindows.length) { + object.oneTimeWindows = []; + for (var j = 0; j < message.oneTimeWindows.length; ++j) + object.oneTimeWindows[j] = $root.google.cloud.deploy.v1.OneTimeWindow.toObject(message.oneTimeWindows[j], options); + } + if (message.weeklyWindows && message.weeklyWindows.length) { + object.weeklyWindows = []; + for (var j = 0; j < message.weeklyWindows.length; ++j) + object.weeklyWindows[j] = $root.google.cloud.deploy.v1.WeeklyWindow.toObject(message.weeklyWindows[j], options); + } + return object; + }; - /** - * Gets the default type url for ReleaseReadyCondition - * @function getTypeUrl - * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReleaseReadyCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.deploy.v1.Release.ReleaseReadyCondition"; - }; + /** + * Converts this TimeWindows to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.TimeWindows + * @instance + * @returns {Object.} JSON object + */ + TimeWindows.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ReleaseReadyCondition; - })(); + /** + * Gets the default type url for TimeWindows + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.TimeWindows + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeWindows.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.TimeWindows"; + }; - Release.SkaffoldSupportedCondition = (function() { + return TimeWindows; + })(); - /** - * Properties of a SkaffoldSupportedCondition. - * @memberof google.cloud.deploy.v1.Release - * @interface ISkaffoldSupportedCondition - * @property {boolean|null} [status] SkaffoldSupportedCondition status - * @property {google.cloud.deploy.v1.SkaffoldSupportState|null} [skaffoldSupportState] SkaffoldSupportedCondition skaffoldSupportState - * @property {google.protobuf.ITimestamp|null} [maintenanceModeTime] SkaffoldSupportedCondition maintenanceModeTime - * @property {google.protobuf.ITimestamp|null} [supportExpirationTime] SkaffoldSupportedCondition supportExpirationTime - */ + v1.OneTimeWindow = (function() { - /** - * Constructs a new SkaffoldSupportedCondition. - * @memberof google.cloud.deploy.v1.Release - * @classdesc Represents a SkaffoldSupportedCondition. - * @implements ISkaffoldSupportedCondition - * @constructor - * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition=} [properties] Properties to set - */ - function SkaffoldSupportedCondition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an OneTimeWindow. + * @memberof google.cloud.deploy.v1 + * @interface IOneTimeWindow + * @property {google.type.IDate|null} [startDate] OneTimeWindow startDate + * @property {google.type.ITimeOfDay|null} [startTime] OneTimeWindow startTime + * @property {google.type.IDate|null} [endDate] OneTimeWindow endDate + * @property {google.type.ITimeOfDay|null} [endTime] OneTimeWindow endTime + */ - /** - * SkaffoldSupportedCondition status. - * @member {boolean} status - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @instance - */ - SkaffoldSupportedCondition.prototype.status = false; + /** + * Constructs a new OneTimeWindow. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an OneTimeWindow. + * @implements IOneTimeWindow + * @constructor + * @param {google.cloud.deploy.v1.IOneTimeWindow=} [properties] Properties to set + */ + function OneTimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * SkaffoldSupportedCondition skaffoldSupportState. - * @member {google.cloud.deploy.v1.SkaffoldSupportState} skaffoldSupportState - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @instance - */ - SkaffoldSupportedCondition.prototype.skaffoldSupportState = 0; + /** + * OneTimeWindow startDate. + * @member {google.type.IDate|null|undefined} startDate + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @instance + */ + OneTimeWindow.prototype.startDate = null; - /** - * SkaffoldSupportedCondition maintenanceModeTime. - * @member {google.protobuf.ITimestamp|null|undefined} maintenanceModeTime - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @instance - */ - SkaffoldSupportedCondition.prototype.maintenanceModeTime = null; + /** + * OneTimeWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @instance + */ + OneTimeWindow.prototype.startTime = null; - /** - * SkaffoldSupportedCondition supportExpirationTime. - * @member {google.protobuf.ITimestamp|null|undefined} supportExpirationTime - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @instance - */ - SkaffoldSupportedCondition.prototype.supportExpirationTime = null; + /** + * OneTimeWindow endDate. + * @member {google.type.IDate|null|undefined} endDate + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @instance + */ + OneTimeWindow.prototype.endDate = null; - /** - * Creates a new SkaffoldSupportedCondition instance using the specified properties. - * @function create - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition=} [properties] Properties to set - * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition instance - */ - SkaffoldSupportedCondition.create = function create(properties) { - return new SkaffoldSupportedCondition(properties); - }; + /** + * OneTimeWindow endTime. + * @member {google.type.ITimeOfDay|null|undefined} endTime + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @instance + */ + OneTimeWindow.prototype.endTime = null; - /** - * Encodes the specified SkaffoldSupportedCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition} message SkaffoldSupportedCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SkaffoldSupportedCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.status); - if (message.skaffoldSupportState != null && Object.hasOwnProperty.call(message, "skaffoldSupportState")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.skaffoldSupportState); - if (message.maintenanceModeTime != null && Object.hasOwnProperty.call(message, "maintenanceModeTime")) - $root.google.protobuf.Timestamp.encode(message.maintenanceModeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.supportExpirationTime != null && Object.hasOwnProperty.call(message, "supportExpirationTime")) - $root.google.protobuf.Timestamp.encode(message.supportExpirationTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Creates a new OneTimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {google.cloud.deploy.v1.IOneTimeWindow=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.OneTimeWindow} OneTimeWindow instance + */ + OneTimeWindow.create = function create(properties) { + return new OneTimeWindow(properties); + }; - /** - * Encodes the specified SkaffoldSupportedCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition} message SkaffoldSupportedCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SkaffoldSupportedCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified OneTimeWindow message. Does not implicitly {@link google.cloud.deploy.v1.OneTimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {google.cloud.deploy.v1.IOneTimeWindow} message OneTimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneTimeWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) + $root.google.type.Date.encode(message.startDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) + $root.google.type.Date.encode(message.endDate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.type.TimeOfDay.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SkaffoldSupportedCondition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.status = reader.bool(); - break; - } - case 2: { - message.skaffoldSupportState = reader.int32(); - break; - } - case 3: { - message.maintenanceModeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.supportExpirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified OneTimeWindow message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.OneTimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {google.cloud.deploy.v1.IOneTimeWindow} message OneTimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneTimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneTimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.OneTimeWindow} OneTimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneTimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.OneTimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); break; } + case 3: { + message.endDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SkaffoldSupportedCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an OneTimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.OneTimeWindow} OneTimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneTimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a SkaffoldSupportedCondition message. - * @function verify - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SkaffoldSupportedCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (typeof message.status !== "boolean") - return "status: boolean expected"; - if (message.skaffoldSupportState != null && message.hasOwnProperty("skaffoldSupportState")) - switch (message.skaffoldSupportState) { + /** + * Verifies an OneTimeWindow message. + * @function verify + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneTimeWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startDate != null && message.hasOwnProperty("startDate")) { + var error = $root.google.type.Date.verify(message.startDate); + if (error) + return "startDate." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.type.TimeOfDay.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endDate != null && message.hasOwnProperty("endDate")) { + var error = $root.google.type.Date.verify(message.endDate); + if (error) + return "endDate." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.type.TimeOfDay.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OneTimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.OneTimeWindow} OneTimeWindow + */ + OneTimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.OneTimeWindow) + return object; + var message = new $root.google.cloud.deploy.v1.OneTimeWindow(); + if (object.startDate != null) { + if (typeof object.startDate !== "object") + throw TypeError(".google.cloud.deploy.v1.OneTimeWindow.startDate: object expected"); + message.startDate = $root.google.type.Date.fromObject(object.startDate); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.deploy.v1.OneTimeWindow.startTime: object expected"); + message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); + } + if (object.endDate != null) { + if (typeof object.endDate !== "object") + throw TypeError(".google.cloud.deploy.v1.OneTimeWindow.endDate: object expected"); + message.endDate = $root.google.type.Date.fromObject(object.endDate); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.deploy.v1.OneTimeWindow.endTime: object expected"); + message.endTime = $root.google.type.TimeOfDay.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OneTimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {google.cloud.deploy.v1.OneTimeWindow} message OneTimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneTimeWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startDate = null; + object.startTime = null; + object.endDate = null; + object.endTime = null; + } + if (message.startDate != null && message.hasOwnProperty("startDate")) + object.startDate = $root.google.type.Date.toObject(message.startDate, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); + if (message.endDate != null && message.hasOwnProperty("endDate")) + object.endDate = $root.google.type.Date.toObject(message.endDate, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.type.TimeOfDay.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this OneTimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @instance + * @returns {Object.} JSON object + */ + OneTimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneTimeWindow + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.OneTimeWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneTimeWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.OneTimeWindow"; + }; + + return OneTimeWindow; + })(); + + v1.WeeklyWindow = (function() { + + /** + * Properties of a WeeklyWindow. + * @memberof google.cloud.deploy.v1 + * @interface IWeeklyWindow + * @property {Array.|null} [daysOfWeek] WeeklyWindow daysOfWeek + * @property {google.type.ITimeOfDay|null} [startTime] WeeklyWindow startTime + * @property {google.type.ITimeOfDay|null} [endTime] WeeklyWindow endTime + */ + + /** + * Constructs a new WeeklyWindow. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a WeeklyWindow. + * @implements IWeeklyWindow + * @constructor + * @param {google.cloud.deploy.v1.IWeeklyWindow=} [properties] Properties to set + */ + function WeeklyWindow(properties) { + this.daysOfWeek = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeeklyWindow daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @instance + */ + WeeklyWindow.prototype.daysOfWeek = $util.emptyArray; + + /** + * WeeklyWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @instance + */ + WeeklyWindow.prototype.startTime = null; + + /** + * WeeklyWindow endTime. + * @member {google.type.ITimeOfDay|null|undefined} endTime + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @instance + */ + WeeklyWindow.prototype.endTime = null; + + /** + * Creates a new WeeklyWindow instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {google.cloud.deploy.v1.IWeeklyWindow=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.WeeklyWindow} WeeklyWindow instance + */ + WeeklyWindow.create = function create(properties) { + return new WeeklyWindow(properties); + }; + + /** + * Encodes the specified WeeklyWindow message. Does not implicitly {@link google.cloud.deploy.v1.WeeklyWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {google.cloud.deploy.v1.IWeeklyWindow} message WeeklyWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklyWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.type.TimeOfDay.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WeeklyWindow message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.WeeklyWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {google.cloud.deploy.v1.IWeeklyWindow} message WeeklyWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklyWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeeklyWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.WeeklyWindow} WeeklyWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklyWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.WeeklyWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + case 2: { + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeeklyWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.WeeklyWindow} WeeklyWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklyWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeeklyWindow message. + * @function verify + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklyWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { default: - return "skaffoldSupportState: enum value expected"; + return "daysOfWeek: enum value[] expected"; case 0: case 1: case 2: case 3: + case 4: + case 5: + case 6: + case 7: break; } - if (message.maintenanceModeTime != null && message.hasOwnProperty("maintenanceModeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.maintenanceModeTime); - if (error) - return "maintenanceModeTime." + error; - } - if (message.supportExpirationTime != null && message.hasOwnProperty("supportExpirationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.supportExpirationTime); - if (error) - return "supportExpirationTime." + error; - } - return null; - }; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.type.TimeOfDay.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.type.TimeOfDay.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; - /** - * Creates a SkaffoldSupportedCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition - */ - SkaffoldSupportedCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition) - return object; - var message = new $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition(); - if (object.status != null) - message.status = Boolean(object.status); - switch (object.skaffoldSupportState) { - default: - if (typeof object.skaffoldSupportState === "number") { - message.skaffoldSupportState = object.skaffoldSupportState; + /** + * Creates a WeeklyWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.WeeklyWindow} WeeklyWindow + */ + WeeklyWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.WeeklyWindow) + return object; + var message = new $root.google.cloud.deploy.v1.WeeklyWindow(); + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.deploy.v1.WeeklyWindow.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; break; } - break; - case "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED": - case 0: - message.skaffoldSupportState = 0; - break; - case "SKAFFOLD_SUPPORT_STATE_SUPPORTED": - case 1: - message.skaffoldSupportState = 1; - break; - case "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE": - case 2: - message.skaffoldSupportState = 2; - break; - case "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED": - case 3: - message.skaffoldSupportState = 3; - break; - } - if (object.maintenanceModeTime != null) { - if (typeof object.maintenanceModeTime !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.maintenanceModeTime: object expected"); - message.maintenanceModeTime = $root.google.protobuf.Timestamp.fromObject(object.maintenanceModeTime); - } - if (object.supportExpirationTime != null) { - if (typeof object.supportExpirationTime !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.supportExpirationTime: object expected"); - message.supportExpirationTime = $root.google.protobuf.Timestamp.fromObject(object.supportExpirationTime); - } - return message; - }; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.deploy.v1.WeeklyWindow.startTime: object expected"); + message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.deploy.v1.WeeklyWindow.endTime: object expected"); + message.endTime = $root.google.type.TimeOfDay.fromObject(object.endTime); + } + return message; + }; - /** - * Creates a plain object from a SkaffoldSupportedCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} message SkaffoldSupportedCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SkaffoldSupportedCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.status = false; - object.skaffoldSupportState = options.enums === String ? "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" : 0; - object.maintenanceModeTime = null; - object.supportExpirationTime = null; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.skaffoldSupportState != null && message.hasOwnProperty("skaffoldSupportState")) - object.skaffoldSupportState = options.enums === String ? $root.google.cloud.deploy.v1.SkaffoldSupportState[message.skaffoldSupportState] === undefined ? message.skaffoldSupportState : $root.google.cloud.deploy.v1.SkaffoldSupportState[message.skaffoldSupportState] : message.skaffoldSupportState; - if (message.maintenanceModeTime != null && message.hasOwnProperty("maintenanceModeTime")) - object.maintenanceModeTime = $root.google.protobuf.Timestamp.toObject(message.maintenanceModeTime, options); - if (message.supportExpirationTime != null && message.hasOwnProperty("supportExpirationTime")) - object.supportExpirationTime = $root.google.protobuf.Timestamp.toObject(message.supportExpirationTime, options); - return object; - }; + /** + * Creates a plain object from a WeeklyWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {google.cloud.deploy.v1.WeeklyWindow} message WeeklyWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklyWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.daysOfWeek = []; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.type.TimeOfDay.toObject(message.endTime, options); + return object; + }; - /** - * Converts this SkaffoldSupportedCondition to JSON. - * @function toJSON - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @instance - * @returns {Object.} JSON object - */ - SkaffoldSupportedCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this WeeklyWindow to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @instance + * @returns {Object.} JSON object + */ + WeeklyWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for SkaffoldSupportedCondition - * @function getTypeUrl - * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SkaffoldSupportedCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Gets the default type url for WeeklyWindow + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.WeeklyWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklyWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.WeeklyWindow"; + }; + + return WeeklyWindow; + })(); + + v1.PolicyViolation = (function() { + + /** + * Properties of a PolicyViolation. + * @memberof google.cloud.deploy.v1 + * @interface IPolicyViolation + * @property {Array.|null} [policyViolationDetails] PolicyViolation policyViolationDetails + */ + + /** + * Constructs a new PolicyViolation. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PolicyViolation. + * @implements IPolicyViolation + * @constructor + * @param {google.cloud.deploy.v1.IPolicyViolation=} [properties] Properties to set + */ + function PolicyViolation(properties) { + this.policyViolationDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyViolation policyViolationDetails. + * @member {Array.} policyViolationDetails + * @memberof google.cloud.deploy.v1.PolicyViolation + * @instance + */ + PolicyViolation.prototype.policyViolationDetails = $util.emptyArray; + + /** + * Creates a new PolicyViolation instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {google.cloud.deploy.v1.IPolicyViolation=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PolicyViolation} PolicyViolation instance + */ + PolicyViolation.create = function create(properties) { + return new PolicyViolation(properties); + }; + + /** + * Encodes the specified PolicyViolation message. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolation.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {google.cloud.deploy.v1.IPolicyViolation} message PolicyViolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyViolation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyViolationDetails != null && message.policyViolationDetails.length) + for (var i = 0; i < message.policyViolationDetails.length; ++i) + $root.google.cloud.deploy.v1.PolicyViolationDetails.encode(message.policyViolationDetails[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyViolation message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {google.cloud.deploy.v1.IPolicyViolation} message PolicyViolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyViolation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyViolation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PolicyViolation} PolicyViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyViolation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PolicyViolation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.policyViolationDetails && message.policyViolationDetails.length)) + message.policyViolationDetails = []; + message.policyViolationDetails.push($root.google.cloud.deploy.v1.PolicyViolationDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyViolation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PolicyViolation} PolicyViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyViolation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyViolation message. + * @function verify + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyViolation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyViolationDetails != null && message.hasOwnProperty("policyViolationDetails")) { + if (!Array.isArray(message.policyViolationDetails)) + return "policyViolationDetails: array expected"; + for (var i = 0; i < message.policyViolationDetails.length; ++i) { + var error = $root.google.cloud.deploy.v1.PolicyViolationDetails.verify(message.policyViolationDetails[i]); + if (error) + return "policyViolationDetails." + error; + } + } + return null; + }; + + /** + * Creates a PolicyViolation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PolicyViolation} PolicyViolation + */ + PolicyViolation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PolicyViolation) + return object; + var message = new $root.google.cloud.deploy.v1.PolicyViolation(); + if (object.policyViolationDetails) { + if (!Array.isArray(object.policyViolationDetails)) + throw TypeError(".google.cloud.deploy.v1.PolicyViolation.policyViolationDetails: array expected"); + message.policyViolationDetails = []; + for (var i = 0; i < object.policyViolationDetails.length; ++i) { + if (typeof object.policyViolationDetails[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.PolicyViolation.policyViolationDetails: object expected"); + message.policyViolationDetails[i] = $root.google.cloud.deploy.v1.PolicyViolationDetails.fromObject(object.policyViolationDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyViolation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {google.cloud.deploy.v1.PolicyViolation} message PolicyViolation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyViolation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policyViolationDetails = []; + if (message.policyViolationDetails && message.policyViolationDetails.length) { + object.policyViolationDetails = []; + for (var j = 0; j < message.policyViolationDetails.length; ++j) + object.policyViolationDetails[j] = $root.google.cloud.deploy.v1.PolicyViolationDetails.toObject(message.policyViolationDetails[j], options); + } + return object; + }; + + /** + * Converts this PolicyViolation to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PolicyViolation + * @instance + * @returns {Object.} JSON object + */ + PolicyViolation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyViolation + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PolicyViolation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyViolation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PolicyViolation"; + }; + + return PolicyViolation; + })(); + + v1.PolicyViolationDetails = (function() { + + /** + * Properties of a PolicyViolationDetails. + * @memberof google.cloud.deploy.v1 + * @interface IPolicyViolationDetails + * @property {string|null} [policy] PolicyViolationDetails policy + * @property {string|null} [ruleId] PolicyViolationDetails ruleId + * @property {string|null} [failureMessage] PolicyViolationDetails failureMessage + */ + + /** + * Constructs a new PolicyViolationDetails. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PolicyViolationDetails. + * @implements IPolicyViolationDetails + * @constructor + * @param {google.cloud.deploy.v1.IPolicyViolationDetails=} [properties] Properties to set + */ + function PolicyViolationDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyViolationDetails policy. + * @member {string} policy + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @instance + */ + PolicyViolationDetails.prototype.policy = ""; + + /** + * PolicyViolationDetails ruleId. + * @member {string} ruleId + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @instance + */ + PolicyViolationDetails.prototype.ruleId = ""; + + /** + * PolicyViolationDetails failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @instance + */ + PolicyViolationDetails.prototype.failureMessage = ""; + + /** + * Creates a new PolicyViolationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {google.cloud.deploy.v1.IPolicyViolationDetails=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PolicyViolationDetails} PolicyViolationDetails instance + */ + PolicyViolationDetails.create = function create(properties) { + return new PolicyViolationDetails(properties); + }; + + /** + * Encodes the specified PolicyViolationDetails message. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {google.cloud.deploy.v1.IPolicyViolationDetails} message PolicyViolationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyViolationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policy); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.failureMessage); + return writer; + }; + + /** + * Encodes the specified PolicyViolationDetails message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PolicyViolationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {google.cloud.deploy.v1.IPolicyViolationDetails} message PolicyViolationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyViolationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyViolationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PolicyViolationDetails} PolicyViolationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyViolationDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PolicyViolationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policy = reader.string(); + break; + } + case 2: { + message.ruleId = reader.string(); + break; + } + case 3: { + message.failureMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyViolationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PolicyViolationDetails} PolicyViolationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyViolationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyViolationDetails message. + * @function verify + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyViolationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policy != null && message.hasOwnProperty("policy")) + if (!$util.isString(message.policy)) + return "policy: string expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + return null; + }; + + /** + * Creates a PolicyViolationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PolicyViolationDetails} PolicyViolationDetails + */ + PolicyViolationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PolicyViolationDetails) + return object; + var message = new $root.google.cloud.deploy.v1.PolicyViolationDetails(); + if (object.policy != null) + message.policy = String(object.policy); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + return message; + }; + + /** + * Creates a plain object from a PolicyViolationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {google.cloud.deploy.v1.PolicyViolationDetails} message PolicyViolationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyViolationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.policy = ""; + object.ruleId = ""; + object.failureMessage = ""; + } + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = message.policy; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + return object; + }; + + /** + * Converts this PolicyViolationDetails to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @instance + * @returns {Object.} JSON object + */ + PolicyViolationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyViolationDetails + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PolicyViolationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyViolationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PolicyViolationDetails"; + }; + + return PolicyViolationDetails; + })(); + + v1.Release = (function() { + + /** + * Properties of a Release. + * @memberof google.cloud.deploy.v1 + * @interface IRelease + * @property {string|null} [name] Release name + * @property {string|null} [uid] Release uid + * @property {string|null} [description] Release description + * @property {Object.|null} [annotations] Release annotations + * @property {Object.|null} [labels] Release labels + * @property {boolean|null} [abandoned] Release abandoned + * @property {google.protobuf.ITimestamp|null} [createTime] Release createTime + * @property {google.protobuf.ITimestamp|null} [renderStartTime] Release renderStartTime + * @property {google.protobuf.ITimestamp|null} [renderEndTime] Release renderEndTime + * @property {string|null} [skaffoldConfigUri] Release skaffoldConfigUri + * @property {string|null} [skaffoldConfigPath] Release skaffoldConfigPath + * @property {Array.|null} [buildArtifacts] Release buildArtifacts + * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipelineSnapshot] Release deliveryPipelineSnapshot + * @property {Array.|null} [targetSnapshots] Release targetSnapshots + * @property {Array.|null} [customTargetTypeSnapshots] Release customTargetTypeSnapshots + * @property {google.cloud.deploy.v1.Release.RenderState|null} [renderState] Release renderState + * @property {string|null} [etag] Release etag + * @property {string|null} [skaffoldVersion] Release skaffoldVersion + * @property {Object.|null} [targetArtifacts] Release targetArtifacts + * @property {Object.|null} [targetRenders] Release targetRenders + * @property {google.cloud.deploy.v1.Release.IReleaseCondition|null} [condition] Release condition + * @property {Object.|null} [deployParameters] Release deployParameters + */ + + /** + * Constructs a new Release. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Release. + * @implements IRelease + * @constructor + * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set + */ + function Release(properties) { + this.annotations = {}; + this.labels = {}; + this.buildArtifacts = []; + this.targetSnapshots = []; + this.customTargetTypeSnapshots = []; + this.targetArtifacts = {}; + this.targetRenders = {}; + this.deployParameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Release name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.name = ""; + + /** + * Release uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.uid = ""; + + /** + * Release description. + * @member {string} description + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.description = ""; + + /** + * Release annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.annotations = $util.emptyObject; + + /** + * Release labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.labels = $util.emptyObject; + + /** + * Release abandoned. + * @member {boolean} abandoned + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.abandoned = false; + + /** + * Release createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.createTime = null; + + /** + * Release renderStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} renderStartTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderStartTime = null; + + /** + * Release renderEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} renderEndTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderEndTime = null; + + /** + * Release skaffoldConfigUri. + * @member {string} skaffoldConfigUri + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldConfigUri = ""; + + /** + * Release skaffoldConfigPath. + * @member {string} skaffoldConfigPath + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldConfigPath = ""; + + /** + * Release buildArtifacts. + * @member {Array.} buildArtifacts + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.buildArtifacts = $util.emptyArray; + + /** + * Release deliveryPipelineSnapshot. + * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipelineSnapshot + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.deliveryPipelineSnapshot = null; + + /** + * Release targetSnapshots. + * @member {Array.} targetSnapshots + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetSnapshots = $util.emptyArray; + + /** + * Release customTargetTypeSnapshots. + * @member {Array.} customTargetTypeSnapshots + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.customTargetTypeSnapshots = $util.emptyArray; + + /** + * Release renderState. + * @member {google.cloud.deploy.v1.Release.RenderState} renderState + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderState = 0; + + /** + * Release etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.etag = ""; + + /** + * Release skaffoldVersion. + * @member {string} skaffoldVersion + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldVersion = ""; + + /** + * Release targetArtifacts. + * @member {Object.} targetArtifacts + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetArtifacts = $util.emptyObject; + + /** + * Release targetRenders. + * @member {Object.} targetRenders + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetRenders = $util.emptyObject; + + /** + * Release condition. + * @member {google.cloud.deploy.v1.Release.IReleaseCondition|null|undefined} condition + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.condition = null; + + /** + * Release deployParameters. + * @member {Object.} deployParameters + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.deployParameters = $util.emptyObject; + + /** + * Creates a new Release instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release} Release instance + */ + Release.create = function create(properties) { + return new Release(properties); + }; + + /** + * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Release.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.renderStartTime != null && Object.hasOwnProperty.call(message, "renderStartTime")) + $root.google.protobuf.Timestamp.encode(message.renderStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.renderEndTime != null && Object.hasOwnProperty.call(message, "renderEndTime")) + $root.google.protobuf.Timestamp.encode(message.renderEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.skaffoldConfigPath != null && Object.hasOwnProperty.call(message, "skaffoldConfigPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.skaffoldConfigPath); + if (message.buildArtifacts != null && message.buildArtifacts.length) + for (var i = 0; i < message.buildArtifacts.length; ++i) + $root.google.cloud.deploy.v1.BuildArtifact.encode(message.buildArtifacts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.deliveryPipelineSnapshot != null && Object.hasOwnProperty.call(message, "deliveryPipelineSnapshot")) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipelineSnapshot, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.targetSnapshots != null && message.targetSnapshots.length) + for (var i = 0; i < message.targetSnapshots.length; ++i) + $root.google.cloud.deploy.v1.Target.encode(message.targetSnapshots[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.renderState != null && Object.hasOwnProperty.call(message, "renderState")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.renderState); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.etag); + if (message.skaffoldConfigUri != null && Object.hasOwnProperty.call(message, "skaffoldConfigUri")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.skaffoldConfigUri); + if (message.skaffoldVersion != null && Object.hasOwnProperty.call(message, "skaffoldVersion")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.skaffoldVersion); + if (message.targetArtifacts != null && Object.hasOwnProperty.call(message, "targetArtifacts")) + for (var keys = Object.keys(message.targetArtifacts), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.deploy.v1.TargetArtifact.encode(message.targetArtifacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.targetRenders != null && Object.hasOwnProperty.call(message, "targetRenders")) + for (var keys = Object.keys(message.targetRenders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.deploy.v1.Release.TargetRender.encode(message.targetRenders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.abandoned != null && Object.hasOwnProperty.call(message, "abandoned")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.abandoned); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.cloud.deploy.v1.Release.ReleaseCondition.encode(message.condition, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.deployParameters != null && Object.hasOwnProperty.call(message, "deployParameters")) + for (var keys = Object.keys(message.deployParameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.deployParameters[keys[i]]).ldelim(); + if (message.customTargetTypeSnapshots != null && message.customTargetTypeSnapshots.length) + for (var i = 0; i < message.customTargetTypeSnapshots.length; ++i) + $root.google.cloud.deploy.v1.CustomTargetType.encode(message.customTargetTypeSnapshots[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Release.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Release message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release} Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Release.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 23: { + message.abandoned = reader.bool(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.renderStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.renderEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.skaffoldConfigUri = reader.string(); + break; + } + case 9: { + message.skaffoldConfigPath = reader.string(); + break; + } + case 10: { + if (!(message.buildArtifacts && message.buildArtifacts.length)) + message.buildArtifacts = []; + message.buildArtifacts.push($root.google.cloud.deploy.v1.BuildArtifact.decode(reader, reader.uint32())); + break; + } + case 11: { + message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.targetSnapshots && message.targetSnapshots.length)) + message.targetSnapshots = []; + message.targetSnapshots.push($root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32())); + break; + } + case 27: { + if (!(message.customTargetTypeSnapshots && message.customTargetTypeSnapshots.length)) + message.customTargetTypeSnapshots = []; + message.customTargetTypeSnapshots.push($root.google.cloud.deploy.v1.CustomTargetType.decode(reader, reader.uint32())); + break; + } + case 13: { + message.renderState = reader.int32(); + break; + } + case 16: { + message.etag = reader.string(); + break; + } + case 19: { + message.skaffoldVersion = reader.string(); + break; + } + case 20: { + if (message.targetArtifacts === $util.emptyObject) + message.targetArtifacts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.deploy.v1.TargetArtifact.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetArtifacts[key] = value; + break; + } + case 22: { + if (message.targetRenders === $util.emptyObject) + message.targetRenders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.deploy.v1.Release.TargetRender.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetRenders[key] = value; + break; + } + case 24: { + message.condition = $root.google.cloud.deploy.v1.Release.ReleaseCondition.decode(reader, reader.uint32()); + break; + } + case 25: { + if (message.deployParameters === $util.emptyObject) + message.deployParameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.deployParameters[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Release message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release} Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Release.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Release message. + * @function verify + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Release.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.abandoned != null && message.hasOwnProperty("abandoned")) + if (typeof message.abandoned !== "boolean") + return "abandoned: boolean expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.renderStartTime); + if (error) + return "renderStartTime." + error; + } + if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.renderEndTime); + if (error) + return "renderEndTime." + error; + } + if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) + if (!$util.isString(message.skaffoldConfigUri)) + return "skaffoldConfigUri: string expected"; + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + if (!$util.isString(message.skaffoldConfigPath)) + return "skaffoldConfigPath: string expected"; + if (message.buildArtifacts != null && message.hasOwnProperty("buildArtifacts")) { + if (!Array.isArray(message.buildArtifacts)) + return "buildArtifacts: array expected"; + for (var i = 0; i < message.buildArtifacts.length; ++i) { + var error = $root.google.cloud.deploy.v1.BuildArtifact.verify(message.buildArtifacts[i]); + if (error) + return "buildArtifacts." + error; + } + } + if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipelineSnapshot); + if (error) + return "deliveryPipelineSnapshot." + error; + } + if (message.targetSnapshots != null && message.hasOwnProperty("targetSnapshots")) { + if (!Array.isArray(message.targetSnapshots)) + return "targetSnapshots: array expected"; + for (var i = 0; i < message.targetSnapshots.length; ++i) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.targetSnapshots[i]); + if (error) + return "targetSnapshots." + error; + } + } + if (message.customTargetTypeSnapshots != null && message.hasOwnProperty("customTargetTypeSnapshots")) { + if (!Array.isArray(message.customTargetTypeSnapshots)) + return "customTargetTypeSnapshots: array expected"; + for (var i = 0; i < message.customTargetTypeSnapshots.length; ++i) { + var error = $root.google.cloud.deploy.v1.CustomTargetType.verify(message.customTargetTypeSnapshots[i]); + if (error) + return "customTargetTypeSnapshots." + error; + } + } + if (message.renderState != null && message.hasOwnProperty("renderState")) + switch (message.renderState) { + default: + return "renderState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) + if (!$util.isString(message.skaffoldVersion)) + return "skaffoldVersion: string expected"; + if (message.targetArtifacts != null && message.hasOwnProperty("targetArtifacts")) { + if (!$util.isObject(message.targetArtifacts)) + return "targetArtifacts: object expected"; + var key = Object.keys(message.targetArtifacts); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.deploy.v1.TargetArtifact.verify(message.targetArtifacts[key[i]]); + if (error) + return "targetArtifacts." + error; + } + } + if (message.targetRenders != null && message.hasOwnProperty("targetRenders")) { + if (!$util.isObject(message.targetRenders)) + return "targetRenders: object expected"; + var key = Object.keys(message.targetRenders); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.deploy.v1.Release.TargetRender.verify(message.targetRenders[key[i]]); + if (error) + return "targetRenders." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.cloud.deploy.v1.Release.ReleaseCondition.verify(message.condition); + if (error) + return "condition." + error; + } + if (message.deployParameters != null && message.hasOwnProperty("deployParameters")) { + if (!$util.isObject(message.deployParameters)) + return "deployParameters: object expected"; + var key = Object.keys(message.deployParameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.deployParameters[key[i]])) + return "deployParameters: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Release message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release} Release + */ + Release.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release) + return object; + var message = new $root.google.cloud.deploy.v1.Release(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.abandoned != null) + message.abandoned = Boolean(object.abandoned); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.renderStartTime != null) { + if (typeof object.renderStartTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.renderStartTime: object expected"); + message.renderStartTime = $root.google.protobuf.Timestamp.fromObject(object.renderStartTime); + } + if (object.renderEndTime != null) { + if (typeof object.renderEndTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.renderEndTime: object expected"); + message.renderEndTime = $root.google.protobuf.Timestamp.fromObject(object.renderEndTime); + } + if (object.skaffoldConfigUri != null) + message.skaffoldConfigUri = String(object.skaffoldConfigUri); + if (object.skaffoldConfigPath != null) + message.skaffoldConfigPath = String(object.skaffoldConfigPath); + if (object.buildArtifacts) { + if (!Array.isArray(object.buildArtifacts)) + throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: array expected"); + message.buildArtifacts = []; + for (var i = 0; i < object.buildArtifacts.length; ++i) { + if (typeof object.buildArtifacts[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: object expected"); + message.buildArtifacts[i] = $root.google.cloud.deploy.v1.BuildArtifact.fromObject(object.buildArtifacts[i]); + } + } + if (object.deliveryPipelineSnapshot != null) { + if (typeof object.deliveryPipelineSnapshot !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.deliveryPipelineSnapshot: object expected"); + message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipelineSnapshot); + } + if (object.targetSnapshots) { + if (!Array.isArray(object.targetSnapshots)) + throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: array expected"); + message.targetSnapshots = []; + for (var i = 0; i < object.targetSnapshots.length; ++i) { + if (typeof object.targetSnapshots[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: object expected"); + message.targetSnapshots[i] = $root.google.cloud.deploy.v1.Target.fromObject(object.targetSnapshots[i]); + } + } + if (object.customTargetTypeSnapshots) { + if (!Array.isArray(object.customTargetTypeSnapshots)) + throw TypeError(".google.cloud.deploy.v1.Release.customTargetTypeSnapshots: array expected"); + message.customTargetTypeSnapshots = []; + for (var i = 0; i < object.customTargetTypeSnapshots.length; ++i) { + if (typeof object.customTargetTypeSnapshots[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.customTargetTypeSnapshots: object expected"); + message.customTargetTypeSnapshots[i] = $root.google.cloud.deploy.v1.CustomTargetType.fromObject(object.customTargetTypeSnapshots[i]); + } + } + switch (object.renderState) { + default: + if (typeof object.renderState === "number") { + message.renderState = object.renderState; + break; + } + break; + case "RENDER_STATE_UNSPECIFIED": + case 0: + message.renderState = 0; + break; + case "SUCCEEDED": + case 1: + message.renderState = 1; + break; + case "FAILED": + case 2: + message.renderState = 2; + break; + case "IN_PROGRESS": + case 3: + message.renderState = 3; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.skaffoldVersion != null) + message.skaffoldVersion = String(object.skaffoldVersion); + if (object.targetArtifacts) { + if (typeof object.targetArtifacts !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); + message.targetArtifacts = {}; + for (var keys = Object.keys(object.targetArtifacts), i = 0; i < keys.length; ++i) { + if (typeof object.targetArtifacts[keys[i]] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); + message.targetArtifacts[keys[i]] = $root.google.cloud.deploy.v1.TargetArtifact.fromObject(object.targetArtifacts[keys[i]]); + } + } + if (object.targetRenders) { + if (typeof object.targetRenders !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); + message.targetRenders = {}; + for (var keys = Object.keys(object.targetRenders), i = 0; i < keys.length; ++i) { + if (typeof object.targetRenders[keys[i]] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); + message.targetRenders[keys[i]] = $root.google.cloud.deploy.v1.Release.TargetRender.fromObject(object.targetRenders[keys[i]]); + } + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.condition: object expected"); + message.condition = $root.google.cloud.deploy.v1.Release.ReleaseCondition.fromObject(object.condition); + } + if (object.deployParameters) { + if (typeof object.deployParameters !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.deployParameters: object expected"); + message.deployParameters = {}; + for (var keys = Object.keys(object.deployParameters), i = 0; i < keys.length; ++i) + message.deployParameters[keys[i]] = String(object.deployParameters[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Release message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.Release} message Release + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Release.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.buildArtifacts = []; + object.targetSnapshots = []; + object.customTargetTypeSnapshots = []; + } + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + object.targetArtifacts = {}; + object.targetRenders = {}; + object.deployParameters = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.renderStartTime = null; + object.renderEndTime = null; + object.skaffoldConfigPath = ""; + object.deliveryPipelineSnapshot = null; + object.renderState = options.enums === String ? "RENDER_STATE_UNSPECIFIED" : 0; + object.etag = ""; + object.skaffoldConfigUri = ""; + object.skaffoldVersion = ""; + object.abandoned = false; + object.condition = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) + object.renderStartTime = $root.google.protobuf.Timestamp.toObject(message.renderStartTime, options); + if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) + object.renderEndTime = $root.google.protobuf.Timestamp.toObject(message.renderEndTime, options); + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + object.skaffoldConfigPath = message.skaffoldConfigPath; + if (message.buildArtifacts && message.buildArtifacts.length) { + object.buildArtifacts = []; + for (var j = 0; j < message.buildArtifacts.length; ++j) + object.buildArtifacts[j] = $root.google.cloud.deploy.v1.BuildArtifact.toObject(message.buildArtifacts[j], options); + } + if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) + object.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipelineSnapshot, options); + if (message.targetSnapshots && message.targetSnapshots.length) { + object.targetSnapshots = []; + for (var j = 0; j < message.targetSnapshots.length; ++j) + object.targetSnapshots[j] = $root.google.cloud.deploy.v1.Target.toObject(message.targetSnapshots[j], options); + } + if (message.renderState != null && message.hasOwnProperty("renderState")) + object.renderState = options.enums === String ? $root.google.cloud.deploy.v1.Release.RenderState[message.renderState] === undefined ? message.renderState : $root.google.cloud.deploy.v1.Release.RenderState[message.renderState] : message.renderState; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) + object.skaffoldConfigUri = message.skaffoldConfigUri; + if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) + object.skaffoldVersion = message.skaffoldVersion; + if (message.targetArtifacts && (keys2 = Object.keys(message.targetArtifacts)).length) { + object.targetArtifacts = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetArtifacts[keys2[j]] = $root.google.cloud.deploy.v1.TargetArtifact.toObject(message.targetArtifacts[keys2[j]], options); + } + if (message.targetRenders && (keys2 = Object.keys(message.targetRenders)).length) { + object.targetRenders = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetRenders[keys2[j]] = $root.google.cloud.deploy.v1.Release.TargetRender.toObject(message.targetRenders[keys2[j]], options); + } + if (message.abandoned != null && message.hasOwnProperty("abandoned")) + object.abandoned = message.abandoned; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.cloud.deploy.v1.Release.ReleaseCondition.toObject(message.condition, options); + if (message.deployParameters && (keys2 = Object.keys(message.deployParameters)).length) { + object.deployParameters = {}; + for (var j = 0; j < keys2.length; ++j) + object.deployParameters[keys2[j]] = message.deployParameters[keys2[j]]; + } + if (message.customTargetTypeSnapshots && message.customTargetTypeSnapshots.length) { + object.customTargetTypeSnapshots = []; + for (var j = 0; j < message.customTargetTypeSnapshots.length; ++j) + object.customTargetTypeSnapshots[j] = $root.google.cloud.deploy.v1.CustomTargetType.toObject(message.customTargetTypeSnapshots[j], options); + } + return object; + }; + + /** + * Converts this Release to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release + * @instance + * @returns {Object.} JSON object + */ + Release.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Release + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Release.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release"; + }; + + /** + * RenderState enum. + * @name google.cloud.deploy.v1.Release.RenderState + * @enum {number} + * @property {number} RENDER_STATE_UNSPECIFIED=0 RENDER_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + */ + Release.RenderState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RENDER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + return values; + })(); + + Release.TargetRender = (function() { + + /** + * Properties of a TargetRender. + * @memberof google.cloud.deploy.v1.Release + * @interface ITargetRender + * @property {string|null} [renderingBuild] TargetRender renderingBuild + * @property {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null} [renderingState] TargetRender renderingState + * @property {google.cloud.deploy.v1.IRenderMetadata|null} [metadata] TargetRender metadata + * @property {google.cloud.deploy.v1.Release.TargetRender.FailureCause|null} [failureCause] TargetRender failureCause + * @property {string|null} [failureMessage] TargetRender failureMessage + */ + + /** + * Constructs a new TargetRender. + * @memberof google.cloud.deploy.v1.Release + * @classdesc Represents a TargetRender. + * @implements ITargetRender + * @constructor + * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set + */ + function TargetRender(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetRender renderingBuild. + * @member {string} renderingBuild + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.renderingBuild = ""; + + /** + * TargetRender renderingState. + * @member {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState} renderingState + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.renderingState = 0; + + /** + * TargetRender metadata. + * @member {google.cloud.deploy.v1.IRenderMetadata|null|undefined} metadata + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.metadata = null; + + /** + * TargetRender failureCause. + * @member {google.cloud.deploy.v1.Release.TargetRender.FailureCause} failureCause + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.failureCause = 0; + + /** + * TargetRender failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.failureMessage = ""; + + /** + * Creates a new TargetRender instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender instance + */ + TargetRender.create = function create(properties) { + return new TargetRender(properties); + }; + + /** + * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetRender.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderingBuild != null && Object.hasOwnProperty.call(message, "renderingBuild")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderingBuild); + if (message.renderingState != null && Object.hasOwnProperty.call(message, "renderingState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.renderingState); + if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCause); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.failureMessage); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.deploy.v1.RenderMetadata.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetRender.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetRender message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetRender.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.TargetRender(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.renderingBuild = reader.string(); + break; + } + case 2: { + message.renderingState = reader.int32(); + break; + } + case 6: { + message.metadata = $root.google.cloud.deploy.v1.RenderMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.failureCause = reader.int32(); + break; + } + case 5: { + message.failureMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetRender message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetRender.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetRender message. + * @function verify + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetRender.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) + if (!$util.isString(message.renderingBuild)) + return "renderingBuild: string expected"; + if (message.renderingState != null && message.hasOwnProperty("renderingState")) + switch (message.renderingState) { + default: + return "renderingState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.deploy.v1.RenderMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + switch (message.failureCause) { + default: + return "failureCause: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + return null; + }; + + /** + * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + */ + TargetRender.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release.TargetRender) + return object; + var message = new $root.google.cloud.deploy.v1.Release.TargetRender(); + if (object.renderingBuild != null) + message.renderingBuild = String(object.renderingBuild); + switch (object.renderingState) { + default: + if (typeof object.renderingState === "number") { + message.renderingState = object.renderingState; + break; + } + break; + case "TARGET_RENDER_STATE_UNSPECIFIED": + case 0: + message.renderingState = 0; + break; + case "SUCCEEDED": + case 1: + message.renderingState = 1; + break; + case "FAILED": + case 2: + message.renderingState = 2; + break; + case "IN_PROGRESS": + case 3: + message.renderingState = 3; + break; + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.TargetRender.metadata: object expected"); + message.metadata = $root.google.cloud.deploy.v1.RenderMetadata.fromObject(object.metadata); + } + switch (object.failureCause) { + default: + if (typeof object.failureCause === "number") { + message.failureCause = object.failureCause; + break; + } + break; + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.failureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.failureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.failureCause = 2; + break; + case "CLOUD_BUILD_REQUEST_FAILED": + case 3: + message.failureCause = 3; + break; + case "VERIFICATION_CONFIG_NOT_FOUND": + case 4: + message.failureCause = 4; + break; + case "CUSTOM_ACTION_NOT_FOUND": + case 5: + message.failureCause = 5; + break; + case "DEPLOYMENT_STRATEGY_NOT_SUPPORTED": + case 6: + message.failureCause = 6; + break; + case "RENDER_FEATURE_NOT_SUPPORTED": + case 7: + message.failureCause = 7; + break; + } + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + return message; + }; + + /** + * Creates a plain object from a TargetRender message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.TargetRender} message TargetRender + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetRender.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderingBuild = ""; + object.renderingState = options.enums === String ? "TARGET_RENDER_STATE_UNSPECIFIED" : 0; + object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.failureMessage = ""; + object.metadata = null; + } + if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) + object.renderingBuild = message.renderingBuild; + if (message.renderingState != null && message.hasOwnProperty("renderingState")) + object.renderingState = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.TargetRenderState[message.renderingState] === undefined ? message.renderingState : $root.google.cloud.deploy.v1.Release.TargetRender.TargetRenderState[message.renderingState] : message.renderingState; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.FailureCause[message.failureCause] === undefined ? message.failureCause : $root.google.cloud.deploy.v1.Release.TargetRender.FailureCause[message.failureCause] : message.failureCause; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.deploy.v1.RenderMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this TargetRender to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + * @returns {Object.} JSON object + */ + TargetRender.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetRender + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetRender.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release.TargetRender"; + }; + + /** + * TargetRenderState enum. + * @name google.cloud.deploy.v1.Release.TargetRender.TargetRenderState + * @enum {number} + * @property {number} TARGET_RENDER_STATE_UNSPECIFIED=0 TARGET_RENDER_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + */ + TargetRender.TargetRenderState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_RENDER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + return values; + })(); + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.Release.TargetRender.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} CLOUD_BUILD_REQUEST_FAILED=3 CLOUD_BUILD_REQUEST_FAILED value + * @property {number} VERIFICATION_CONFIG_NOT_FOUND=4 VERIFICATION_CONFIG_NOT_FOUND value + * @property {number} CUSTOM_ACTION_NOT_FOUND=5 CUSTOM_ACTION_NOT_FOUND value + * @property {number} DEPLOYMENT_STRATEGY_NOT_SUPPORTED=6 DEPLOYMENT_STRATEGY_NOT_SUPPORTED value + * @property {number} RENDER_FEATURE_NOT_SUPPORTED=7 RENDER_FEATURE_NOT_SUPPORTED value + */ + TargetRender.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "CLOUD_BUILD_REQUEST_FAILED"] = 3; + values[valuesById[4] = "VERIFICATION_CONFIG_NOT_FOUND"] = 4; + values[valuesById[5] = "CUSTOM_ACTION_NOT_FOUND"] = 5; + values[valuesById[6] = "DEPLOYMENT_STRATEGY_NOT_SUPPORTED"] = 6; + values[valuesById[7] = "RENDER_FEATURE_NOT_SUPPORTED"] = 7; + return values; + })(); + + return TargetRender; + })(); + + Release.ReleaseReadyCondition = (function() { + + /** + * Properties of a ReleaseReadyCondition. + * @memberof google.cloud.deploy.v1.Release + * @interface IReleaseReadyCondition + * @property {boolean|null} [status] ReleaseReadyCondition status + */ + + /** + * Constructs a new ReleaseReadyCondition. + * @memberof google.cloud.deploy.v1.Release + * @classdesc Represents a ReleaseReadyCondition. + * @implements IReleaseReadyCondition + * @constructor + * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition=} [properties] Properties to set + */ + function ReleaseReadyCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReleaseReadyCondition status. + * @member {boolean} status + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @instance + */ + ReleaseReadyCondition.prototype.status = false; + + /** + * Creates a new ReleaseReadyCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition instance + */ + ReleaseReadyCondition.create = function create(properties) { + return new ReleaseReadyCondition(properties); + }; + + /** + * Encodes the specified ReleaseReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition} message ReleaseReadyCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseReadyCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.status); + return writer; + }; + + /** + * Encodes the specified ReleaseReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {google.cloud.deploy.v1.Release.IReleaseReadyCondition} message ReleaseReadyCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseReadyCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseReadyCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseReadyCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.status = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseReadyCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseReadyCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseReadyCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseReadyCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (typeof message.status !== "boolean") + return "status: boolean expected"; + return null; + }; + + /** + * Creates a ReleaseReadyCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release.ReleaseReadyCondition} ReleaseReadyCondition + */ + ReleaseReadyCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition) + return object; + var message = new $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition(); + if (object.status != null) + message.status = Boolean(object.status); + return message; + }; + + /** + * Creates a plain object from a ReleaseReadyCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {google.cloud.deploy.v1.Release.ReleaseReadyCondition} message ReleaseReadyCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseReadyCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.status = false; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + return object; + }; + + /** + * Converts this ReleaseReadyCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @instance + * @returns {Object.} JSON object + */ + ReleaseReadyCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseReadyCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release.ReleaseReadyCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseReadyCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release.ReleaseReadyCondition"; + }; + + return ReleaseReadyCondition; + })(); + + Release.SkaffoldSupportedCondition = (function() { + + /** + * Properties of a SkaffoldSupportedCondition. + * @memberof google.cloud.deploy.v1.Release + * @interface ISkaffoldSupportedCondition + * @property {boolean|null} [status] SkaffoldSupportedCondition status + * @property {google.cloud.deploy.v1.SkaffoldSupportState|null} [skaffoldSupportState] SkaffoldSupportedCondition skaffoldSupportState + * @property {google.protobuf.ITimestamp|null} [maintenanceModeTime] SkaffoldSupportedCondition maintenanceModeTime + * @property {google.protobuf.ITimestamp|null} [supportExpirationTime] SkaffoldSupportedCondition supportExpirationTime + */ + + /** + * Constructs a new SkaffoldSupportedCondition. + * @memberof google.cloud.deploy.v1.Release + * @classdesc Represents a SkaffoldSupportedCondition. + * @implements ISkaffoldSupportedCondition + * @constructor + * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition=} [properties] Properties to set + */ + function SkaffoldSupportedCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkaffoldSupportedCondition status. + * @member {boolean} status + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @instance + */ + SkaffoldSupportedCondition.prototype.status = false; + + /** + * SkaffoldSupportedCondition skaffoldSupportState. + * @member {google.cloud.deploy.v1.SkaffoldSupportState} skaffoldSupportState + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @instance + */ + SkaffoldSupportedCondition.prototype.skaffoldSupportState = 0; + + /** + * SkaffoldSupportedCondition maintenanceModeTime. + * @member {google.protobuf.ITimestamp|null|undefined} maintenanceModeTime + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @instance + */ + SkaffoldSupportedCondition.prototype.maintenanceModeTime = null; + + /** + * SkaffoldSupportedCondition supportExpirationTime. + * @member {google.protobuf.ITimestamp|null|undefined} supportExpirationTime + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @instance + */ + SkaffoldSupportedCondition.prototype.supportExpirationTime = null; + + /** + * Creates a new SkaffoldSupportedCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition instance + */ + SkaffoldSupportedCondition.create = function create(properties) { + return new SkaffoldSupportedCondition(properties); + }; + + /** + * Encodes the specified SkaffoldSupportedCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition} message SkaffoldSupportedCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkaffoldSupportedCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.status); + if (message.skaffoldSupportState != null && Object.hasOwnProperty.call(message, "skaffoldSupportState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.skaffoldSupportState); + if (message.maintenanceModeTime != null && Object.hasOwnProperty.call(message, "maintenanceModeTime")) + $root.google.protobuf.Timestamp.encode(message.maintenanceModeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.supportExpirationTime != null && Object.hasOwnProperty.call(message, "supportExpirationTime")) + $root.google.protobuf.Timestamp.encode(message.supportExpirationTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SkaffoldSupportedCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition} message SkaffoldSupportedCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkaffoldSupportedCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkaffoldSupportedCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.status = reader.bool(); + break; + } + case 2: { + message.skaffoldSupportState = reader.int32(); + break; + } + case 3: { + message.maintenanceModeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.supportExpirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkaffoldSupportedCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkaffoldSupportedCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkaffoldSupportedCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkaffoldSupportedCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (typeof message.status !== "boolean") + return "status: boolean expected"; + if (message.skaffoldSupportState != null && message.hasOwnProperty("skaffoldSupportState")) + switch (message.skaffoldSupportState) { + default: + return "skaffoldSupportState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.maintenanceModeTime != null && message.hasOwnProperty("maintenanceModeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.maintenanceModeTime); + if (error) + return "maintenanceModeTime." + error; + } + if (message.supportExpirationTime != null && message.hasOwnProperty("supportExpirationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.supportExpirationTime); + if (error) + return "supportExpirationTime." + error; + } + return null; + }; + + /** + * Creates a SkaffoldSupportedCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} SkaffoldSupportedCondition + */ + SkaffoldSupportedCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition) + return object; + var message = new $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition(); + if (object.status != null) + message.status = Boolean(object.status); + switch (object.skaffoldSupportState) { + default: + if (typeof object.skaffoldSupportState === "number") { + message.skaffoldSupportState = object.skaffoldSupportState; + break; + } + break; + case "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED": + case 0: + message.skaffoldSupportState = 0; + break; + case "SKAFFOLD_SUPPORT_STATE_SUPPORTED": + case 1: + message.skaffoldSupportState = 1; + break; + case "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE": + case 2: + message.skaffoldSupportState = 2; + break; + case "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED": + case 3: + message.skaffoldSupportState = 3; + break; + } + if (object.maintenanceModeTime != null) { + if (typeof object.maintenanceModeTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.maintenanceModeTime: object expected"); + message.maintenanceModeTime = $root.google.protobuf.Timestamp.fromObject(object.maintenanceModeTime); + } + if (object.supportExpirationTime != null) { + if (typeof object.supportExpirationTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.supportExpirationTime: object expected"); + message.supportExpirationTime = $root.google.protobuf.Timestamp.fromObject(object.supportExpirationTime); + } + return message; + }; + + /** + * Creates a plain object from a SkaffoldSupportedCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {google.cloud.deploy.v1.Release.SkaffoldSupportedCondition} message SkaffoldSupportedCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkaffoldSupportedCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = false; + object.skaffoldSupportState = options.enums === String ? "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" : 0; + object.maintenanceModeTime = null; + object.supportExpirationTime = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.skaffoldSupportState != null && message.hasOwnProperty("skaffoldSupportState")) + object.skaffoldSupportState = options.enums === String ? $root.google.cloud.deploy.v1.SkaffoldSupportState[message.skaffoldSupportState] === undefined ? message.skaffoldSupportState : $root.google.cloud.deploy.v1.SkaffoldSupportState[message.skaffoldSupportState] : message.skaffoldSupportState; + if (message.maintenanceModeTime != null && message.hasOwnProperty("maintenanceModeTime")) + object.maintenanceModeTime = $root.google.protobuf.Timestamp.toObject(message.maintenanceModeTime, options); + if (message.supportExpirationTime != null && message.hasOwnProperty("supportExpirationTime")) + object.supportExpirationTime = $root.google.protobuf.Timestamp.toObject(message.supportExpirationTime, options); + return object; + }; + + /** + * Converts this SkaffoldSupportedCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @instance + * @returns {Object.} JSON object + */ + SkaffoldSupportedCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkaffoldSupportedCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release.SkaffoldSupportedCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkaffoldSupportedCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"; + }; + + return SkaffoldSupportedCondition; + })(); + + Release.ReleaseCondition = (function() { + + /** + * Properties of a ReleaseCondition. + * @memberof google.cloud.deploy.v1.Release + * @interface IReleaseCondition + * @property {google.cloud.deploy.v1.Release.IReleaseReadyCondition|null} [releaseReadyCondition] ReleaseCondition releaseReadyCondition + * @property {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null} [skaffoldSupportedCondition] ReleaseCondition skaffoldSupportedCondition + */ + + /** + * Constructs a new ReleaseCondition. + * @memberof google.cloud.deploy.v1.Release + * @classdesc Represents a ReleaseCondition. + * @implements IReleaseCondition + * @constructor + * @param {google.cloud.deploy.v1.Release.IReleaseCondition=} [properties] Properties to set + */ + function ReleaseCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReleaseCondition releaseReadyCondition. + * @member {google.cloud.deploy.v1.Release.IReleaseReadyCondition|null|undefined} releaseReadyCondition + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @instance + */ + ReleaseCondition.prototype.releaseReadyCondition = null; + + /** + * ReleaseCondition skaffoldSupportedCondition. + * @member {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null|undefined} skaffoldSupportedCondition + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @instance + */ + ReleaseCondition.prototype.skaffoldSupportedCondition = null; + + /** + * Creates a new ReleaseCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {google.cloud.deploy.v1.Release.IReleaseCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition instance + */ + ReleaseCondition.create = function create(properties) { + return new ReleaseCondition(properties); + }; + + /** + * Encodes the specified ReleaseCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {google.cloud.deploy.v1.Release.IReleaseCondition} message ReleaseCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.releaseReadyCondition != null && Object.hasOwnProperty.call(message, "releaseReadyCondition")) + $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.encode(message.releaseReadyCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skaffoldSupportedCondition != null && Object.hasOwnProperty.call(message, "skaffoldSupportedCondition")) + $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.encode(message.skaffoldSupportedCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReleaseCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {google.cloud.deploy.v1.Release.IReleaseCondition} message ReleaseCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.ReleaseCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.releaseReadyCondition = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.skaffoldSupportedCondition = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.releaseReadyCondition != null && message.hasOwnProperty("releaseReadyCondition")) { + var error = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify(message.releaseReadyCondition); + if (error) + return "releaseReadyCondition." + error; + } + if (message.skaffoldSupportedCondition != null && message.hasOwnProperty("skaffoldSupportedCondition")) { + var error = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify(message.skaffoldSupportedCondition); + if (error) + return "skaffoldSupportedCondition." + error; + } + return null; + }; + + /** + * Creates a ReleaseCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition + */ + ReleaseCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release.ReleaseCondition) + return object; + var message = new $root.google.cloud.deploy.v1.Release.ReleaseCondition(); + if (object.releaseReadyCondition != null) { + if (typeof object.releaseReadyCondition !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.ReleaseCondition.releaseReadyCondition: object expected"); + message.releaseReadyCondition = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.fromObject(object.releaseReadyCondition); + } + if (object.skaffoldSupportedCondition != null) { + if (typeof object.skaffoldSupportedCondition !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.ReleaseCondition.skaffoldSupportedCondition: object expected"); + message.skaffoldSupportedCondition = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.fromObject(object.skaffoldSupportedCondition); + } + return message; + }; + + /** + * Creates a plain object from a ReleaseCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {google.cloud.deploy.v1.Release.ReleaseCondition} message ReleaseCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.releaseReadyCondition = null; + object.skaffoldSupportedCondition = null; + } + if (message.releaseReadyCondition != null && message.hasOwnProperty("releaseReadyCondition")) + object.releaseReadyCondition = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.toObject(message.releaseReadyCondition, options); + if (message.skaffoldSupportedCondition != null && message.hasOwnProperty("skaffoldSupportedCondition")) + object.skaffoldSupportedCondition = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.toObject(message.skaffoldSupportedCondition, options); + return object; + }; + + /** + * Converts this ReleaseCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @instance + * @returns {Object.} JSON object + */ + ReleaseCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release.ReleaseCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release.ReleaseCondition"; + }; + + return ReleaseCondition; + })(); + + return Release; + })(); + + v1.CreateDeployPolicyRequest = (function() { + + /** + * Properties of a CreateDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateDeployPolicyRequest + * @property {string|null} [parent] CreateDeployPolicyRequest parent + * @property {string|null} [deployPolicyId] CreateDeployPolicyRequest deployPolicyId + * @property {google.cloud.deploy.v1.IDeployPolicy|null} [deployPolicy] CreateDeployPolicyRequest deployPolicy + * @property {string|null} [requestId] CreateDeployPolicyRequest requestId + * @property {boolean|null} [validateOnly] CreateDeployPolicyRequest validateOnly + */ + + /** + * Constructs a new CreateDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateDeployPolicyRequest. + * @implements ICreateDeployPolicyRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateDeployPolicyRequest=} [properties] Properties to set + */ + function CreateDeployPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDeployPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @instance + */ + CreateDeployPolicyRequest.prototype.parent = ""; + + /** + * CreateDeployPolicyRequest deployPolicyId. + * @member {string} deployPolicyId + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @instance + */ + CreateDeployPolicyRequest.prototype.deployPolicyId = ""; + + /** + * CreateDeployPolicyRequest deployPolicy. + * @member {google.cloud.deploy.v1.IDeployPolicy|null|undefined} deployPolicy + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @instance + */ + CreateDeployPolicyRequest.prototype.deployPolicy = null; + + /** + * CreateDeployPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @instance + */ + CreateDeployPolicyRequest.prototype.requestId = ""; + + /** + * CreateDeployPolicyRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @instance + */ + CreateDeployPolicyRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateDeployPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeployPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateDeployPolicyRequest} CreateDeployPolicyRequest instance + */ + CreateDeployPolicyRequest.create = function create(properties) { + return new CreateDeployPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateDeployPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeployPolicyRequest} message CreateDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeployPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.deployPolicyId != null && Object.hasOwnProperty.call(message, "deployPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployPolicyId); + if (message.deployPolicy != null && Object.hasOwnProperty.call(message, "deployPolicy")) + $root.google.cloud.deploy.v1.DeployPolicy.encode(message.deployPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateDeployPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeployPolicyRequest} message CreateDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeployPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeployPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateDeployPolicyRequest} CreateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeployPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateDeployPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.deployPolicyId = reader.string(); + break; + } + case 3: { + message.deployPolicy = $root.google.cloud.deploy.v1.DeployPolicy.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateDeployPolicyRequest} CreateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeployPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeployPolicyRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeployPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.deployPolicyId != null && message.hasOwnProperty("deployPolicyId")) + if (!$util.isString(message.deployPolicyId)) + return "deployPolicyId: string expected"; + if (message.deployPolicy != null && message.hasOwnProperty("deployPolicy")) { + var error = $root.google.cloud.deploy.v1.DeployPolicy.verify(message.deployPolicy); + if (error) + return "deployPolicy." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateDeployPolicyRequest} CreateDeployPolicyRequest + */ + CreateDeployPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateDeployPolicyRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateDeployPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deployPolicyId != null) + message.deployPolicyId = String(object.deployPolicyId); + if (object.deployPolicy != null) { + if (typeof object.deployPolicy !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateDeployPolicyRequest.deployPolicy: object expected"); + message.deployPolicy = $root.google.cloud.deploy.v1.DeployPolicy.fromObject(object.deployPolicy); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateDeployPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.CreateDeployPolicyRequest} message CreateDeployPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeployPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deployPolicyId = ""; + object.deployPolicy = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deployPolicyId != null && message.hasOwnProperty("deployPolicyId")) + object.deployPolicyId = message.deployPolicyId; + if (message.deployPolicy != null && message.hasOwnProperty("deployPolicy")) + object.deployPolicy = $root.google.cloud.deploy.v1.DeployPolicy.toObject(message.deployPolicy, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateDeployPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeployPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeployPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateDeployPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeployPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateDeployPolicyRequest"; + }; + + return CreateDeployPolicyRequest; + })(); + + v1.UpdateDeployPolicyRequest = (function() { + + /** + * Properties of an UpdateDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @interface IUpdateDeployPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeployPolicyRequest updateMask + * @property {google.cloud.deploy.v1.IDeployPolicy|null} [deployPolicy] UpdateDeployPolicyRequest deployPolicy + * @property {string|null} [requestId] UpdateDeployPolicyRequest requestId + * @property {boolean|null} [allowMissing] UpdateDeployPolicyRequest allowMissing + * @property {boolean|null} [validateOnly] UpdateDeployPolicyRequest validateOnly + */ + + /** + * Constructs a new UpdateDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an UpdateDeployPolicyRequest. + * @implements IUpdateDeployPolicyRequest + * @constructor + * @param {google.cloud.deploy.v1.IUpdateDeployPolicyRequest=} [properties] Properties to set + */ + function UpdateDeployPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDeployPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @instance + */ + UpdateDeployPolicyRequest.prototype.updateMask = null; + + /** + * UpdateDeployPolicyRequest deployPolicy. + * @member {google.cloud.deploy.v1.IDeployPolicy|null|undefined} deployPolicy + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @instance + */ + UpdateDeployPolicyRequest.prototype.deployPolicy = null; + + /** + * UpdateDeployPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @instance + */ + UpdateDeployPolicyRequest.prototype.requestId = ""; + + /** + * UpdateDeployPolicyRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @instance + */ + UpdateDeployPolicyRequest.prototype.allowMissing = false; + + /** + * UpdateDeployPolicyRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @instance + */ + UpdateDeployPolicyRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateDeployPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeployPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.UpdateDeployPolicyRequest} UpdateDeployPolicyRequest instance + */ + UpdateDeployPolicyRequest.create = function create(properties) { + return new UpdateDeployPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeployPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeployPolicyRequest} message UpdateDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeployPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deployPolicy != null && Object.hasOwnProperty.call(message, "deployPolicy")) + $root.google.cloud.deploy.v1.DeployPolicy.encode(message.deployPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeployPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeployPolicyRequest} message UpdateDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeployPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeployPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.UpdateDeployPolicyRequest} UpdateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeployPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.UpdateDeployPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deployPolicy = $root.google.cloud.deploy.v1.DeployPolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.UpdateDeployPolicyRequest} UpdateDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeployPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeployPolicyRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeployPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.deployPolicy != null && message.hasOwnProperty("deployPolicy")) { + var error = $root.google.cloud.deploy.v1.DeployPolicy.verify(message.deployPolicy); + if (error) + return "deployPolicy." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.UpdateDeployPolicyRequest} UpdateDeployPolicyRequest + */ + UpdateDeployPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.UpdateDeployPolicyRequest) + return object; + var message = new $root.google.cloud.deploy.v1.UpdateDeployPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateDeployPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.deployPolicy != null) { + if (typeof object.deployPolicy !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateDeployPolicyRequest.deployPolicy: object expected"); + message.deployPolicy = $root.google.cloud.deploy.v1.DeployPolicy.fromObject(object.deployPolicy); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateDeployPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.UpdateDeployPolicyRequest} message UpdateDeployPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeployPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.deployPolicy = null; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.deployPolicy != null && message.hasOwnProperty("deployPolicy")) + object.deployPolicy = $root.google.cloud.deploy.v1.DeployPolicy.toObject(message.deployPolicy, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateDeployPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeployPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeployPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.UpdateDeployPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeployPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.UpdateDeployPolicyRequest"; + }; + + return UpdateDeployPolicyRequest; + })(); + + v1.DeleteDeployPolicyRequest = (function() { + + /** + * Properties of a DeleteDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @interface IDeleteDeployPolicyRequest + * @property {string|null} [name] DeleteDeployPolicyRequest name + * @property {string|null} [requestId] DeleteDeployPolicyRequest requestId + * @property {boolean|null} [allowMissing] DeleteDeployPolicyRequest allowMissing + * @property {boolean|null} [validateOnly] DeleteDeployPolicyRequest validateOnly + * @property {string|null} [etag] DeleteDeployPolicyRequest etag + */ + + /** + * Constructs a new DeleteDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeleteDeployPolicyRequest. + * @implements IDeleteDeployPolicyRequest + * @constructor + * @param {google.cloud.deploy.v1.IDeleteDeployPolicyRequest=} [properties] Properties to set + */ + function DeleteDeployPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDeployPolicyRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @instance + */ + DeleteDeployPolicyRequest.prototype.name = ""; + + /** + * DeleteDeployPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @instance + */ + DeleteDeployPolicyRequest.prototype.requestId = ""; + + /** + * DeleteDeployPolicyRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @instance + */ + DeleteDeployPolicyRequest.prototype.allowMissing = false; + + /** + * DeleteDeployPolicyRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @instance + */ + DeleteDeployPolicyRequest.prototype.validateOnly = false; + + /** + * DeleteDeployPolicyRequest etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @instance + */ + DeleteDeployPolicyRequest.prototype.etag = ""; + + /** + * Creates a new DeleteDeployPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeployPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeleteDeployPolicyRequest} DeleteDeployPolicyRequest instance + */ + DeleteDeployPolicyRequest.create = function create(properties) { + return new DeleteDeployPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeployPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeployPolicyRequest} message DeleteDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeployPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeployPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeployPolicyRequest} message DeleteDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeployPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeployPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeleteDeployPolicyRequest} DeleteDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeployPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeleteDeployPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeleteDeployPolicyRequest} DeleteDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeployPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeployPolicyRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeployPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeleteDeployPolicyRequest} DeleteDeployPolicyRequest + */ + DeleteDeployPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeleteDeployPolicyRequest) + return object; + var message = new $root.google.cloud.deploy.v1.DeleteDeployPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteDeployPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.DeleteDeployPolicyRequest} message DeleteDeployPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeployPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteDeployPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeployPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeployPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeleteDeployPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeployPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeleteDeployPolicyRequest"; + }; + + return DeleteDeployPolicyRequest; + })(); + + v1.ListDeployPoliciesRequest = (function() { + + /** + * Properties of a ListDeployPoliciesRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListDeployPoliciesRequest + * @property {string|null} [parent] ListDeployPoliciesRequest parent + * @property {number|null} [pageSize] ListDeployPoliciesRequest pageSize + * @property {string|null} [pageToken] ListDeployPoliciesRequest pageToken + * @property {string|null} [filter] ListDeployPoliciesRequest filter + * @property {string|null} [orderBy] ListDeployPoliciesRequest orderBy + */ + + /** + * Constructs a new ListDeployPoliciesRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListDeployPoliciesRequest. + * @implements IListDeployPoliciesRequest + * @constructor + * @param {google.cloud.deploy.v1.IListDeployPoliciesRequest=} [properties] Properties to set + */ + function ListDeployPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeployPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @instance + */ + ListDeployPoliciesRequest.prototype.parent = ""; + + /** + * ListDeployPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @instance + */ + ListDeployPoliciesRequest.prototype.pageSize = 0; + + /** + * ListDeployPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @instance + */ + ListDeployPoliciesRequest.prototype.pageToken = ""; + + /** + * ListDeployPoliciesRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @instance + */ + ListDeployPoliciesRequest.prototype.filter = ""; + + /** + * ListDeployPoliciesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @instance + */ + ListDeployPoliciesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDeployPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeployPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListDeployPoliciesRequest} ListDeployPoliciesRequest instance + */ + ListDeployPoliciesRequest.create = function create(properties) { + return new ListDeployPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListDeployPoliciesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeployPoliciesRequest} message ListDeployPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeployPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDeployPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeployPoliciesRequest} message ListDeployPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeployPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeployPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListDeployPoliciesRequest} ListDeployPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeployPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListDeployPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeployPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListDeployPoliciesRequest} ListDeployPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeployPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeployPoliciesRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeployPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDeployPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListDeployPoliciesRequest} ListDeployPoliciesRequest + */ + ListDeployPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListDeployPoliciesRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListDeployPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDeployPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {google.cloud.deploy.v1.ListDeployPoliciesRequest} message ListDeployPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeployPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDeployPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeployPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeployPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListDeployPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeployPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListDeployPoliciesRequest"; + }; + + return ListDeployPoliciesRequest; + })(); + + v1.ListDeployPoliciesResponse = (function() { + + /** + * Properties of a ListDeployPoliciesResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListDeployPoliciesResponse + * @property {Array.|null} [deployPolicies] ListDeployPoliciesResponse deployPolicies + * @property {string|null} [nextPageToken] ListDeployPoliciesResponse nextPageToken + * @property {Array.|null} [unreachable] ListDeployPoliciesResponse unreachable + */ + + /** + * Constructs a new ListDeployPoliciesResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListDeployPoliciesResponse. + * @implements IListDeployPoliciesResponse + * @constructor + * @param {google.cloud.deploy.v1.IListDeployPoliciesResponse=} [properties] Properties to set + */ + function ListDeployPoliciesResponse(properties) { + this.deployPolicies = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeployPoliciesResponse deployPolicies. + * @member {Array.} deployPolicies + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @instance + */ + ListDeployPoliciesResponse.prototype.deployPolicies = $util.emptyArray; + + /** + * ListDeployPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @instance + */ + ListDeployPoliciesResponse.prototype.nextPageToken = ""; + + /** + * ListDeployPoliciesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @instance + */ + ListDeployPoliciesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDeployPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeployPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListDeployPoliciesResponse} ListDeployPoliciesResponse instance + */ + ListDeployPoliciesResponse.create = function create(properties) { + return new ListDeployPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListDeployPoliciesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeployPoliciesResponse} message ListDeployPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeployPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployPolicies != null && message.deployPolicies.length) + for (var i = 0; i < message.deployPolicies.length; ++i) + $root.google.cloud.deploy.v1.DeployPolicy.encode(message.deployPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListDeployPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeployPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeployPoliciesResponse} message ListDeployPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeployPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeployPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListDeployPoliciesResponse} ListDeployPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeployPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListDeployPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.deployPolicies && message.deployPolicies.length)) + message.deployPolicies = []; + message.deployPolicies.push($root.google.cloud.deploy.v1.DeployPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeployPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListDeployPoliciesResponse} ListDeployPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeployPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeployPoliciesResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeployPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployPolicies != null && message.hasOwnProperty("deployPolicies")) { + if (!Array.isArray(message.deployPolicies)) + return "deployPolicies: array expected"; + for (var i = 0; i < message.deployPolicies.length; ++i) { + var error = $root.google.cloud.deploy.v1.DeployPolicy.verify(message.deployPolicies[i]); + if (error) + return "deployPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListDeployPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListDeployPoliciesResponse} ListDeployPoliciesResponse + */ + ListDeployPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListDeployPoliciesResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListDeployPoliciesResponse(); + if (object.deployPolicies) { + if (!Array.isArray(object.deployPolicies)) + throw TypeError(".google.cloud.deploy.v1.ListDeployPoliciesResponse.deployPolicies: array expected"); + message.deployPolicies = []; + for (var i = 0; i < object.deployPolicies.length; ++i) { + if (typeof object.deployPolicies[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListDeployPoliciesResponse.deployPolicies: object expected"); + message.deployPolicies[i] = $root.google.cloud.deploy.v1.DeployPolicy.fromObject(object.deployPolicies[i]); } - return typeUrlPrefix + "/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"; - }; - - return SkaffoldSupportedCondition; - })(); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListDeployPoliciesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; - Release.ReleaseCondition = (function() { + /** + * Creates a plain object from a ListDeployPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {google.cloud.deploy.v1.ListDeployPoliciesResponse} message ListDeployPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeployPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deployPolicies = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.deployPolicies && message.deployPolicies.length) { + object.deployPolicies = []; + for (var j = 0; j < message.deployPolicies.length; ++j) + object.deployPolicies[j] = $root.google.cloud.deploy.v1.DeployPolicy.toObject(message.deployPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; - /** - * Properties of a ReleaseCondition. - * @memberof google.cloud.deploy.v1.Release - * @interface IReleaseCondition - * @property {google.cloud.deploy.v1.Release.IReleaseReadyCondition|null} [releaseReadyCondition] ReleaseCondition releaseReadyCondition - * @property {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null} [skaffoldSupportedCondition] ReleaseCondition skaffoldSupportedCondition - */ + /** + * Converts this ListDeployPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeployPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new ReleaseCondition. - * @memberof google.cloud.deploy.v1.Release - * @classdesc Represents a ReleaseCondition. - * @implements IReleaseCondition - * @constructor - * @param {google.cloud.deploy.v1.Release.IReleaseCondition=} [properties] Properties to set - */ - function ReleaseCondition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Gets the default type url for ListDeployPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListDeployPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeployPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListDeployPoliciesResponse"; + }; - /** - * ReleaseCondition releaseReadyCondition. - * @member {google.cloud.deploy.v1.Release.IReleaseReadyCondition|null|undefined} releaseReadyCondition - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @instance - */ - ReleaseCondition.prototype.releaseReadyCondition = null; + return ListDeployPoliciesResponse; + })(); - /** - * ReleaseCondition skaffoldSupportedCondition. - * @member {google.cloud.deploy.v1.Release.ISkaffoldSupportedCondition|null|undefined} skaffoldSupportedCondition - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @instance - */ - ReleaseCondition.prototype.skaffoldSupportedCondition = null; + v1.GetDeployPolicyRequest = (function() { - /** - * Creates a new ReleaseCondition instance using the specified properties. - * @function create - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {google.cloud.deploy.v1.Release.IReleaseCondition=} [properties] Properties to set - * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition instance - */ - ReleaseCondition.create = function create(properties) { - return new ReleaseCondition(properties); - }; + /** + * Properties of a GetDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetDeployPolicyRequest + * @property {string|null} [name] GetDeployPolicyRequest name + */ - /** - * Encodes the specified ReleaseCondition message. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {google.cloud.deploy.v1.Release.IReleaseCondition} message ReleaseCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReleaseCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.releaseReadyCondition != null && Object.hasOwnProperty.call(message, "releaseReadyCondition")) - $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.encode(message.releaseReadyCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.skaffoldSupportedCondition != null && Object.hasOwnProperty.call(message, "skaffoldSupportedCondition")) - $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.encode(message.skaffoldSupportedCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Constructs a new GetDeployPolicyRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetDeployPolicyRequest. + * @implements IGetDeployPolicyRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetDeployPolicyRequest=} [properties] Properties to set + */ + function GetDeployPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ReleaseCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.ReleaseCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {google.cloud.deploy.v1.Release.IReleaseCondition} message ReleaseCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReleaseCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * GetDeployPolicyRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @instance + */ + GetDeployPolicyRequest.prototype.name = ""; - /** - * Decodes a ReleaseCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReleaseCondition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.ReleaseCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.releaseReadyCondition = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.skaffoldSupportedCondition = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Creates a new GetDeployPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeployPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetDeployPolicyRequest} GetDeployPolicyRequest instance + */ + GetDeployPolicyRequest.create = function create(properties) { + return new GetDeployPolicyRequest(properties); + }; + + /** + * Encodes the specified GetDeployPolicyRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetDeployPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeployPolicyRequest} message GetDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeployPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDeployPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetDeployPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeployPolicyRequest} message GetDeployPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeployPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeployPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetDeployPolicyRequest} GetDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeployPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetDeployPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a ReleaseCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReleaseCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a ReleaseCondition message. - * @function verify - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReleaseCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.releaseReadyCondition != null && message.hasOwnProperty("releaseReadyCondition")) { - var error = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.verify(message.releaseReadyCondition); - if (error) - return "releaseReadyCondition." + error; - } - if (message.skaffoldSupportedCondition != null && message.hasOwnProperty("skaffoldSupportedCondition")) { - var error = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.verify(message.skaffoldSupportedCondition); - if (error) - return "skaffoldSupportedCondition." + error; - } - return null; - }; + /** + * Decodes a GetDeployPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetDeployPolicyRequest} GetDeployPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeployPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a ReleaseCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.deploy.v1.Release.ReleaseCondition} ReleaseCondition - */ - ReleaseCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.deploy.v1.Release.ReleaseCondition) - return object; - var message = new $root.google.cloud.deploy.v1.Release.ReleaseCondition(); - if (object.releaseReadyCondition != null) { - if (typeof object.releaseReadyCondition !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.ReleaseCondition.releaseReadyCondition: object expected"); - message.releaseReadyCondition = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.fromObject(object.releaseReadyCondition); - } - if (object.skaffoldSupportedCondition != null) { - if (typeof object.skaffoldSupportedCondition !== "object") - throw TypeError(".google.cloud.deploy.v1.Release.ReleaseCondition.skaffoldSupportedCondition: object expected"); - message.skaffoldSupportedCondition = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.fromObject(object.skaffoldSupportedCondition); - } - return message; - }; + /** + * Verifies a GetDeployPolicyRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeployPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Creates a plain object from a ReleaseCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {google.cloud.deploy.v1.Release.ReleaseCondition} message ReleaseCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReleaseCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.releaseReadyCondition = null; - object.skaffoldSupportedCondition = null; - } - if (message.releaseReadyCondition != null && message.hasOwnProperty("releaseReadyCondition")) - object.releaseReadyCondition = $root.google.cloud.deploy.v1.Release.ReleaseReadyCondition.toObject(message.releaseReadyCondition, options); - if (message.skaffoldSupportedCondition != null && message.hasOwnProperty("skaffoldSupportedCondition")) - object.skaffoldSupportedCondition = $root.google.cloud.deploy.v1.Release.SkaffoldSupportedCondition.toObject(message.skaffoldSupportedCondition, options); + /** + * Creates a GetDeployPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetDeployPolicyRequest} GetDeployPolicyRequest + */ + GetDeployPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetDeployPolicyRequest) return object; - }; + var message = new $root.google.cloud.deploy.v1.GetDeployPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Converts this ReleaseCondition to JSON. - * @function toJSON - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @instance - * @returns {Object.} JSON object - */ - ReleaseCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a GetDeployPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {google.cloud.deploy.v1.GetDeployPolicyRequest} message GetDeployPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeployPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Gets the default type url for ReleaseCondition - * @function getTypeUrl - * @memberof google.cloud.deploy.v1.Release.ReleaseCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReleaseCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.deploy.v1.Release.ReleaseCondition"; - }; + /** + * Converts this GetDeployPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeployPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ReleaseCondition; - })(); + /** + * Gets the default type url for GetDeployPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetDeployPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeployPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetDeployPolicyRequest"; + }; - return Release; + return GetDeployPolicyRequest; })(); v1.BuildArtifact = (function() { @@ -23419,6 +28455,7 @@ * @property {google.cloud.deploy.v1.IRelease|null} [release] CreateReleaseRequest release * @property {string|null} [requestId] CreateReleaseRequest requestId * @property {boolean|null} [validateOnly] CreateReleaseRequest validateOnly + * @property {Array.|null} [overrideDeployPolicy] CreateReleaseRequest overrideDeployPolicy */ /** @@ -23430,6 +28467,7 @@ * @param {google.cloud.deploy.v1.ICreateReleaseRequest=} [properties] Properties to set */ function CreateReleaseRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23476,6 +28514,14 @@ */ CreateReleaseRequest.prototype.validateOnly = false; + /** + * CreateReleaseRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new CreateReleaseRequest instance using the specified properties. * @function create @@ -23510,6 +28556,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.overrideDeployPolicy[i]); return writer; }; @@ -23564,6 +28613,12 @@ message.validateOnly = reader.bool(); break; } + case 6: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -23616,6 +28671,13 @@ if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -23644,6 +28706,13 @@ message.requestId = String(object.requestId); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.CreateReleaseRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -23660,6 +28729,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) { object.parent = ""; object.releaseId = ""; @@ -23677,6 +28748,11 @@ object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -29789,6 +34865,7 @@ * @property {google.cloud.deploy.v1.IRollout|null} [rollout] CreateRolloutRequest rollout * @property {string|null} [requestId] CreateRolloutRequest requestId * @property {boolean|null} [validateOnly] CreateRolloutRequest validateOnly + * @property {Array.|null} [overrideDeployPolicy] CreateRolloutRequest overrideDeployPolicy * @property {string|null} [startingPhaseId] CreateRolloutRequest startingPhaseId */ @@ -29801,6 +34878,7 @@ * @param {google.cloud.deploy.v1.ICreateRolloutRequest=} [properties] Properties to set */ function CreateRolloutRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29847,6 +34925,14 @@ */ CreateRolloutRequest.prototype.validateOnly = false; + /** + * CreateRolloutRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * CreateRolloutRequest startingPhaseId. * @member {string} startingPhaseId @@ -29889,6 +34975,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.overrideDeployPolicy[i]); if (message.startingPhaseId != null && Object.hasOwnProperty.call(message, "startingPhaseId")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.startingPhaseId); return writer; @@ -29945,6 +35034,12 @@ message.validateOnly = reader.bool(); break; } + case 6: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } case 7: { message.startingPhaseId = reader.string(); break; @@ -30001,6 +35096,13 @@ if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } if (message.startingPhaseId != null && message.hasOwnProperty("startingPhaseId")) if (!$util.isString(message.startingPhaseId)) return "startingPhaseId: string expected"; @@ -30032,6 +35134,13 @@ message.requestId = String(object.requestId); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.CreateRolloutRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } if (object.startingPhaseId != null) message.startingPhaseId = String(object.startingPhaseId); return message; @@ -30050,6 +35159,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) { object.parent = ""; object.rolloutId = ""; @@ -30068,6 +35179,11 @@ object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } if (message.startingPhaseId != null && message.hasOwnProperty("startingPhaseId")) object.startingPhaseId = message.startingPhaseId; return object; @@ -30462,6 +35578,7 @@ * @interface IApproveRolloutRequest * @property {string|null} [name] ApproveRolloutRequest name * @property {boolean|null} [approved] ApproveRolloutRequest approved + * @property {Array.|null} [overrideDeployPolicy] ApproveRolloutRequest overrideDeployPolicy */ /** @@ -30473,6 +35590,7 @@ * @param {google.cloud.deploy.v1.IApproveRolloutRequest=} [properties] Properties to set */ function ApproveRolloutRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30495,6 +35613,14 @@ */ ApproveRolloutRequest.prototype.approved = false; + /** + * ApproveRolloutRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @instance + */ + ApproveRolloutRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new ApproveRolloutRequest instance using the specified properties. * @function create @@ -30523,6 +35649,9 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.approved != null && Object.hasOwnProperty.call(message, "approved")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.approved); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.overrideDeployPolicy[i]); return writer; }; @@ -30565,6 +35694,12 @@ message.approved = reader.bool(); break; } + case 3: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -30606,6 +35741,13 @@ if (message.approved != null && message.hasOwnProperty("approved")) if (typeof message.approved !== "boolean") return "approved: boolean expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -30625,6 +35767,13 @@ message.name = String(object.name); if (object.approved != null) message.approved = Boolean(object.approved); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.ApproveRolloutRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -30641,6 +35790,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) { object.name = ""; object.approved = false; @@ -30649,6 +35800,11 @@ object.name = message.name; if (message.approved != null && message.hasOwnProperty("approved")) object.approved = message.approved; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -30864,6 +36020,7 @@ * @interface IAdvanceRolloutRequest * @property {string|null} [name] AdvanceRolloutRequest name * @property {string|null} [phaseId] AdvanceRolloutRequest phaseId + * @property {Array.|null} [overrideDeployPolicy] AdvanceRolloutRequest overrideDeployPolicy */ /** @@ -30875,6 +36032,7 @@ * @param {google.cloud.deploy.v1.IAdvanceRolloutRequest=} [properties] Properties to set */ function AdvanceRolloutRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30897,6 +36055,14 @@ */ AdvanceRolloutRequest.prototype.phaseId = ""; + /** + * AdvanceRolloutRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.AdvanceRolloutRequest + * @instance + */ + AdvanceRolloutRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new AdvanceRolloutRequest instance using the specified properties. * @function create @@ -30925,6 +36091,9 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.phaseId != null && Object.hasOwnProperty.call(message, "phaseId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.phaseId); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.overrideDeployPolicy[i]); return writer; }; @@ -30967,6 +36136,12 @@ message.phaseId = reader.string(); break; } + case 3: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -31008,6 +36183,13 @@ if (message.phaseId != null && message.hasOwnProperty("phaseId")) if (!$util.isString(message.phaseId)) return "phaseId: string expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -31027,6 +36209,13 @@ message.name = String(object.name); if (object.phaseId != null) message.phaseId = String(object.phaseId); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.AdvanceRolloutRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -31043,6 +36232,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) { object.name = ""; object.phaseId = ""; @@ -31051,6 +36242,11 @@ object.name = message.name; if (message.phaseId != null && message.hasOwnProperty("phaseId")) object.phaseId = message.phaseId; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -31265,6 +36461,7 @@ * @memberof google.cloud.deploy.v1 * @interface ICancelRolloutRequest * @property {string|null} [name] CancelRolloutRequest name + * @property {Array.|null} [overrideDeployPolicy] CancelRolloutRequest overrideDeployPolicy */ /** @@ -31276,6 +36473,7 @@ * @param {google.cloud.deploy.v1.ICancelRolloutRequest=} [properties] Properties to set */ function CancelRolloutRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31290,6 +36488,14 @@ */ CancelRolloutRequest.prototype.name = ""; + /** + * CancelRolloutRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.CancelRolloutRequest + * @instance + */ + CancelRolloutRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new CancelRolloutRequest instance using the specified properties. * @function create @@ -31316,6 +36522,9 @@ writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.overrideDeployPolicy[i]); return writer; }; @@ -31354,6 +36563,12 @@ message.name = reader.string(); break; } + case 2: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -31392,6 +36607,13 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -31409,6 +36631,13 @@ var message = new $root.google.cloud.deploy.v1.CancelRolloutRequest(); if (object.name != null) message.name = String(object.name); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.CancelRolloutRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -31425,10 +36654,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -31645,6 +36881,7 @@ * @property {string|null} [rollout] IgnoreJobRequest rollout * @property {string|null} [phaseId] IgnoreJobRequest phaseId * @property {string|null} [jobId] IgnoreJobRequest jobId + * @property {Array.|null} [overrideDeployPolicy] IgnoreJobRequest overrideDeployPolicy */ /** @@ -31656,6 +36893,7 @@ * @param {google.cloud.deploy.v1.IIgnoreJobRequest=} [properties] Properties to set */ function IgnoreJobRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31686,6 +36924,14 @@ */ IgnoreJobRequest.prototype.jobId = ""; + /** + * IgnoreJobRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.IgnoreJobRequest + * @instance + */ + IgnoreJobRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new IgnoreJobRequest instance using the specified properties. * @function create @@ -31716,6 +36962,9 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.phaseId); if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.overrideDeployPolicy[i]); return writer; }; @@ -31762,6 +37011,12 @@ message.jobId = reader.string(); break; } + case 4: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -31806,6 +37061,13 @@ if (message.jobId != null && message.hasOwnProperty("jobId")) if (!$util.isString(message.jobId)) return "jobId: string expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -31827,6 +37089,13 @@ message.phaseId = String(object.phaseId); if (object.jobId != null) message.jobId = String(object.jobId); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.IgnoreJobRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -31843,6 +37112,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) { object.rollout = ""; object.phaseId = ""; @@ -31854,6 +37125,11 @@ object.phaseId = message.phaseId; if (message.jobId != null && message.hasOwnProperty("jobId")) object.jobId = message.jobId; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -32070,6 +37346,7 @@ * @property {string|null} [rollout] RetryJobRequest rollout * @property {string|null} [phaseId] RetryJobRequest phaseId * @property {string|null} [jobId] RetryJobRequest jobId + * @property {Array.|null} [overrideDeployPolicy] RetryJobRequest overrideDeployPolicy */ /** @@ -32081,6 +37358,7 @@ * @param {google.cloud.deploy.v1.IRetryJobRequest=} [properties] Properties to set */ function RetryJobRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32111,6 +37389,14 @@ */ RetryJobRequest.prototype.jobId = ""; + /** + * RetryJobRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + */ + RetryJobRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new RetryJobRequest instance using the specified properties. * @function create @@ -32141,6 +37427,9 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.phaseId); if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.overrideDeployPolicy[i]); return writer; }; @@ -32187,6 +37476,12 @@ message.jobId = reader.string(); break; } + case 4: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -32231,6 +37526,13 @@ if (message.jobId != null && message.hasOwnProperty("jobId")) if (!$util.isString(message.jobId)) return "jobId: string expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -32252,6 +37554,13 @@ message.phaseId = String(object.phaseId); if (object.jobId != null) message.jobId = String(object.jobId); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.RetryJobRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -32268,6 +37577,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) { object.rollout = ""; object.phaseId = ""; @@ -32279,6 +37590,11 @@ object.phaseId = message.phaseId; if (message.jobId != null && message.hasOwnProperty("jobId")) object.jobId = message.jobId; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -36138,6 +41454,7 @@ * @memberof google.cloud.deploy.v1 * @interface ITerminateJobRunRequest * @property {string|null} [name] TerminateJobRunRequest name + * @property {Array.|null} [overrideDeployPolicy] TerminateJobRunRequest overrideDeployPolicy */ /** @@ -36149,6 +41466,7 @@ * @param {google.cloud.deploy.v1.ITerminateJobRunRequest=} [properties] Properties to set */ function TerminateJobRunRequest(properties) { + this.overrideDeployPolicy = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36163,6 +41481,14 @@ */ TerminateJobRunRequest.prototype.name = ""; + /** + * TerminateJobRunRequest overrideDeployPolicy. + * @member {Array.} overrideDeployPolicy + * @memberof google.cloud.deploy.v1.TerminateJobRunRequest + * @instance + */ + TerminateJobRunRequest.prototype.overrideDeployPolicy = $util.emptyArray; + /** * Creates a new TerminateJobRunRequest instance using the specified properties. * @function create @@ -36189,6 +41515,9 @@ writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.overrideDeployPolicy != null && message.overrideDeployPolicy.length) + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.overrideDeployPolicy[i]); return writer; }; @@ -36227,6 +41556,12 @@ message.name = reader.string(); break; } + case 2: { + if (!(message.overrideDeployPolicy && message.overrideDeployPolicy.length)) + message.overrideDeployPolicy = []; + message.overrideDeployPolicy.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -36265,6 +41600,13 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.overrideDeployPolicy != null && message.hasOwnProperty("overrideDeployPolicy")) { + if (!Array.isArray(message.overrideDeployPolicy)) + return "overrideDeployPolicy: array expected"; + for (var i = 0; i < message.overrideDeployPolicy.length; ++i) + if (!$util.isString(message.overrideDeployPolicy[i])) + return "overrideDeployPolicy: string[] expected"; + } return null; }; @@ -36282,6 +41624,13 @@ var message = new $root.google.cloud.deploy.v1.TerminateJobRunRequest(); if (object.name != null) message.name = String(object.name); + if (object.overrideDeployPolicy) { + if (!Array.isArray(object.overrideDeployPolicy)) + throw TypeError(".google.cloud.deploy.v1.TerminateJobRunRequest.overrideDeployPolicy: array expected"); + message.overrideDeployPolicy = []; + for (var i = 0; i < object.overrideDeployPolicy.length; ++i) + message.overrideDeployPolicy[i] = String(object.overrideDeployPolicy[i]); + } return message; }; @@ -36298,10 +41647,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrideDeployPolicy = []; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.overrideDeployPolicy && message.overrideDeployPolicy.length) { + object.overrideDeployPolicy = []; + for (var j = 0; j < message.overrideDeployPolicy.length; ++j) + object.overrideDeployPolicy[j] = message.overrideDeployPolicy[j]; + } return object; }; @@ -41149,6 +46505,7 @@ * @property {string|null} [targetId] AutomationRun targetId * @property {google.cloud.deploy.v1.AutomationRun.State|null} [state] AutomationRun state * @property {string|null} [stateDescription] AutomationRun stateDescription + * @property {google.cloud.deploy.v1.IPolicyViolation|null} [policyViolation] AutomationRun policyViolation * @property {google.protobuf.ITimestamp|null} [expireTime] AutomationRun expireTime * @property {string|null} [ruleId] AutomationRun ruleId * @property {string|null} [automationId] AutomationRun automationId @@ -41245,6 +46602,14 @@ */ AutomationRun.prototype.stateDescription = ""; + /** + * AutomationRun policyViolation. + * @member {google.cloud.deploy.v1.IPolicyViolation|null|undefined} policyViolation + * @memberof google.cloud.deploy.v1.AutomationRun + * @instance + */ + AutomationRun.prototype.policyViolation = null; + /** * AutomationRun expireTime. * @member {google.protobuf.ITimestamp|null|undefined} expireTime @@ -41357,6 +46722,8 @@ writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); if (message.stateDescription != null && Object.hasOwnProperty.call(message, "stateDescription")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.stateDescription); + if (message.policyViolation != null && Object.hasOwnProperty.call(message, "policyViolation")) + $root.google.cloud.deploy.v1.PolicyViolation.encode(message.policyViolation, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) @@ -41441,6 +46808,10 @@ message.stateDescription = reader.string(); break; } + case 10: { + message.policyViolation = $root.google.cloud.deploy.v1.PolicyViolation.decode(reader, reader.uint32()); + break; + } case 11: { message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; @@ -41548,6 +46919,11 @@ if (message.stateDescription != null && message.hasOwnProperty("stateDescription")) if (!$util.isString(message.stateDescription)) return "stateDescription: string expected"; + if (message.policyViolation != null && message.hasOwnProperty("policyViolation")) { + var error = $root.google.cloud.deploy.v1.PolicyViolation.verify(message.policyViolation); + if (error) + return "policyViolation." + error; + } if (message.expireTime != null && message.hasOwnProperty("expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime); if (error) @@ -41668,6 +47044,11 @@ } if (object.stateDescription != null) message.stateDescription = String(object.stateDescription); + if (object.policyViolation != null) { + if (typeof object.policyViolation !== "object") + throw TypeError(".google.cloud.deploy.v1.AutomationRun.policyViolation: object expected"); + message.policyViolation = $root.google.cloud.deploy.v1.PolicyViolation.fromObject(object.policyViolation); + } if (object.expireTime != null) { if (typeof object.expireTime !== "object") throw TypeError(".google.cloud.deploy.v1.AutomationRun.expireTime: object expected"); @@ -41723,6 +47104,7 @@ object.targetId = ""; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; object.stateDescription = ""; + object.policyViolation = null; object.expireTime = null; object.ruleId = ""; object.automationId = ""; @@ -41746,6 +47128,8 @@ object.state = options.enums === String ? $root.google.cloud.deploy.v1.AutomationRun.State[message.state] === undefined ? message.state : $root.google.cloud.deploy.v1.AutomationRun.State[message.state] : message.state; if (message.stateDescription != null && message.hasOwnProperty("stateDescription")) object.stateDescription = message.stateDescription; + if (message.policyViolation != null && message.hasOwnProperty("policyViolation")) + object.policyViolation = $root.google.cloud.deploy.v1.PolicyViolation.toObject(message.policyViolation, options); if (message.expireTime != null && message.hasOwnProperty("expireTime")) object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); if (message.ruleId != null && message.hasOwnProperty("ruleId")) @@ -45320,6 +50704,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -45379,6 +50764,337 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CustomTargetTypeNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CustomTargetTypeNotificationEvent + * @static + * @param {google.cloud.deploy.v1.CustomTargetTypeNotificationEvent} message CustomTargetTypeNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomTargetTypeNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.customTargetType = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.customTargetTypeUid = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.customTargetType != null && message.hasOwnProperty("customTargetType")) + object.customTargetType = message.customTargetType; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] === undefined ? message.type : $root.google.cloud.deploy.v1.Type[message.type] : message.type; + if (message.customTargetTypeUid != null && message.hasOwnProperty("customTargetTypeUid")) + object.customTargetTypeUid = message.customTargetTypeUid; + return object; + }; + + /** + * Converts this CustomTargetTypeNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CustomTargetTypeNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + CustomTargetTypeNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomTargetTypeNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CustomTargetTypeNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomTargetTypeNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"; + }; + + return CustomTargetTypeNotificationEvent; + })(); + + v1.DeliveryPipelineNotificationEvent = (function() { + + /** + * Properties of a DeliveryPipelineNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IDeliveryPipelineNotificationEvent + * @property {string|null} [message] DeliveryPipelineNotificationEvent message + * @property {string|null} [pipelineUid] DeliveryPipelineNotificationEvent pipelineUid + * @property {string|null} [deliveryPipeline] DeliveryPipelineNotificationEvent deliveryPipeline + * @property {google.cloud.deploy.v1.Type|null} [type] DeliveryPipelineNotificationEvent type + */ + + /** + * Constructs a new DeliveryPipelineNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeliveryPipelineNotificationEvent. + * @implements IDeliveryPipelineNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set + */ + function DeliveryPipelineNotificationEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeliveryPipelineNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.message = ""; + + /** + * DeliveryPipelineNotificationEvent pipelineUid. + * @member {string} pipelineUid + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.pipelineUid = ""; + + /** + * DeliveryPipelineNotificationEvent deliveryPipeline. + * @member {string} deliveryPipeline + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.deliveryPipeline = ""; + + /** + * DeliveryPipelineNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.type = 0; + + /** + * Creates a new DeliveryPipelineNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent instance + */ + DeliveryPipelineNotificationEvent.create = function create(properties) { + return new DeliveryPipelineNotificationEvent(properties); + }; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipelineNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deliveryPipeline); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.pipelineUid != null && Object.hasOwnProperty.call(message, "pipelineUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pipelineUid); + return writer; + }; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipelineNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipelineNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 4: { + message.pipelineUid = reader.string(); + break; + } + case 2: { + message.deliveryPipeline = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipelineNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeliveryPipelineNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeliveryPipelineNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + if (!$util.isString(message.pipelineUid)) + return "pipelineUid: string expected"; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + if (!$util.isString(message.deliveryPipeline)) + return "deliveryPipeline: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 2: + break; + } + return null; + }; + + /** + * Creates a DeliveryPipelineNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + */ + DeliveryPipelineNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.pipelineUid != null) + message.pipelineUid = String(object.pipelineUid); + if (object.deliveryPipeline != null) + message.deliveryPipeline = String(object.deliveryPipeline); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RESOURCE_STATE_CHANGE": + case 3: + message.type = 3; + break; + case "TYPE_PROCESS_ABORTED": + case 4: + message.type = 4; + break; + case "TYPE_RESTRICTION_VIOLATED": + case 5: + message.type = 5; + break; + case "TYPE_RESOURCE_DELETED": + case 6: + message.type = 6; + break; + case "TYPE_ROLLOUT_UPDATE": + case 7: + message.type = 7; + break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -45388,85 +51104,95 @@ }; /** - * Creates a plain object from a CustomTargetTypeNotificationEvent message. Also converts values to other types if specified. + * Creates a plain object from a DeliveryPipelineNotificationEvent message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.deploy.v1.CustomTargetTypeNotificationEvent + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent * @static - * @param {google.cloud.deploy.v1.CustomTargetTypeNotificationEvent} message CustomTargetTypeNotificationEvent + * @param {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomTargetTypeNotificationEvent.toObject = function toObject(message, options) { + DeliveryPipelineNotificationEvent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.message = ""; - object.customTargetType = ""; + object.deliveryPipeline = ""; object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.customTargetTypeUid = ""; + object.pipelineUid = ""; } if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; - if (message.customTargetType != null && message.hasOwnProperty("customTargetType")) - object.customTargetType = message.customTargetType; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = message.deliveryPipeline; if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] === undefined ? message.type : $root.google.cloud.deploy.v1.Type[message.type] : message.type; - if (message.customTargetTypeUid != null && message.hasOwnProperty("customTargetTypeUid")) - object.customTargetTypeUid = message.customTargetTypeUid; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + object.pipelineUid = message.pipelineUid; return object; }; /** - * Converts this CustomTargetTypeNotificationEvent to JSON. + * Converts this DeliveryPipelineNotificationEvent to JSON. * @function toJSON - * @memberof google.cloud.deploy.v1.CustomTargetTypeNotificationEvent + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent * @instance * @returns {Object.} JSON object */ - CustomTargetTypeNotificationEvent.prototype.toJSON = function toJSON() { + DeliveryPipelineNotificationEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CustomTargetTypeNotificationEvent + * Gets the default type url for DeliveryPipelineNotificationEvent * @function getTypeUrl - * @memberof google.cloud.deploy.v1.CustomTargetTypeNotificationEvent + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CustomTargetTypeNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeliveryPipelineNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"; + return typeUrlPrefix + "/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"; }; - return CustomTargetTypeNotificationEvent; + return DeliveryPipelineNotificationEvent; })(); - v1.DeliveryPipelineNotificationEvent = (function() { + v1.DeployPolicyEvaluationEvent = (function() { /** - * Properties of a DeliveryPipelineNotificationEvent. + * Properties of a DeployPolicyEvaluationEvent. * @memberof google.cloud.deploy.v1 - * @interface IDeliveryPipelineNotificationEvent - * @property {string|null} [message] DeliveryPipelineNotificationEvent message - * @property {string|null} [pipelineUid] DeliveryPipelineNotificationEvent pipelineUid - * @property {string|null} [deliveryPipeline] DeliveryPipelineNotificationEvent deliveryPipeline - * @property {google.cloud.deploy.v1.Type|null} [type] DeliveryPipelineNotificationEvent type - */ - - /** - * Constructs a new DeliveryPipelineNotificationEvent. + * @interface IDeployPolicyEvaluationEvent + * @property {string|null} [message] DeployPolicyEvaluationEvent message + * @property {string|null} [ruleType] DeployPolicyEvaluationEvent ruleType + * @property {string|null} [rule] DeployPolicyEvaluationEvent rule + * @property {string|null} [pipelineUid] DeployPolicyEvaluationEvent pipelineUid + * @property {string|null} [deliveryPipeline] DeployPolicyEvaluationEvent deliveryPipeline + * @property {string|null} [targetUid] DeployPolicyEvaluationEvent targetUid + * @property {string|null} [target] DeployPolicyEvaluationEvent target + * @property {google.cloud.deploy.v1.DeployPolicy.Invoker|null} [invoker] DeployPolicyEvaluationEvent invoker + * @property {string|null} [deployPolicy] DeployPolicyEvaluationEvent deployPolicy + * @property {string|null} [deployPolicyUid] DeployPolicyEvaluationEvent deployPolicyUid + * @property {boolean|null} [allowed] DeployPolicyEvaluationEvent allowed + * @property {google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict|null} [verdict] DeployPolicyEvaluationEvent verdict + * @property {Array.|null} [overrides] DeployPolicyEvaluationEvent overrides + */ + + /** + * Constructs a new DeployPolicyEvaluationEvent. * @memberof google.cloud.deploy.v1 - * @classdesc Represents a DeliveryPipelineNotificationEvent. - * @implements IDeliveryPipelineNotificationEvent + * @classdesc Represents a DeployPolicyEvaluationEvent. + * @implements IDeployPolicyEvaluationEvent * @constructor - * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set + * @param {google.cloud.deploy.v1.IDeployPolicyEvaluationEvent=} [properties] Properties to set */ - function DeliveryPipelineNotificationEvent(properties) { + function DeployPolicyEvaluationEvent(properties) { + this.overrides = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45474,100 +51200,194 @@ } /** - * DeliveryPipelineNotificationEvent message. + * DeployPolicyEvaluationEvent message. * @member {string} message - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @instance */ - DeliveryPipelineNotificationEvent.prototype.message = ""; + DeployPolicyEvaluationEvent.prototype.message = ""; /** - * DeliveryPipelineNotificationEvent pipelineUid. + * DeployPolicyEvaluationEvent ruleType. + * @member {string} ruleType + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.ruleType = ""; + + /** + * DeployPolicyEvaluationEvent rule. + * @member {string} rule + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.rule = ""; + + /** + * DeployPolicyEvaluationEvent pipelineUid. * @member {string} pipelineUid - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @instance */ - DeliveryPipelineNotificationEvent.prototype.pipelineUid = ""; + DeployPolicyEvaluationEvent.prototype.pipelineUid = ""; /** - * DeliveryPipelineNotificationEvent deliveryPipeline. + * DeployPolicyEvaluationEvent deliveryPipeline. * @member {string} deliveryPipeline - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @instance */ - DeliveryPipelineNotificationEvent.prototype.deliveryPipeline = ""; + DeployPolicyEvaluationEvent.prototype.deliveryPipeline = ""; /** - * DeliveryPipelineNotificationEvent type. - * @member {google.cloud.deploy.v1.Type} type - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * DeployPolicyEvaluationEvent targetUid. + * @member {string} targetUid + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @instance */ - DeliveryPipelineNotificationEvent.prototype.type = 0; + DeployPolicyEvaluationEvent.prototype.targetUid = ""; /** - * Creates a new DeliveryPipelineNotificationEvent instance using the specified properties. + * DeployPolicyEvaluationEvent target. + * @member {string} target + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.target = ""; + + /** + * DeployPolicyEvaluationEvent invoker. + * @member {google.cloud.deploy.v1.DeployPolicy.Invoker} invoker + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.invoker = 0; + + /** + * DeployPolicyEvaluationEvent deployPolicy. + * @member {string} deployPolicy + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.deployPolicy = ""; + + /** + * DeployPolicyEvaluationEvent deployPolicyUid. + * @member {string} deployPolicyUid + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.deployPolicyUid = ""; + + /** + * DeployPolicyEvaluationEvent allowed. + * @member {boolean} allowed + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.allowed = false; + + /** + * DeployPolicyEvaluationEvent verdict. + * @member {google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict} verdict + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.verdict = 0; + + /** + * DeployPolicyEvaluationEvent overrides. + * @member {Array.} overrides + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent + * @instance + */ + DeployPolicyEvaluationEvent.prototype.overrides = $util.emptyArray; + + /** + * Creates a new DeployPolicyEvaluationEvent instance using the specified properties. * @function create - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static - * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set - * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent instance + * @param {google.cloud.deploy.v1.IDeployPolicyEvaluationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployPolicyEvaluationEvent} DeployPolicyEvaluationEvent instance */ - DeliveryPipelineNotificationEvent.create = function create(properties) { - return new DeliveryPipelineNotificationEvent(properties); + DeployPolicyEvaluationEvent.create = function create(properties) { + return new DeployPolicyEvaluationEvent(properties); }; /** - * Encodes the specified DeliveryPipelineNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * Encodes the specified DeployPolicyEvaluationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyEvaluationEvent.verify|verify} messages. * @function encode - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static - * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {google.cloud.deploy.v1.IDeployPolicyEvaluationEvent} message DeployPolicyEvaluationEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeliveryPipelineNotificationEvent.encode = function encode(message, writer) { + DeployPolicyEvaluationEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); - if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.deliveryPipeline); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.ruleType != null && Object.hasOwnProperty.call(message, "ruleType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleType); + if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rule); if (message.pipelineUid != null && Object.hasOwnProperty.call(message, "pipelineUid")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.pipelineUid); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.deliveryPipeline); + if (message.targetUid != null && Object.hasOwnProperty.call(message, "targetUid")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.targetUid); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.target); + if (message.invoker != null && Object.hasOwnProperty.call(message, "invoker")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.invoker); + if (message.deployPolicy != null && Object.hasOwnProperty.call(message, "deployPolicy")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.deployPolicy); + if (message.deployPolicyUid != null && Object.hasOwnProperty.call(message, "deployPolicyUid")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.deployPolicyUid); + if (message.allowed != null && Object.hasOwnProperty.call(message, "allowed")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.allowed); + if (message.verdict != null && Object.hasOwnProperty.call(message, "verdict")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.verdict); + if (message.overrides != null && message.overrides.length) { + writer.uint32(/* id 13, wireType 2 =*/106).fork(); + for (var i = 0; i < message.overrides.length; ++i) + writer.int32(message.overrides[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified DeliveryPipelineNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * Encodes the specified DeployPolicyEvaluationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployPolicyEvaluationEvent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static - * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {google.cloud.deploy.v1.IDeployPolicyEvaluationEvent} message DeployPolicyEvaluationEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeliveryPipelineNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + DeployPolicyEvaluationEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer. + * Decodes a DeployPolicyEvaluationEvent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @returns {google.cloud.deploy.v1.DeployPolicyEvaluationEvent} DeployPolicyEvaluationEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeliveryPipelineNotificationEvent.decode = function decode(reader, length) { + DeployPolicyEvaluationEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployPolicyEvaluationEvent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -45575,16 +51395,59 @@ message.message = reader.string(); break; } + case 2: { + message.ruleType = reader.string(); + break; + } + case 3: { + message.rule = reader.string(); + break; + } case 4: { message.pipelineUid = reader.string(); break; } - case 2: { + case 5: { message.deliveryPipeline = reader.string(); break; } - case 3: { - message.type = reader.int32(); + case 6: { + message.targetUid = reader.string(); + break; + } + case 7: { + message.target = reader.string(); + break; + } + case 8: { + message.invoker = reader.int32(); + break; + } + case 9: { + message.deployPolicy = reader.string(); + break; + } + case 10: { + message.deployPolicyUid = reader.string(); + break; + } + case 11: { + message.allowed = reader.bool(); + break; + } + case 12: { + message.verdict = reader.int32(); + break; + } + case 13: { + if (!(message.overrides && message.overrides.length)) + message.overrides = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.overrides.push(reader.int32()); + } else + message.overrides.push(reader.int32()); break; } default: @@ -45596,176 +51459,316 @@ }; /** - * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer, length delimited. + * Decodes a DeployPolicyEvaluationEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @returns {google.cloud.deploy.v1.DeployPolicyEvaluationEvent} DeployPolicyEvaluationEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeliveryPipelineNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + DeployPolicyEvaluationEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeliveryPipelineNotificationEvent message. + * Verifies a DeployPolicyEvaluationEvent message. * @function verify - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeliveryPipelineNotificationEvent.verify = function verify(message) { + DeployPolicyEvaluationEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.message != null && message.hasOwnProperty("message")) if (!$util.isString(message.message)) return "message: string expected"; + if (message.ruleType != null && message.hasOwnProperty("ruleType")) + if (!$util.isString(message.ruleType)) + return "ruleType: string expected"; + if (message.rule != null && message.hasOwnProperty("rule")) + if (!$util.isString(message.rule)) + return "rule: string expected"; if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) if (!$util.isString(message.pipelineUid)) return "pipelineUid: string expected"; if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) if (!$util.isString(message.deliveryPipeline)) return "deliveryPipeline: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { + if (message.targetUid != null && message.hasOwnProperty("targetUid")) + if (!$util.isString(message.targetUid)) + return "targetUid: string expected"; + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.invoker != null && message.hasOwnProperty("invoker")) + switch (message.invoker) { default: - return "type: enum value expected"; + return "invoker: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.deployPolicy != null && message.hasOwnProperty("deployPolicy")) + if (!$util.isString(message.deployPolicy)) + return "deployPolicy: string expected"; + if (message.deployPolicyUid != null && message.hasOwnProperty("deployPolicyUid")) + if (!$util.isString(message.deployPolicyUid)) + return "deployPolicyUid: string expected"; + if (message.allowed != null && message.hasOwnProperty("allowed")) + if (typeof message.allowed !== "boolean") + return "allowed: boolean expected"; + if (message.verdict != null && message.hasOwnProperty("verdict")) + switch (message.verdict) { + default: + return "verdict: enum value expected"; case 0: case 1: - case 3: - case 4: - case 5: - case 6: - case 7: case 2: break; } + if (message.overrides != null && message.hasOwnProperty("overrides")) { + if (!Array.isArray(message.overrides)) + return "overrides: array expected"; + for (var i = 0; i < message.overrides.length; ++i) + switch (message.overrides[i]) { + default: + return "overrides: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } return null; }; /** - * Creates a DeliveryPipelineNotificationEvent message from a plain object. Also converts values to their respective internal types. + * Creates a DeployPolicyEvaluationEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static * @param {Object.} object Plain object - * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @returns {google.cloud.deploy.v1.DeployPolicyEvaluationEvent} DeployPolicyEvaluationEvent */ - DeliveryPipelineNotificationEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent) + DeployPolicyEvaluationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployPolicyEvaluationEvent) return object; - var message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + var message = new $root.google.cloud.deploy.v1.DeployPolicyEvaluationEvent(); if (object.message != null) message.message = String(object.message); + if (object.ruleType != null) + message.ruleType = String(object.ruleType); + if (object.rule != null) + message.rule = String(object.rule); if (object.pipelineUid != null) message.pipelineUid = String(object.pipelineUid); if (object.deliveryPipeline != null) message.deliveryPipeline = String(object.deliveryPipeline); - switch (object.type) { + if (object.targetUid != null) + message.targetUid = String(object.targetUid); + if (object.target != null) + message.target = String(object.target); + switch (object.invoker) { default: - if (typeof object.type === "number") { - message.type = object.type; + if (typeof object.invoker === "number") { + message.invoker = object.invoker; break; } break; - case "TYPE_UNSPECIFIED": + case "INVOKER_UNSPECIFIED": case 0: - message.type = 0; + message.invoker = 0; break; - case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case "USER": case 1: - message.type = 1; - break; - case "TYPE_RESOURCE_STATE_CHANGE": - case 3: - message.type = 3; + message.invoker = 1; break; - case "TYPE_PROCESS_ABORTED": - case 4: - message.type = 4; + case "DEPLOY_AUTOMATION": + case 2: + message.invoker = 2; break; - case "TYPE_RESTRICTION_VIOLATED": - case 5: - message.type = 5; + } + if (object.deployPolicy != null) + message.deployPolicy = String(object.deployPolicy); + if (object.deployPolicyUid != null) + message.deployPolicyUid = String(object.deployPolicyUid); + if (object.allowed != null) + message.allowed = Boolean(object.allowed); + switch (object.verdict) { + default: + if (typeof object.verdict === "number") { + message.verdict = object.verdict; + break; + } break; - case "TYPE_RESOURCE_DELETED": - case 6: - message.type = 6; + case "POLICY_VERDICT_UNSPECIFIED": + case 0: + message.verdict = 0; break; - case "TYPE_ROLLOUT_UPDATE": - case 7: - message.type = 7; + case "ALLOWED_BY_POLICY": + case 1: + message.verdict = 1; break; - case "TYPE_RENDER_STATUES_CHANGE": + case "DENIED_BY_POLICY": case 2: - message.type = 2; + message.verdict = 2; break; } + if (object.overrides) { + if (!Array.isArray(object.overrides)) + throw TypeError(".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.overrides: array expected"); + message.overrides = []; + for (var i = 0; i < object.overrides.length; ++i) + switch (object.overrides[i]) { + default: + if (typeof object.overrides[i] === "number") { + message.overrides[i] = object.overrides[i]; + break; + } + case "POLICY_VERDICT_OVERRIDE_UNSPECIFIED": + case 0: + message.overrides[i] = 0; + break; + case "POLICY_OVERRIDDEN": + case 1: + message.overrides[i] = 1; + break; + case "POLICY_SUSPENDED": + case 2: + message.overrides[i] = 2; + break; + } + } return message; }; /** - * Creates a plain object from a DeliveryPipelineNotificationEvent message. Also converts values to other types if specified. + * Creates a plain object from a DeployPolicyEvaluationEvent message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static - * @param {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent + * @param {google.cloud.deploy.v1.DeployPolicyEvaluationEvent} message DeployPolicyEvaluationEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeliveryPipelineNotificationEvent.toObject = function toObject(message, options) { + DeployPolicyEvaluationEvent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.overrides = []; if (options.defaults) { object.message = ""; - object.deliveryPipeline = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.ruleType = ""; + object.rule = ""; object.pipelineUid = ""; + object.deliveryPipeline = ""; + object.targetUid = ""; + object.target = ""; + object.invoker = options.enums === String ? "INVOKER_UNSPECIFIED" : 0; + object.deployPolicy = ""; + object.deployPolicyUid = ""; + object.allowed = false; + object.verdict = options.enums === String ? "POLICY_VERDICT_UNSPECIFIED" : 0; } if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; - if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) - object.deliveryPipeline = message.deliveryPipeline; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] === undefined ? message.type : $root.google.cloud.deploy.v1.Type[message.type] : message.type; + if (message.ruleType != null && message.hasOwnProperty("ruleType")) + object.ruleType = message.ruleType; + if (message.rule != null && message.hasOwnProperty("rule")) + object.rule = message.rule; if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) object.pipelineUid = message.pipelineUid; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = message.deliveryPipeline; + if (message.targetUid != null && message.hasOwnProperty("targetUid")) + object.targetUid = message.targetUid; + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.invoker != null && message.hasOwnProperty("invoker")) + object.invoker = options.enums === String ? $root.google.cloud.deploy.v1.DeployPolicy.Invoker[message.invoker] === undefined ? message.invoker : $root.google.cloud.deploy.v1.DeployPolicy.Invoker[message.invoker] : message.invoker; + if (message.deployPolicy != null && message.hasOwnProperty("deployPolicy")) + object.deployPolicy = message.deployPolicy; + if (message.deployPolicyUid != null && message.hasOwnProperty("deployPolicyUid")) + object.deployPolicyUid = message.deployPolicyUid; + if (message.allowed != null && message.hasOwnProperty("allowed")) + object.allowed = message.allowed; + if (message.verdict != null && message.hasOwnProperty("verdict")) + object.verdict = options.enums === String ? $root.google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict[message.verdict] === undefined ? message.verdict : $root.google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict[message.verdict] : message.verdict; + if (message.overrides && message.overrides.length) { + object.overrides = []; + for (var j = 0; j < message.overrides.length; ++j) + object.overrides[j] = options.enums === String ? $root.google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride[message.overrides[j]] === undefined ? message.overrides[j] : $root.google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride[message.overrides[j]] : message.overrides[j]; + } return object; }; /** - * Converts this DeliveryPipelineNotificationEvent to JSON. + * Converts this DeployPolicyEvaluationEvent to JSON. * @function toJSON - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @instance * @returns {Object.} JSON object */ - DeliveryPipelineNotificationEvent.prototype.toJSON = function toJSON() { + DeployPolicyEvaluationEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeliveryPipelineNotificationEvent + * Gets the default type url for DeployPolicyEvaluationEvent * @function getTypeUrl - * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @memberof google.cloud.deploy.v1.DeployPolicyEvaluationEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeliveryPipelineNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeployPolicyEvaluationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"; + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"; }; - return DeliveryPipelineNotificationEvent; + /** + * PolicyVerdict enum. + * @name google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict + * @enum {number} + * @property {number} POLICY_VERDICT_UNSPECIFIED=0 POLICY_VERDICT_UNSPECIFIED value + * @property {number} ALLOWED_BY_POLICY=1 ALLOWED_BY_POLICY value + * @property {number} DENIED_BY_POLICY=2 DENIED_BY_POLICY value + */ + DeployPolicyEvaluationEvent.PolicyVerdict = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLICY_VERDICT_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOWED_BY_POLICY"] = 1; + values[valuesById[2] = "DENIED_BY_POLICY"] = 2; + return values; + })(); + + /** + * PolicyVerdictOverride enum. + * @name google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride + * @enum {number} + * @property {number} POLICY_VERDICT_OVERRIDE_UNSPECIFIED=0 POLICY_VERDICT_OVERRIDE_UNSPECIFIED value + * @property {number} POLICY_OVERRIDDEN=1 POLICY_OVERRIDDEN value + * @property {number} POLICY_SUSPENDED=2 POLICY_SUSPENDED value + */ + DeployPolicyEvaluationEvent.PolicyVerdictOverride = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLICY_VERDICT_OVERRIDE_UNSPECIFIED"] = 0; + values[valuesById[1] = "POLICY_OVERRIDDEN"] = 1; + values[valuesById[2] = "POLICY_SUSPENDED"] = 2; + return values; + })(); + + return DeployPolicyEvaluationEvent; })(); v1.DeployPolicyNotificationEvent = (function() { @@ -45964,6 +51967,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -46023,6 +52027,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -46376,6 +52384,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -46445,6 +52454,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -46741,6 +52754,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -46802,6 +52816,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -47083,6 +53101,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -47152,6 +53171,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -47514,6 +53537,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -47581,6 +53605,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -47925,6 +53953,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -48010,6 +54039,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -48369,6 +54402,7 @@ case 5: case 6: case 7: + case 8: case 2: break; } @@ -48426,6 +54460,10 @@ case 7: message.type = 7; break; + case "TYPE_DEPLOY_POLICY_EVALUATION": + case 8: + message.type = 8; + break; case "TYPE_RENDER_STATUES_CHANGE": case 2: message.type = 2; @@ -69937,6 +75975,305 @@ return Date; })(); + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hours = reader.int32(); + break; + } + case 2: { + message.minutes = reader.int32(); + break; + } + case 3: { + message.seconds = reader.int32(); + break; + } + case 4: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeOfDay + * @function getTypeUrl + * @memberof google.type.TimeOfDay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeOfDay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeOfDay"; + }; + + return TimeOfDay; + })(); + return type; })(); diff --git a/packages/google-cloud-deploy/protos/protos.json b/packages/google-cloud-deploy/protos/protos.json index 61e466165ca..c9a3da937f3 100644 --- a/packages/google-cloud-deploy/protos/protos.json +++ b/packages/google-cloud-deploy/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { @@ -50,6 +53,7 @@ "TYPE_RESTRICTION_VIOLATED": 5, "TYPE_RESOURCE_DELETED": 6, "TYPE_ROLLOUT_UPDATE": 7, + "TYPE_DEPLOY_POLICY_EVALUATION": 8, "TYPE_RENDER_STATUES_CHANGE": 2 } }, @@ -549,6 +553,124 @@ } ] }, + "CreateDeployPolicy": { + "requestType": "CreateDeployPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/deployPolicies", + "(google.api.http).body": "deploy_policy", + "(google.api.method_signature)": "parent,deploy_policy,deploy_policy_id", + "(google.longrunning.operation_info).response_type": "DeployPolicy", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/deployPolicies", + "body": "deploy_policy" + } + }, + { + "(google.api.method_signature)": "parent,deploy_policy,deploy_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployPolicy", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateDeployPolicy": { + "requestType": "UpdateDeployPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{deploy_policy.name=projects/*/locations/*/deployPolicies/*}", + "(google.api.http).body": "deploy_policy", + "(google.api.method_signature)": "deploy_policy,update_mask", + "(google.longrunning.operation_info).response_type": "DeployPolicy", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{deploy_policy.name=projects/*/locations/*/deployPolicies/*}", + "body": "deploy_policy" + } + }, + { + "(google.api.method_signature)": "deploy_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployPolicy", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteDeployPolicy": { + "requestType": "DeleteDeployPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/deployPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/deployPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListDeployPolicies": { + "requestType": "ListDeployPoliciesRequest", + "responseType": "ListDeployPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/deployPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/deployPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeployPolicy": { + "requestType": "GetDeployPolicyRequest", + "responseType": "DeployPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deployPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deployPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "ApproveRollout": { "requestType": "ApproveRolloutRequest", "responseType": "ApproveRolloutResponse", @@ -1739,6 +1861,15 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -2681,6 +2812,121 @@ } } }, + "DeployPolicy": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/DeployPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deployPolicies/{deploy_policy}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "suspended": { + "type": "bool", + "id": 8 + }, + "selectors": { + "rule": "repeated", + "type": "DeployPolicyResourceSelector", + "id": 12, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rules": { + "rule": "repeated", + "type": "PolicyRule", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 11 + } + }, + "nested": { + "Invoker": { + "values": { + "INVOKER_UNSPECIFIED": 0, + "USER": 1, + "DEPLOY_AUTOMATION": 2 + } + } + } + }, + "DeployPolicyResourceSelector": { + "fields": { + "deliveryPipeline": { + "type": "DeliveryPipelineAttribute", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "target": { + "type": "TargetAttribute", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeliveryPipelineAttribute": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, "TargetAttribute": { "fields": { "id": { @@ -2694,6 +2940,180 @@ } } }, + "PolicyRule": { + "oneofs": { + "rule": { + "oneof": [ + "rolloutRestriction" + ] + } + }, + "fields": { + "rolloutRestriction": { + "type": "RolloutRestriction", + "id": 2 + } + } + }, + "RolloutRestriction": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "invokers": { + "rule": "repeated", + "type": "DeployPolicy.Invoker", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "actions": { + "rule": "repeated", + "type": "RolloutActions", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeWindows": { + "type": "TimeWindows", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RolloutActions": { + "values": { + "ROLLOUT_ACTIONS_UNSPECIFIED": 0, + "ADVANCE": 1, + "APPROVE": 2, + "CANCEL": 3, + "CREATE": 4, + "IGNORE_JOB": 5, + "RETRY_JOB": 6, + "ROLLBACK": 7, + "TERMINATE_JOBRUN": 8 + } + } + } + }, + "TimeWindows": { + "fields": { + "timeZone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "oneTimeWindows": { + "rule": "repeated", + "type": "OneTimeWindow", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "weeklyWindows": { + "rule": "repeated", + "type": "WeeklyWindow", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OneTimeWindow": { + "fields": { + "startDate": { + "type": "google.type.Date", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endDate": { + "type": "google.type.Date", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endTime": { + "type": "google.type.TimeOfDay", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WeeklyWindow": { + "fields": { + "daysOfWeek": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endTime": { + "type": "google.type.TimeOfDay", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PolicyViolation": { + "fields": { + "policyViolationDetails": { + "rule": "repeated", + "type": "PolicyViolationDetails", + "id": 1 + } + } + }, + "PolicyViolationDetails": { + "fields": { + "policy": { + "type": "string", + "id": 1 + }, + "ruleId": { + "type": "string", + "id": 2 + }, + "failureMessage": { + "type": "string", + "id": 3 + } + } + }, "Release": { "options": { "(google.api.resource).type": "clouddeploy.googleapis.com/Release", @@ -2910,44 +3330,221 @@ } } }, - "ReleaseReadyCondition": { - "fields": { - "status": { - "type": "bool", - "id": 1 - } + "ReleaseReadyCondition": { + "fields": { + "status": { + "type": "bool", + "id": 1 + } + } + }, + "SkaffoldSupportedCondition": { + "fields": { + "status": { + "type": "bool", + "id": 1 + }, + "skaffoldSupportState": { + "type": "SkaffoldSupportState", + "id": 2 + }, + "maintenanceModeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "supportExpirationTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "ReleaseCondition": { + "fields": { + "releaseReadyCondition": { + "type": "ReleaseReadyCondition", + "id": 1 + }, + "skaffoldSupportedCondition": { + "type": "SkaffoldSupportedCondition", + "id": 2 + } + } + } + } + }, + "CreateDeployPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/DeployPolicy" + } + }, + "deployPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deployPolicy": { + "type": "DeployPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateDeployPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deployPolicy": { + "type": "DeployPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteDeployPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } }, - "SkaffoldSupportedCondition": { - "fields": { - "status": { - "type": "bool", - "id": 1 - }, - "skaffoldSupportState": { - "type": "SkaffoldSupportState", - "id": 2 - }, - "maintenanceModeTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "supportExpirationTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } + "allowMissing": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } }, - "ReleaseCondition": { - "fields": { - "releaseReadyCondition": { - "type": "ReleaseReadyCondition", - "id": 1 - }, - "skaffoldSupportedCondition": { - "type": "SkaffoldSupportedCondition", - "id": 2 - } + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeployPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/DeployPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListDeployPoliciesResponse": { + "fields": { + "deployPolicies": { + "rule": "repeated", + "type": "DeployPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDeployPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" } } } @@ -3187,6 +3784,15 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -3877,6 +4483,15 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } + }, "startingPhaseId": { "type": "string", "id": 7, @@ -3955,6 +4570,15 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -3977,6 +4601,15 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -3992,6 +4625,15 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -4021,6 +4663,15 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -4050,6 +4701,15 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -4502,6 +5162,15 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "clouddeploy.googleapis.com/JobRun" } + }, + "overrideDeployPolicy": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeployPolicy" + } } } }, @@ -5064,6 +5733,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "policyViolation": { + "type": "PolicyViolation", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "expireTime": { "type": "google.protobuf.Timestamp", "id": 11, @@ -5480,6 +6156,79 @@ } } }, + "DeployPolicyEvaluationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "ruleType": { + "type": "string", + "id": 2 + }, + "rule": { + "type": "string", + "id": 3 + }, + "pipelineUid": { + "type": "string", + "id": 4 + }, + "deliveryPipeline": { + "type": "string", + "id": 5 + }, + "targetUid": { + "type": "string", + "id": 6 + }, + "target": { + "type": "string", + "id": 7 + }, + "invoker": { + "type": "DeployPolicy.Invoker", + "id": 8 + }, + "deployPolicy": { + "type": "string", + "id": 9 + }, + "deployPolicyUid": { + "type": "string", + "id": 10 + }, + "allowed": { + "type": "bool", + "id": 11 + }, + "verdict": { + "type": "PolicyVerdict", + "id": 12 + }, + "overrides": { + "rule": "repeated", + "type": "PolicyVerdictOverride", + "id": 13 + } + }, + "nested": { + "PolicyVerdict": { + "values": { + "POLICY_VERDICT_UNSPECIFIED": 0, + "ALLOWED_BY_POLICY": 1, + "DENIED_BY_POLICY": 2 + } + }, + "PolicyVerdictOverride": { + "values": { + "POLICY_VERDICT_OVERRIDE_UNSPECIFIED": 0, + "POLICY_OVERRIDDEN": 1, + "POLICY_SUSPENDED": 2 + } + } + } + }, "DeployPolicyNotificationEvent": { "fields": { "message": { @@ -7765,9 +8514,9 @@ "type": { "options": { "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", "java_multiple_files": true, - "java_outer_classname": "DateProto", + "java_outer_classname": "TimeOfDayProto", "java_package": "com.google.type", "objc_class_prefix": "GTP" }, @@ -7787,6 +8536,38 @@ "id": 3 } } + }, + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "id": 4 + } + } } } } diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js index 276c7ac70b3..495815ab1ff 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js @@ -37,6 +37,11 @@ function main(name, phaseId) { * Required. The phase ID to advance the `Rollout` to. */ // const phaseId = 'abc123' + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js index 11addc2faff..e13fab6af2a 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js @@ -37,6 +37,11 @@ function main(name, approved) { * Required. True = approve; false = reject */ // const approved = true + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js index b827e91ce43..a0d48f083e0 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js @@ -33,6 +33,11 @@ function main(name) { * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. */ // const name = 'abc123' + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js index 0e711ff7005..b32cf68f1aa 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js @@ -61,6 +61,11 @@ function main(parent, releaseId, release) { * with an expected result, but no actual change is made. */ // const validateOnly = true + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js index fae7a0fe5ab..d190ba2179c 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js @@ -61,6 +61,11 @@ function main(parent, rolloutId, rollout) { * with an expected result, but no actual change is made. */ // const validateOnly = true + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] /** * Optional. The starting phase ID for the `Rollout`. If empty the `Rollout` * will start at the first phase. diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.ignore_job.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.ignore_job.js index 4642c56280a..00449f012ba 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.ignore_job.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.ignore_job.js @@ -41,6 +41,11 @@ function main(rollout, phaseId, jobId) { * Required. The job ID for the Job to ignore. */ // const jobId = 'abc123' + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js index 44e42ef6c5e..bfce30f12f6 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js @@ -41,6 +41,11 @@ function main(rollout, phaseId, jobId) { * Required. The job ID for the Job to retry. */ // const jobId = 'abc123' + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.rollback_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.rollback_target.js index d520166a662..d11a209d745 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.rollback_target.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.rollback_target.js @@ -62,6 +62,11 @@ function main(name, targetId, rolloutId) { * with a `RollbackTargetResponse`. */ // const validateOnly = true + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js index 1e110431ead..00385692071 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js @@ -33,6 +33,11 @@ function main(name) { * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. */ // const name = 'abc123' + /** + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + */ + // const overrideDeployPolicy = ['abc','def'] // Imports the Deploy library const {CloudDeployClient} = require('@google-cloud/deploy').v1; diff --git a/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata_google.cloud.deploy.v1.json b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata_google.cloud.deploy.v1.json index c2e4b087697..74684abc379 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata_google.cloud.deploy.v1.json +++ b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata_google.cloud.deploy.v1.json @@ -346,7 +346,7 @@ "segments": [ { "start": 25, - "end": 85, + "end": 90, "type": "FULL" } ], @@ -382,6 +382,10 @@ { "name": "validate_only", "type": "TYPE_BOOL" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.cloud.deploy.v1.RollbackTargetResponse", @@ -978,7 +982,7 @@ "segments": [ { "start": 25, - "end": 85, + "end": 90, "type": "FULL" } ], @@ -1006,6 +1010,10 @@ { "name": "validate_only", "type": "TYPE_BOOL" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.longrunning.Operation", @@ -1063,6 +1071,270 @@ } } }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateDeployPolicy_async", + "title": "CloudDeploy createDeployPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new DeployPolicy in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_deploy_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateDeployPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deploy_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "deploy_policy", + "type": ".google.cloud.deploy.v1.DeployPolicy" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateDeployPolicy", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_UpdateDeployPolicy_async", + "title": "CloudDeploy updateDeployPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single DeployPolicy.", + "canonical": true, + "file": "cloud_deploy.update_deploy_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateDeployPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "deploy_policy", + "type": ".google.cloud.deploy.v1.DeployPolicy" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "UpdateDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateDeployPolicy", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_DeleteDeployPolicy_async", + "title": "CloudDeploy deleteDeployPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single DeployPolicy.", + "canonical": true, + "file": "cloud_deploy.delete_deploy_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteDeployPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "DeleteDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteDeployPolicy", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListDeployPolicies_async", + "title": "CloudDeploy listDeployPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists DeployPolicies in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_deploy_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeployPolicies", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListDeployPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.ListDeployPoliciesResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListDeployPolicies", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListDeployPolicies", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetDeployPolicy_async", + "title": "CloudDeploy getDeployPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single DeployPolicy.", + "canonical": true, + "file": "cloud_deploy.get_deploy_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetDeployPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.DeployPolicy", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetDeployPolicy", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetDeployPolicy", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, { "regionTag": "clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async", "title": "CloudDeploy approveRollout Sample", @@ -1074,7 +1346,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 64, "type": "FULL" } ], @@ -1090,6 +1362,10 @@ { "name": "approved", "type": "TYPE_BOOL" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.cloud.deploy.v1.ApproveRolloutResponse", @@ -1118,7 +1394,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 64, "type": "FULL" } ], @@ -1134,6 +1410,10 @@ { "name": "phase_id", "type": "TYPE_STRING" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.cloud.deploy.v1.AdvanceRolloutResponse", @@ -1162,7 +1442,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 59, "type": "FULL" } ], @@ -1174,6 +1454,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.cloud.deploy.v1.CancelRolloutResponse", @@ -1298,7 +1582,7 @@ "segments": [ { "start": 25, - "end": 90, + "end": 95, "type": "FULL" } ], @@ -1327,6 +1611,10 @@ "name": "validate_only", "type": "TYPE_BOOL" }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" + }, { "name": "starting_phase_id", "type": "TYPE_STRING" @@ -1358,7 +1646,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 69, "type": "FULL" } ], @@ -1378,6 +1666,10 @@ { "name": "job_id", "type": "TYPE_STRING" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.cloud.deploy.v1.IgnoreJobResponse", @@ -1406,7 +1698,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 69, "type": "FULL" } ], @@ -1426,6 +1718,10 @@ { "name": "job_id", "type": "TYPE_STRING" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.cloud.deploy.v1.RetryJobResponse", @@ -1550,7 +1846,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 59, "type": "FULL" } ], @@ -1562,6 +1858,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "override_deploy_policy", + "type": "TYPE_STRING[]" } ], "resultType": ".google.cloud.deploy.v1.TerminateJobRunResponse", diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts index 253665ad168..6ec9b4b759d 100644 --- a/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts @@ -236,6 +236,9 @@ export class CloudDeployClient { deliveryPipelinePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}' ), + deployPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployPolicies/{deploy_policy}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -292,6 +295,11 @@ export class CloudDeployClient { 'nextPageToken', 'releases' ), + listDeployPolicies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'deployPolicies' + ), listRollouts: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -453,6 +461,24 @@ export class CloudDeployClient { const createReleaseMetadata = protoFilesRoot.lookup( '.google.cloud.deploy.v1.OperationMetadata' ) as gax.protobuf.Type; + const createDeployPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.DeployPolicy' + ) as gax.protobuf.Type; + const createDeployPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateDeployPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.DeployPolicy' + ) as gax.protobuf.Type; + const updateDeployPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteDeployPolicyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDeployPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; const createRolloutResponse = protoFilesRoot.lookup( '.google.cloud.deploy.v1.Rollout' ) as gax.protobuf.Type; @@ -553,6 +579,21 @@ export class CloudDeployClient { createReleaseResponse.decode.bind(createReleaseResponse), createReleaseMetadata.decode.bind(createReleaseMetadata) ), + createDeployPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDeployPolicyResponse.decode.bind(createDeployPolicyResponse), + createDeployPolicyMetadata.decode.bind(createDeployPolicyMetadata) + ), + updateDeployPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDeployPolicyResponse.decode.bind(updateDeployPolicyResponse), + updateDeployPolicyMetadata.decode.bind(updateDeployPolicyMetadata) + ), + deleteDeployPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDeployPolicyResponse.decode.bind(deleteDeployPolicyResponse), + deleteDeployPolicyMetadata.decode.bind(deleteDeployPolicyMetadata) + ), createRollout: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createRolloutResponse.decode.bind(createRolloutResponse), @@ -645,6 +686,11 @@ export class CloudDeployClient { 'getRelease', 'createRelease', 'abandonRelease', + 'createDeployPolicy', + 'updateDeployPolicy', + 'deleteDeployPolicy', + 'listDeployPolicies', + 'getDeployPolicy', 'approveRollout', 'advanceRollout', 'cancelRollout', @@ -898,6 +944,9 @@ export class CloudDeployClient { * @param {boolean} [request.validateOnly] * Optional. If set to true, the request is validated and the user is provided * with a `RollbackTargetResponse`. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1317,6 +1366,91 @@ export class CloudDeployClient { this.initialize(); return this.innerApiCalls.abandonRelease(request, options, callback); } + /** + * Gets details of a single DeployPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `DeployPolicy`. Format must be + * `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.deploy.v1.DeployPolicy|DeployPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.get_deploy_policy.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetDeployPolicy_async + */ + getDeployPolicy( + request?: protos.google.cloud.deploy.v1.IGetDeployPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeployPolicy, + protos.google.cloud.deploy.v1.IGetDeployPolicyRequest | undefined, + {} | undefined, + ] + >; + getDeployPolicy( + request: protos.google.cloud.deploy.v1.IGetDeployPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IDeployPolicy, + protos.google.cloud.deploy.v1.IGetDeployPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getDeployPolicy( + request: protos.google.cloud.deploy.v1.IGetDeployPolicyRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IDeployPolicy, + protos.google.cloud.deploy.v1.IGetDeployPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getDeployPolicy( + request?: protos.google.cloud.deploy.v1.IGetDeployPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IDeployPolicy, + | protos.google.cloud.deploy.v1.IGetDeployPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IDeployPolicy, + protos.google.cloud.deploy.v1.IGetDeployPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeployPolicy, + protos.google.cloud.deploy.v1.IGetDeployPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getDeployPolicy(request, options, callback); + } /** * Approves a Rollout. * @@ -1327,6 +1461,9 @@ export class CloudDeployClient { * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @param {boolean} request.approved * Required. True = approve; false = reject + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1414,6 +1551,9 @@ export class CloudDeployClient { * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @param {string} request.phaseId * Required. The phase ID to advance the `Rollout` to. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1499,6 +1639,9 @@ export class CloudDeployClient { * @param {string} request.name * Required. Name of the Rollout. Format is * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1671,6 +1814,9 @@ export class CloudDeployClient { * Required. The phase ID the Job to ignore belongs to. * @param {string} request.jobId * Required. The job ID for the Job to ignore. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1758,6 +1904,9 @@ export class CloudDeployClient { * Required. The phase ID the Job to retry belongs to. * @param {string} request.jobId * Required. The job ID for the Job to retry. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1924,6 +2073,9 @@ export class CloudDeployClient { * @param {string} request.name * Required. Name of the `JobRun`. Format must be * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3850,6 +4002,9 @@ export class CloudDeployClient { * @param {boolean} [request.validateOnly] * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3980,18 +4135,17 @@ export class CloudDeployClient { >; } /** - * Creates a new Rollout in a given project and location. + * Creates a new DeployPolicy in a given project and location. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent collection in which the `Rollout` must be created. - * The format is - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. - * @param {string} request.rolloutId - * Required. ID of the `Rollout`. - * @param {google.cloud.deploy.v1.Rollout} request.rollout - * Required. The `Rollout` to create. + * Required. The parent collection in which the `DeployPolicy` must be + * created. The format is `projects/{project_id}/locations/{location_name}`. + * @param {string} request.deployPolicyId + * Required. ID of the `DeployPolicy`. + * @param {google.cloud.deploy.v1.DeployPolicy} request.deployPolicy + * Required. The `DeployPolicy` to create. * @param {string} [request.requestId] * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -4009,9 +4163,6 @@ export class CloudDeployClient { * @param {boolean} [request.validateOnly] * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. - * @param {string} [request.startingPhaseId] - * Optional. The starting phase ID for the `Rollout`. If empty the `Rollout` - * will start at the first phase. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -4020,52 +4171,52 @@ export class CloudDeployClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/cloud_deploy.create_rollout.js - * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async + * @example include:samples/generated/v1/cloud_deploy.create_deploy_policy.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateDeployPolicy_async */ - createRollout( - request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + createDeployPolicy( + request?: protos.google.cloud.deploy.v1.ICreateDeployPolicyRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined, ] >; - createRollout( - request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + createDeployPolicy( + request: protos.google.cloud.deploy.v1.ICreateDeployPolicyRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createRollout( - request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + createDeployPolicy( + request: protos.google.cloud.deploy.v1.ICreateDeployPolicyRequest, callback: Callback< LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createRollout( - request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + createDeployPolicy( + request?: protos.google.cloud.deploy.v1.ICreateDeployPolicyRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -4073,7 +4224,7 @@ export class CloudDeployClient { >, callback?: Callback< LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -4082,7 +4233,7 @@ export class CloudDeployClient { ): Promise< [ LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -4105,24 +4256,24 @@ export class CloudDeployClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createRollout(request, options, callback); + return this.innerApiCalls.createDeployPolicy(request, options, callback); } /** - * Check the status of the long running operation returned by `createRollout()`. + * Check the status of the long running operation returned by `createDeployPolicy()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/cloud_deploy.create_rollout.js - * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async + * @example include:samples/generated/v1/cloud_deploy.create_deploy_policy.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateDeployPolicy_async */ - async checkCreateRolloutProgress( + async checkCreateDeployPolicyProgress( name: string ): Promise< LROperation< - protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.v1.DeployPolicy, protos.google.cloud.deploy.v1.OperationMetadata > > { @@ -4133,27 +4284,27 @@ export class CloudDeployClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.createRollout, + this.descriptors.longrunning.createDeployPolicy, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.v1.DeployPolicy, protos.google.cloud.deploy.v1.OperationMetadata >; } /** - * Creates a new Automation in a given project and location. + * Updates the parameters of a single DeployPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent collection in which the `Automation` must be created. - * The format is - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. - * @param {string} request.automationId - * Required. ID of the `Automation`. - * @param {google.cloud.deploy.v1.Automation} request.automation - * Required. The `Automation` to create. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the `DeployPolicy` resource. The fields specified in the + * update_mask are relative to the resource, not the full request. A field + * will be overwritten if it's in the mask. If the user doesn't provide a mask + * then all fields are overwritten. + * @param {google.cloud.deploy.v1.DeployPolicy} request.deployPolicy + * Required. The `DeployPolicy` to update. * @param {string} [request.requestId] * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -4168,6 +4319,9 @@ export class CloudDeployClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, updating a `DeployPolicy` that does not exist + * will result in the creation of a new `DeployPolicy`. * @param {boolean} [request.validateOnly] * Optional. If set to true, the request is validated and the user is provided * with an expected result, but no actual change is made. @@ -4179,52 +4333,52 @@ export class CloudDeployClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/cloud_deploy.create_automation.js - * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateAutomation_async + * @example include:samples/generated/v1/cloud_deploy.update_deploy_policy.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateDeployPolicy_async */ - createAutomation( - request?: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + updateDeployPolicy( + request?: protos.google.cloud.deploy.v1.IUpdateDeployPolicyRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined, ] >; - createAutomation( - request: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + updateDeployPolicy( + request: protos.google.cloud.deploy.v1.IUpdateDeployPolicyRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createAutomation( - request: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + updateDeployPolicy( + request: protos.google.cloud.deploy.v1.IUpdateDeployPolicyRequest, callback: Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createAutomation( - request?: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + updateDeployPolicy( + request?: protos.google.cloud.deploy.v1.IUpdateDeployPolicyRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -4232,7 +4386,7 @@ export class CloudDeployClient { >, callback?: Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -4241,7 +4395,7 @@ export class CloudDeployClient { ): Promise< [ LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -4261,27 +4415,27 @@ export class CloudDeployClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + 'deploy_policy.name': request.deployPolicy!.name ?? '', }); this.initialize(); - return this.innerApiCalls.createAutomation(request, options, callback); + return this.innerApiCalls.updateDeployPolicy(request, options, callback); } /** - * Check the status of the long running operation returned by `createAutomation()`. + * Check the status of the long running operation returned by `updateDeployPolicy()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/cloud_deploy.create_automation.js - * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateAutomation_async + * @example include:samples/generated/v1/cloud_deploy.update_deploy_policy.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateDeployPolicy_async */ - async checkCreateAutomationProgress( + async checkUpdateDeployPolicyProgress( name: string ): Promise< LROperation< - protos.google.cloud.deploy.v1.Automation, + protos.google.cloud.deploy.v1.DeployPolicy, protos.google.cloud.deploy.v1.OperationMetadata > > { @@ -4292,27 +4446,22 @@ export class CloudDeployClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.createAutomation, + this.descriptors.longrunning.updateDeployPolicy, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.deploy.v1.Automation, + protos.google.cloud.deploy.v1.DeployPolicy, protos.google.cloud.deploy.v1.OperationMetadata >; } /** - * Updates the parameters of a single Automation resource. + * Deletes a single DeployPolicy. * * @param {Object} request * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten by the - * update in the `Automation` resource. The fields specified in the - * update_mask are relative to the resource, not the full request. A field - * will be overwritten if it's in the mask. If the user doesn't provide a mask - * then all fields are overwritten. - * @param {google.cloud.deploy.v1.Automation} request.automation - * Required. The `Automation` to update. + * @param {string} request.name + * Required. The name of the `DeployPolicy` to delete. The format is + * `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`. * @param {string} [request.requestId] * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -4328,11 +4477,15 @@ export class CloudDeployClient { * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.allowMissing] - * Optional. If set to true, updating a `Automation` that does not exist will - * result in the creation of a new `Automation`. + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeployPolicy` will succeed. * @param {boolean} [request.validateOnly] - * Optional. If set to true, the request is validated and the user is provided - * with an expected result, but no actual change is made. + * Optional. If set, validate the request and preview the review, but do not + * actually post it. + * @param {string} [request.etag] + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -4341,52 +4494,52 @@ export class CloudDeployClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/cloud_deploy.update_automation.js - * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateAutomation_async + * @example include:samples/generated/v1/cloud_deploy.delete_deploy_policy.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteDeployPolicy_async */ - updateAutomation( - request?: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + deleteDeployPolicy( + request?: protos.google.cloud.deploy.v1.IDeleteDeployPolicyRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined, ] >; - updateAutomation( - request: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + deleteDeployPolicy( + request: protos.google.cloud.deploy.v1.IDeleteDeployPolicyRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - updateAutomation( - request: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + deleteDeployPolicy( + request: protos.google.cloud.deploy.v1.IDeleteDeployPolicyRequest, callback: Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - updateAutomation( - request?: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + deleteDeployPolicy( + request?: protos.google.cloud.deploy.v1.IDeleteDeployPolicyRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -4394,7 +4547,7 @@ export class CloudDeployClient { >, callback?: Callback< LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -4403,7 +4556,7 @@ export class CloudDeployClient { ): Promise< [ LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -4423,27 +4576,27 @@ export class CloudDeployClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'automation.name': request.automation!.name ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAutomation(request, options, callback); + return this.innerApiCalls.deleteDeployPolicy(request, options, callback); } /** - * Check the status of the long running operation returned by `updateAutomation()`. + * Check the status of the long running operation returned by `deleteDeployPolicy()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/cloud_deploy.update_automation.js - * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateAutomation_async + * @example include:samples/generated/v1/cloud_deploy.delete_deploy_policy.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteDeployPolicy_async */ - async checkUpdateAutomationProgress( + async checkDeleteDeployPolicyProgress( name: string ): Promise< LROperation< - protos.google.cloud.deploy.v1.Automation, + protos.google.protobuf.Empty, protos.google.cloud.deploy.v1.OperationMetadata > > { @@ -4454,22 +4607,27 @@ export class CloudDeployClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.updateAutomation, + this.descriptors.longrunning.deleteDeployPolicy, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.deploy.v1.Automation, + protos.google.protobuf.Empty, protos.google.cloud.deploy.v1.OperationMetadata >; } /** - * Deletes a single Automation resource. + * Creates a new Rollout in a given project and location. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. The name of the `Automation` to delete. The format is - * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. + * @param {string} request.parent + * Required. The parent collection in which the `Rollout` must be created. + * The format is + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. + * @param {string} request.rolloutId + * Required. ID of the `Rollout`. + * @param {google.cloud.deploy.v1.Rollout} request.rollout + * Required. The `Rollout` to create. * @param {string} [request.requestId] * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server knows to ignore the @@ -4484,17 +4642,15 @@ export class CloudDeployClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.allowMissing] - * Optional. If set to true, then deleting an already deleted or non-existing - * `Automation` will succeed. * @param {boolean} [request.validateOnly] - * Optional. If set, validate the request and verify whether the resource - * exists, but do not actually post it. - * @param {string} [request.etag] - * Optional. The weak etag of the request. - * This checksum is computed by the server based on the value of other - * fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * @param {string[]} [request.overrideDeployPolicy] + * Optional. Deploy policies to override. Format is + * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. + * @param {string} [request.startingPhaseId] + * Optional. The starting phase ID for the `Rollout`. If empty the `Rollout` + * will start at the first phase. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -4503,37 +4659,520 @@ export class CloudDeployClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/cloud_deploy.delete_automation.js - * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteAutomation_async + * @example include:samples/generated/v1/cloud_deploy.create_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async */ - deleteAutomation( - request?: protos.google.cloud.deploy.v1.IDeleteAutomationRequest, + createRollout( + request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IRollout, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined, ] >; - deleteAutomation( - request: protos.google.cloud.deploy.v1.IDeleteAutomationRequest, + createRollout( + request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IRollout, protos.google.cloud.deploy.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteAutomation( - request: protos.google.cloud.deploy.v1.IDeleteAutomationRequest, - callback: Callback< + createRollout( + request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRollout( + request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createRollout(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRollout()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async + */ + async checkCreateRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createRollout, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Creates a new Automation in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `Automation` must be created. + * The format is + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * @param {string} request.automationId + * Required. ID of the `Automation`. + * @param {google.cloud.deploy.v1.Automation} request.automation + * Required. The `Automation` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server knows to ignore the + * request if it has already been completed. The server guarantees that for + * at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * 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). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_automation.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateAutomation_async + */ + createAutomation( + request?: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createAutomation( + request: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createAutomation( + request: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createAutomation( + request?: protos.google.cloud.deploy.v1.ICreateAutomationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createAutomation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createAutomation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_automation.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateAutomation_async + */ + async checkCreateAutomationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Automation, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createAutomation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Automation, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Automation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the `Automation` resource. The fields specified in the + * update_mask are relative to the resource, not the full request. A field + * will be overwritten if it's in the mask. If the user doesn't provide a mask + * then all fields are overwritten. + * @param {google.cloud.deploy.v1.Automation} request.automation + * Required. The `Automation` to update. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server knows to ignore the + * request if it has already been completed. The server guarantees that for + * at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * 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). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, updating a `Automation` that does not exist will + * result in the creation of a new `Automation`. + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.update_automation.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateAutomation_async + */ + updateAutomation( + request?: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateAutomation( + request: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateAutomation( + request: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateAutomation( + request?: protos.google.cloud.deploy.v1.IUpdateAutomationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'automation.name': request.automation!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAutomation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateAutomation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.update_automation.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateAutomation_async + */ + async checkUpdateAutomationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Automation, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateAutomation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Automation, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Deletes a single Automation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Automation` to delete. The format is + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server knows to ignore the + * request if it has already been completed. The server guarantees that for + * at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * 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). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, then deleting an already deleted or non-existing + * `Automation` will succeed. + * @param {boolean} [request.validateOnly] + * Optional. If set, validate the request and verify whether the resource + * exists, but do not actually post it. + * @param {string} [request.etag] + * Optional. The weak etag of the request. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.delete_automation.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteAutomation_async + */ + deleteAutomation( + request?: protos.google.cloud.deploy.v1.IDeleteAutomationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteAutomation( + request: protos.google.cloud.deploy.v1.IDeleteAutomationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteAutomation( + request: protos.google.cloud.deploy.v1.IDeleteAutomationRequest, + callback: Callback< LROperation< protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata @@ -5519,6 +6158,231 @@ export class CloudDeployClient { callSettings ) as AsyncIterable; } + /** + * Lists DeployPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deploy policies. Format + * must be `projects/{project_id}/locations/{location_name}`. + * @param {number} request.pageSize + * The maximum number of deploy policies to return. The service may return + * fewer than this value. If unspecified, at most 50 deploy policies will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeployPolicies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter deploy policies to be returned. See https://google.aip.dev/160 for + * more details. All fields can be used in the filter. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.deploy.v1.DeployPolicy|DeployPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDeployPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDeployPolicies( + request?: protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeployPolicy[], + protos.google.cloud.deploy.v1.IListDeployPoliciesRequest | null, + protos.google.cloud.deploy.v1.IListDeployPoliciesResponse, + ] + >; + listDeployPolicies( + request: protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + | protos.google.cloud.deploy.v1.IListDeployPoliciesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeployPolicy + > + ): void; + listDeployPolicies( + request: protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + | protos.google.cloud.deploy.v1.IListDeployPoliciesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeployPolicy + > + ): void; + listDeployPolicies( + request?: protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + | protos.google.cloud.deploy.v1.IListDeployPoliciesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeployPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + | protos.google.cloud.deploy.v1.IListDeployPoliciesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeployPolicy + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeployPolicy[], + protos.google.cloud.deploy.v1.IListDeployPoliciesRequest | null, + protos.google.cloud.deploy.v1.IListDeployPoliciesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listDeployPolicies(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deploy policies. Format + * must be `projects/{project_id}/locations/{location_name}`. + * @param {number} request.pageSize + * The maximum number of deploy policies to return. The service may return + * fewer than this value. If unspecified, at most 50 deploy policies will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeployPolicies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter deploy policies to be returned. See https://google.aip.dev/160 for + * more details. All fields can be used in the filter. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.deploy.v1.DeployPolicy|DeployPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDeployPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDeployPoliciesStream( + request?: protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDeployPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployPolicies.createStream( + this.innerApiCalls.listDeployPolicies as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDeployPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deploy policies. Format + * must be `projects/{project_id}/locations/{location_name}`. + * @param {number} request.pageSize + * The maximum number of deploy policies to return. The service may return + * fewer than this value. If unspecified, at most 50 deploy policies will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeployPolicies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter deploy policies to be returned. See https://google.aip.dev/160 for + * more details. All fields can be used in the filter. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.deploy.v1.DeployPolicy|DeployPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.list_deploy_policies.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListDeployPolicies_async + */ + listDeployPoliciesAsync( + request?: protos.google.cloud.deploy.v1.IListDeployPoliciesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDeployPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployPolicies.asyncIterate( + this.innerApiCalls['listDeployPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } /** * Lists Rollouts in a given project and location. * @@ -7194,6 +8058,58 @@ export class CloudDeployClient { ).delivery_pipeline; } + /** + * Return a fully-qualified deployPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deploy_policy + * @returns {string} Resource name string. + */ + deployPolicyPath(project: string, location: string, deployPolicy: string) { + return this.pathTemplates.deployPolicyPathTemplate.render({ + project: project, + location: location, + deploy_policy: deployPolicy, + }); + } + + /** + * Parse the project from DeployPolicy resource. + * + * @param {string} deployPolicyName + * A fully-qualified path representing DeployPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeployPolicyName(deployPolicyName: string) { + return this.pathTemplates.deployPolicyPathTemplate.match(deployPolicyName) + .project; + } + + /** + * Parse the location from DeployPolicy resource. + * + * @param {string} deployPolicyName + * A fully-qualified path representing DeployPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeployPolicyName(deployPolicyName: string) { + return this.pathTemplates.deployPolicyPathTemplate.match(deployPolicyName) + .location; + } + + /** + * Parse the deploy_policy from DeployPolicy resource. + * + * @param {string} deployPolicyName + * A fully-qualified path representing DeployPolicy resource. + * @returns {string} A string representing the deploy_policy. + */ + matchDeployPolicyFromDeployPolicyName(deployPolicyName: string) { + return this.pathTemplates.deployPolicyPathTemplate.match(deployPolicyName) + .deploy_policy; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json b/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json index 98711c5f886..c4410a9be65 100644 --- a/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json @@ -131,6 +131,31 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "CreateDeployPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDeployPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDeployPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDeployPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDeployPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, "ApproveRollout": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json b/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json index 41ba774f5c9..1083c058a21 100644 --- a/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json @@ -4,6 +4,7 @@ "../../protos/google/cloud/deploy/v1/cloud_deploy.proto", "../../protos/google/cloud/deploy/v1/customtargettype_notification_payload.proto", "../../protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/deploypolicy_evaluation_payload.proto", "../../protos/google/cloud/deploy/v1/deploypolicy_notification_payload.proto", "../../protos/google/cloud/deploy/v1/jobrun_notification_payload.proto", "../../protos/google/cloud/deploy/v1/log_enums.proto", diff --git a/packages/google-cloud-deploy/src/v1/gapic_metadata.json b/packages/google-cloud-deploy/src/v1/gapic_metadata.json index 4c4a16782af..c33e07ea404 100644 --- a/packages/google-cloud-deploy/src/v1/gapic_metadata.json +++ b/packages/google-cloud-deploy/src/v1/gapic_metadata.json @@ -40,6 +40,11 @@ "abandonRelease" ] }, + "GetDeployPolicy": { + "methods": [ + "getDeployPolicy" + ] + }, "ApproveRollout": { "methods": [ "approveRollout" @@ -150,6 +155,21 @@ "createRelease" ] }, + "CreateDeployPolicy": { + "methods": [ + "createDeployPolicy" + ] + }, + "UpdateDeployPolicy": { + "methods": [ + "updateDeployPolicy" + ] + }, + "DeleteDeployPolicy": { + "methods": [ + "deleteDeployPolicy" + ] + }, "CreateRollout": { "methods": [ "createRollout" @@ -198,6 +218,13 @@ "listReleasesAsync" ] }, + "ListDeployPolicies": { + "methods": [ + "listDeployPolicies", + "listDeployPoliciesStream", + "listDeployPoliciesAsync" + ] + }, "ListRollouts": { "methods": [ "listRollouts", @@ -261,6 +288,11 @@ "abandonRelease" ] }, + "GetDeployPolicy": { + "methods": [ + "getDeployPolicy" + ] + }, "ApproveRollout": { "methods": [ "approveRollout" @@ -371,6 +403,21 @@ "createRelease" ] }, + "CreateDeployPolicy": { + "methods": [ + "createDeployPolicy" + ] + }, + "UpdateDeployPolicy": { + "methods": [ + "updateDeployPolicy" + ] + }, + "DeleteDeployPolicy": { + "methods": [ + "deleteDeployPolicy" + ] + }, "CreateRollout": { "methods": [ "createRollout" @@ -419,6 +466,13 @@ "listReleasesAsync" ] }, + "ListDeployPolicies": { + "methods": [ + "listDeployPolicies", + "listDeployPoliciesStream", + "listDeployPoliciesAsync" + ] + }, "ListRollouts": { "methods": [ "listRollouts", diff --git a/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts b/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts index 1fb5070487e..751049f9f3a 100644 --- a/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts +++ b/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts @@ -1120,6 +1120,136 @@ describe('v1.CloudDeployClient', () => { }); }); + describe('getDeployPolicy', () => { + it('invokes getDeployPolicy without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeployPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeployPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeployPolicy() + ); + client.innerApiCalls.getDeployPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployPolicy without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeployPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeployPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeployPolicy() + ); + client.innerApiCalls.getDeployPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IDeployPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployPolicy with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeployPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeployPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDeployPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDeployPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployPolicy with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeployPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeployPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeployPolicy(request), expectedError); + }); + }); + describe('approveRollout', () => { it('invokes approveRollout without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ @@ -4627,18 +4757,18 @@ describe('v1.CloudDeployClient', () => { }); }); - describe('createRollout', () => { - it('invokes createRollout without error', async () => { + describe('createDeployPolicy', () => { + it('invokes createDeployPolicy without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateRolloutRequest() + new protos.google.cloud.deploy.v1.CreateDeployPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateRolloutRequest', + '.google.cloud.deploy.v1.CreateDeployPolicyRequest', ['parent'] ); request.parent = defaultValue1; @@ -4646,32 +4776,32 @@ describe('v1.CloudDeployClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createRollout = + client.innerApiCalls.createDeployPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.createRollout(request); + const [operation] = await client.createDeployPolicy(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createRollout without error using callback', async () => { + it('invokes createDeployPolicy without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateRolloutRequest() + new protos.google.cloud.deploy.v1.CreateDeployPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateRolloutRequest', + '.google.cloud.deploy.v1.CreateDeployPolicyRequest', ['parent'] ); request.parent = defaultValue1; @@ -4679,15 +4809,15 @@ describe('v1.CloudDeployClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createRollout = + client.innerApiCalls.createDeployPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createRollout( + client.createDeployPolicy( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata > | null ) => { @@ -4700,86 +4830,86 @@ describe('v1.CloudDeployClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createRollout with call error', async () => { + it('invokes createDeployPolicy with call error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateRolloutRequest() + new protos.google.cloud.deploy.v1.CreateDeployPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateRolloutRequest', + '.google.cloud.deploy.v1.CreateDeployPolicyRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createRollout = stubLongRunningCall( + client.innerApiCalls.createDeployPolicy = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createRollout(request), expectedError); + await assert.rejects(client.createDeployPolicy(request), expectedError); const actualRequest = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createRollout with LRO error', async () => { + it('invokes createDeployPolicy with LRO error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateRolloutRequest() + new protos.google.cloud.deploy.v1.CreateDeployPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateRolloutRequest', + '.google.cloud.deploy.v1.CreateDeployPolicyRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createRollout = stubLongRunningCall( + client.innerApiCalls.createDeployPolicy = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createRollout(request); + const [operation] = await client.createDeployPolicy(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createRollout as SinonStub + client.innerApiCalls.createDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateRolloutProgress without error', async () => { + it('invokes checkCreateDeployPolicyProgress without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -4793,7 +4923,7 @@ describe('v1.CloudDeployClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateRolloutProgress( + const decodedOperation = await client.checkCreateDeployPolicyProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -4801,7 +4931,7 @@ describe('v1.CloudDeployClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateRolloutProgress with error', async () => { + it('invokes checkCreateDeployPolicyProgress with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -4814,74 +4944,76 @@ describe('v1.CloudDeployClient', () => { expectedError ); await assert.rejects( - client.checkCreateRolloutProgress(''), + client.checkCreateDeployPolicyProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createAutomation', () => { - it('invokes createAutomation without error', async () => { + describe('updateDeployPolicy', () => { + it('invokes updateDeployPolicy without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateAutomationRequest() + new protos.google.cloud.deploy.v1.UpdateDeployPolicyRequest() ); + request.deployPolicy ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateAutomationRequest', - ['parent'] + '.google.cloud.deploy.v1.UpdateDeployPolicyRequest', + ['deployPolicy', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.deployPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `deploy_policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createAutomation = + client.innerApiCalls.updateDeployPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.createAutomation(request); + const [operation] = await client.updateDeployPolicy(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createAutomation without error using callback', async () => { + it('invokes updateDeployPolicy without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateAutomationRequest() + new protos.google.cloud.deploy.v1.UpdateDeployPolicyRequest() ); + request.deployPolicy ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateAutomationRequest', - ['parent'] + '.google.cloud.deploy.v1.UpdateDeployPolicyRequest', + ['deployPolicy', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.deployPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `deploy_policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createAutomation = + client.innerApiCalls.updateDeployPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createAutomation( + client.updateDeployPolicy( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata > | null ) => { @@ -4894,86 +5026,88 @@ describe('v1.CloudDeployClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IDeployPolicy, protos.google.cloud.deploy.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createAutomation with call error', async () => { + it('invokes updateDeployPolicy with call error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateAutomationRequest() + new protos.google.cloud.deploy.v1.UpdateDeployPolicyRequest() ); + request.deployPolicy ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateAutomationRequest', - ['parent'] + '.google.cloud.deploy.v1.UpdateDeployPolicyRequest', + ['deployPolicy', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.deployPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `deploy_policy.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createAutomation = stubLongRunningCall( + client.innerApiCalls.updateDeployPolicy = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createAutomation(request), expectedError); + await assert.rejects(client.updateDeployPolicy(request), expectedError); const actualRequest = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createAutomation with LRO error', async () => { + it('invokes updateDeployPolicy with LRO error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.CreateAutomationRequest() + new protos.google.cloud.deploy.v1.UpdateDeployPolicyRequest() ); + request.deployPolicy ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.CreateAutomationRequest', - ['parent'] + '.google.cloud.deploy.v1.UpdateDeployPolicyRequest', + ['deployPolicy', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.deployPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `deploy_policy.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createAutomation = stubLongRunningCall( + client.innerApiCalls.updateDeployPolicy = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createAutomation(request); + const [operation] = await client.updateDeployPolicy(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createAutomation as SinonStub + client.innerApiCalls.updateDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateAutomationProgress without error', async () => { + it('invokes checkUpdateDeployPolicyProgress without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -4987,7 +5121,7 @@ describe('v1.CloudDeployClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateAutomationProgress( + const decodedOperation = await client.checkUpdateDeployPolicyProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -4995,7 +5129,7 @@ describe('v1.CloudDeployClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateAutomationProgress with error', async () => { + it('invokes checkUpdateDeployPolicyProgress with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -5008,76 +5142,74 @@ describe('v1.CloudDeployClient', () => { expectedError ); await assert.rejects( - client.checkCreateAutomationProgress(''), + client.checkUpdateDeployPolicyProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateAutomation', () => { - it('invokes updateAutomation without error', async () => { + describe('deleteDeployPolicy', () => { + it('invokes deleteDeployPolicy without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + new protos.google.cloud.deploy.v1.DeleteDeployPolicyRequest() ); - request.automation ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.UpdateAutomationRequest', - ['automation', 'name'] + '.google.cloud.deploy.v1.DeleteDeployPolicyRequest', + ['name'] ); - request.automation.name = defaultValue1; - const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateAutomation = + client.innerApiCalls.deleteDeployPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateAutomation(request); + const [operation] = await client.deleteDeployPolicy(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateAutomation without error using callback', async () => { + it('invokes deleteDeployPolicy without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + new protos.google.cloud.deploy.v1.DeleteDeployPolicyRequest() ); - request.automation ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.UpdateAutomationRequest', - ['automation', 'name'] + '.google.cloud.deploy.v1.DeleteDeployPolicyRequest', + ['name'] ); - request.automation.name = defaultValue1; - const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateAutomation = + client.innerApiCalls.deleteDeployPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateAutomation( + client.deleteDeployPolicy( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata > | null ) => { @@ -5090,88 +5222,86 @@ describe('v1.CloudDeployClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.deploy.v1.IAutomation, + protos.google.protobuf.IEmpty, protos.google.cloud.deploy.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateAutomation with call error', async () => { + it('invokes deleteDeployPolicy with call error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + new protos.google.cloud.deploy.v1.DeleteDeployPolicyRequest() ); - request.automation ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.UpdateAutomationRequest', - ['automation', 'name'] + '.google.cloud.deploy.v1.DeleteDeployPolicyRequest', + ['name'] ); - request.automation.name = defaultValue1; - const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateAutomation = stubLongRunningCall( + client.innerApiCalls.deleteDeployPolicy = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateAutomation(request), expectedError); + await assert.rejects(client.deleteDeployPolicy(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateAutomation with LRO error', async () => { + it('invokes deleteDeployPolicy with LRO error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + new protos.google.cloud.deploy.v1.DeleteDeployPolicyRequest() ); - request.automation ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.UpdateAutomationRequest', - ['automation', 'name'] + '.google.cloud.deploy.v1.DeleteDeployPolicyRequest', + ['name'] ); - request.automation.name = defaultValue1; - const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateAutomation = stubLongRunningCall( + client.innerApiCalls.deleteDeployPolicy = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateAutomation(request); + const [operation] = await client.deleteDeployPolicy(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateAutomation as SinonStub + client.innerApiCalls.deleteDeployPolicy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateAutomationProgress without error', async () => { + it('invokes checkDeleteDeployPolicyProgress without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -5185,7 +5315,7 @@ describe('v1.CloudDeployClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateAutomationProgress( + const decodedOperation = await client.checkDeleteDeployPolicyProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -5193,7 +5323,7 @@ describe('v1.CloudDeployClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateAutomationProgress with error', async () => { + it('invokes checkDeleteDeployPolicyProgress with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -5206,74 +5336,74 @@ describe('v1.CloudDeployClient', () => { expectedError ); await assert.rejects( - client.checkUpdateAutomationProgress(''), + client.checkDeleteDeployPolicyProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteAutomation', () => { - it('invokes deleteAutomation without error', async () => { + describe('createRollout', () => { + it('invokes createRollout without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + new protos.google.cloud.deploy.v1.CreateRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.DeleteAutomationRequest', - ['name'] + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteAutomation = + client.innerApiCalls.createRollout = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteAutomation(request); + const [operation] = await client.createRollout(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteAutomation without error using callback', async () => { + it('invokes createRollout without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + new protos.google.cloud.deploy.v1.CreateRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.DeleteAutomationRequest', - ['name'] + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteAutomation = + client.innerApiCalls.createRollout = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteAutomation( + client.createRollout( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IRollout, protos.google.cloud.deploy.v1.IOperationMetadata > | null ) => { @@ -5286,86 +5416,86 @@ describe('v1.CloudDeployClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IRollout, protos.google.cloud.deploy.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteAutomation with call error', async () => { + it('invokes createRollout with call error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + new protos.google.cloud.deploy.v1.CreateRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.DeleteAutomationRequest', - ['name'] + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteAutomation = stubLongRunningCall( + client.innerApiCalls.createRollout = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteAutomation(request), expectedError); + await assert.rejects(client.createRollout(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteAutomation with LRO error', async () => { + it('invokes createRollout with LRO error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + new protos.google.cloud.deploy.v1.CreateRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.DeleteAutomationRequest', - ['name'] + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteAutomation = stubLongRunningCall( + client.innerApiCalls.createRollout = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteAutomation(request); + const [operation] = await client.createRollout(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteAutomation as SinonStub + client.innerApiCalls.createRollout as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteAutomationProgress without error', async () => { + it('invokes checkCreateRolloutProgress without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -5379,7 +5509,7 @@ describe('v1.CloudDeployClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteAutomationProgress( + const decodedOperation = await client.checkCreateRolloutProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -5387,7 +5517,7 @@ describe('v1.CloudDeployClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteAutomationProgress with error', async () => { + it('invokes checkCreateRolloutProgress with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -5400,88 +5530,76 @@ describe('v1.CloudDeployClient', () => { expectedError ); await assert.rejects( - client.checkDeleteAutomationProgress(''), + client.checkCreateRolloutProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('listDeliveryPipelines', () => { - it('invokes listDeliveryPipelines without error', async () => { + describe('createAutomation', () => { + it('invokes createAutomation without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + new protos.google.cloud.deploy.v1.CreateAutomationRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + '.google.cloud.deploy.v1.CreateAutomationRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - ]; - client.innerApiCalls.listDeliveryPipelines = - stubSimpleCall(expectedResponse); - const [response] = await client.listDeliveryPipelines(request); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAutomation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createAutomation(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listDeliveryPipelines as SinonStub + client.innerApiCalls.createAutomation as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listDeliveryPipelines as SinonStub + client.innerApiCalls.createAutomation as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listDeliveryPipelines without error using callback', async () => { + it('invokes createAutomation without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + new protos.google.cloud.deploy.v1.CreateAutomationRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + '.google.cloud.deploy.v1.CreateAutomationRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - ]; - client.innerApiCalls.listDeliveryPipelines = - stubSimpleCallWithCallback(expectedResponse); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAutomation = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listDeliveryPipelines( + client.createAutomation( request, ( err?: Error | null, - result?: protos.google.cloud.deploy.v1.IDeliveryPipeline[] | null + result?: LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null ) => { if (err) { reject(err); @@ -5491,145 +5609,1060 @@ describe('v1.CloudDeployClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listDeliveryPipelines as SinonStub + client.innerApiCalls.createAutomation as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listDeliveryPipelines as SinonStub + client.innerApiCalls.createAutomation as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listDeliveryPipelines with error', async () => { + it('invokes createAutomation with call error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + new protos.google.cloud.deploy.v1.CreateAutomationRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + '.google.cloud.deploy.v1.CreateAutomationRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listDeliveryPipelines = stubSimpleCall( + client.innerApiCalls.createAutomation = stubLongRunningCall( undefined, expectedError ); - await assert.rejects( - client.listDeliveryPipelines(request), - expectedError - ); + await assert.rejects(client.createAutomation(request), expectedError); const actualRequest = ( - client.innerApiCalls.listDeliveryPipelines as SinonStub + client.innerApiCalls.createAutomation as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listDeliveryPipelines as SinonStub + client.innerApiCalls.createAutomation as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listDeliveryPipelinesStream without error', async () => { + it('invokes createAutomation with LRO error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + new protos.google.cloud.deploy.v1.CreateAutomationRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + '.google.cloud.deploy.v1.CreateAutomationRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - ]; - client.descriptors.page.listDeliveryPipelines.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listDeliveryPipelinesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; - stream.on( - 'data', - (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - ( - client.descriptors.page.listDeliveryPipelines - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listDeliveryPipelines, request) - ); - assert( - ( - client.descriptors.page.listDeliveryPipelines - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + const expectedError = new Error('expected'); + client.innerApiCalls.createAutomation = stubLongRunningCall( + undefined, + undefined, + expectedError ); + const [operation] = await client.createAutomation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listDeliveryPipelinesStream with error', async () => { + it('invokes checkCreateAutomationProgress without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAutomationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAutomationProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateAutomationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateAutomation', () => { + it('invokes updateAutomation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + ); + request.automation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateAutomationRequest', + ['automation', 'name'] + ); + request.automation.name = defaultValue1; + const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAutomation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAutomation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutomation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + ); + request.automation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateAutomationRequest', + ['automation', 'name'] + ); + request.automation.name = defaultValue1; + const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAutomation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAutomation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IAutomation, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutomation with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + ); + request.automation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateAutomationRequest', + ['automation', 'name'] + ); + request.automation.name = defaultValue1; + const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAutomation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAutomation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutomation with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateAutomationRequest() + ); + request.automation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateAutomationRequest', + ['automation', 'name'] + ); + request.automation.name = defaultValue1; + const expectedHeaderRequestParams = `automation.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAutomation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateAutomation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateAutomationProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateAutomationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAutomationProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateAutomationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteAutomation', () => { + it('invokes deleteAutomation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteAutomationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteAutomation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteAutomation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAutomation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteAutomationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteAutomation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAutomation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAutomation with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteAutomationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAutomation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAutomation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAutomation with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteAutomationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteAutomationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAutomation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteAutomation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAutomation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteAutomationProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteAutomationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteAutomationProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteAutomationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDeliveryPipelines', () => { + it('invokes listDeliveryPipelines without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.innerApiCalls.listDeliveryPipelines = + stubSimpleCall(expectedResponse); + const [response] = await client.listDeliveryPipelines(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelines without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.innerApiCalls.listDeliveryPipelines = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeliveryPipelines( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IDeliveryPipeline[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelines with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeliveryPipelines = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listDeliveryPipelines(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelinesStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.descriptors.page.listDeliveryPipelines.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDeliveryPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDeliveryPipelines, request) + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeliveryPipelinesStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeliveryPipelines.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeliveryPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDeliveryPipelines, request) + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeliveryPipelines without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.descriptors.page.listDeliveryPipelines.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; + const iterable = client.listDeliveryPipelinesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeliveryPipelines with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeliveryPipelines.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeliveryPipelinesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTargets', () => { + it('invokes listTargets without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.innerApiCalls.listTargets = stubSimpleCall(expectedResponse); + const [response] = await client.listTargets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargets without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.innerApiCalls.listTargets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTargets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.ITarget[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargets with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTargets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTargets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargetsStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.descriptors.page.listTargets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTargetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Target[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTargets, request) + ); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listTargetsStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listDeliveryPipelines.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listDeliveryPipelinesStream(request); + client.descriptors.page.listTargets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTargetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; - stream.on( - 'data', - (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { - responses.push(response); - } - ); + const responses: protos.google.cloud.deploy.v1.Target[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { + responses.push(response); + }); stream.on('end', () => { resolve(responses); }); @@ -5639,185 +6672,180 @@ describe('v1.CloudDeployClient', () => { }); await assert.rejects(promise, expectedError); assert( - ( - client.descriptors.page.listDeliveryPipelines - .createStream as SinonStub - ) + (client.descriptors.page.listTargets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listDeliveryPipelines, request) + .calledWith(client.innerApiCalls.listTargets, request) ); assert( - ( - client.descriptors.page.listDeliveryPipelines - .createStream as SinonStub - ) + (client.descriptors.page.listTargets.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); - it('uses async iteration with listDeliveryPipelines without error', async () => { + it('uses async iteration with listTargets without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + new protos.google.cloud.deploy.v1.ListTargetsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + '.google.cloud.deploy.v1.ListTargetsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.DeliveryPipeline() - ), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), ]; - client.descriptors.page.listDeliveryPipelines.asyncIterate = + client.descriptors.page.listTargets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; - const iterable = client.listDeliveryPipelinesAsync(request); + const responses: protos.google.cloud.deploy.v1.ITarget[] = []; + const iterable = client.listTargetsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listDeliveryPipelines - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - ( - client.descriptors.page.listDeliveryPipelines - .asyncIterate as SinonStub - ) + (client.descriptors.page.listTargets.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); - it('uses async iteration with listDeliveryPipelines with error', async () => { + it('uses async iteration with listTargets with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + new protos.google.cloud.deploy.v1.ListTargetsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + '.google.cloud.deploy.v1.ListTargetsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listDeliveryPipelines.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDeliveryPipelinesAsync(request); + client.descriptors.page.listTargets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTargetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; + const responses: protos.google.cloud.deploy.v1.ITarget[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listDeliveryPipelines - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - ( - client.descriptors.page.listDeliveryPipelines - .asyncIterate as SinonStub - ) + (client.descriptors.page.listTargets.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); }); - describe('listTargets', () => { - it('invokes listTargets without error', async () => { + describe('listCustomTargetTypes', () => { + it('invokes listCustomTargetTypes without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListTargetsRequest() + new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListTargetsRequest', + '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), ]; - client.innerApiCalls.listTargets = stubSimpleCall(expectedResponse); - const [response] = await client.listTargets(request); + client.innerApiCalls.listCustomTargetTypes = + stubSimpleCall(expectedResponse); + const [response] = await client.listCustomTargetTypes(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listTargets as SinonStub + client.innerApiCalls.listCustomTargetTypes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listTargets as SinonStub + client.innerApiCalls.listCustomTargetTypes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listTargets without error using callback', async () => { + it('invokes listCustomTargetTypes without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListTargetsRequest() + new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListTargetsRequest', + '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), ]; - client.innerApiCalls.listTargets = + client.innerApiCalls.listCustomTargetTypes = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listTargets( + client.listCustomTargetTypes( request, ( err?: Error | null, - result?: protos.google.cloud.deploy.v1.ITarget[] | null + result?: protos.google.cloud.deploy.v1.ICustomTargetType[] | null ) => { if (err) { reject(err); @@ -5830,74 +6858,86 @@ describe('v1.CloudDeployClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listTargets as SinonStub + client.innerApiCalls.listCustomTargetTypes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listTargets as SinonStub + client.innerApiCalls.listCustomTargetTypes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listTargets with error', async () => { + it('invokes listCustomTargetTypes with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListTargetsRequest() + new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListTargetsRequest', + '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listTargets = stubSimpleCall( + client.innerApiCalls.listCustomTargetTypes = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listTargets(request), expectedError); + await assert.rejects( + client.listCustomTargetTypes(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.listTargets as SinonStub + client.innerApiCalls.listCustomTargetTypes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listTargets as SinonStub + client.innerApiCalls.listCustomTargetTypes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listTargetsStream without error', async () => { + it('invokes listCustomTargetTypesStream without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListTargetsRequest() + new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListTargetsRequest', + '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), ]; - client.descriptors.page.listTargets.createStream = + client.descriptors.page.listCustomTargetTypes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTargetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.Target[] = []; - stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { - responses.push(response); - }); + const stream = client.listCustomTargetTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.CustomTargetType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.CustomTargetType) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -5908,45 +6948,52 @@ describe('v1.CloudDeployClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listTargets.createStream as SinonStub) + ( + client.descriptors.page.listCustomTargetTypes + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listTargets, request) + .calledWith(client.innerApiCalls.listCustomTargetTypes, request) ); assert( - (client.descriptors.page.listTargets.createStream as SinonStub) + ( + client.descriptors.page.listCustomTargetTypes + .createStream as SinonStub + ) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); - it('invokes listTargetsStream with error', async () => { + it('invokes listCustomTargetTypesStream with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListTargetsRequest() + new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListTargetsRequest', + '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listTargets.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listTargetsStream(request); + client.descriptors.page.listCustomTargetTypes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomTargetTypesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.Target[] = []; - stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { - responses.push(response); - }); + const responses: protos.google.cloud.deploy.v1.CustomTargetType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.CustomTargetType) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -5956,180 +7003,185 @@ describe('v1.CloudDeployClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listTargets.createStream as SinonStub) + ( + client.descriptors.page.listCustomTargetTypes + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listTargets, request) + .calledWith(client.innerApiCalls.listCustomTargetTypes, request) ); assert( - (client.descriptors.page.listTargets.createStream as SinonStub) + ( + client.descriptors.page.listCustomTargetTypes + .createStream as SinonStub + ) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); - it('uses async iteration with listTargets without error', async () => { + it('uses async iteration with listCustomTargetTypes without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListTargetsRequest() + new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListTargetsRequest', + '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.CustomTargetType() + ), ]; - client.descriptors.page.listTargets.asyncIterate = + client.descriptors.page.listCustomTargetTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.deploy.v1.ITarget[] = []; - const iterable = client.listTargetsAsync(request); + const responses: protos.google.cloud.deploy.v1.ICustomTargetType[] = []; + const iterable = client.listCustomTargetTypesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listCustomTargetTypes + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listTargets.asyncIterate as SinonStub) + ( + client.descriptors.page.listCustomTargetTypes + .asyncIterate as SinonStub + ) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); - it('uses async iteration with listTargets with error', async () => { + it('uses async iteration with listCustomTargetTypes with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListTargetsRequest() + new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListTargetsRequest', + '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listTargets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listTargetsAsync(request); + client.descriptors.page.listCustomTargetTypes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomTargetTypesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.deploy.v1.ITarget[] = []; + const responses: protos.google.cloud.deploy.v1.ICustomTargetType[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listCustomTargetTypes + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listTargets.asyncIterate as SinonStub) + ( + client.descriptors.page.listCustomTargetTypes + .asyncIterate as SinonStub + ) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); - describe('listCustomTargetTypes', () => { - it('invokes listCustomTargetTypes without error', async () => { + describe('listReleases', () => { + it('invokes listReleases without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() + new protos.google.cloud.deploy.v1.ListReleasesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', + '.google.cloud.deploy.v1.ListReleasesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), ]; - client.innerApiCalls.listCustomTargetTypes = - stubSimpleCall(expectedResponse); - const [response] = await client.listCustomTargetTypes(request); + client.innerApiCalls.listReleases = stubSimpleCall(expectedResponse); + const [response] = await client.listReleases(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listCustomTargetTypes as SinonStub + client.innerApiCalls.listReleases as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listCustomTargetTypes as SinonStub + client.innerApiCalls.listReleases as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listCustomTargetTypes without error using callback', async () => { + it('invokes listReleases without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() + new protos.google.cloud.deploy.v1.ListReleasesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', + '.google.cloud.deploy.v1.ListReleasesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), ]; - client.innerApiCalls.listCustomTargetTypes = + client.innerApiCalls.listReleases = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listCustomTargetTypes( + client.listReleases( request, ( err?: Error | null, - result?: protos.google.cloud.deploy.v1.ICustomTargetType[] | null + result?: protos.google.cloud.deploy.v1.IRelease[] | null ) => { if (err) { reject(err); @@ -6142,86 +7194,74 @@ describe('v1.CloudDeployClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listCustomTargetTypes as SinonStub + client.innerApiCalls.listReleases as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listCustomTargetTypes as SinonStub + client.innerApiCalls.listReleases as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listCustomTargetTypes with error', async () => { + it('invokes listReleases with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() + new protos.google.cloud.deploy.v1.ListReleasesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', + '.google.cloud.deploy.v1.ListReleasesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listCustomTargetTypes = stubSimpleCall( + client.innerApiCalls.listReleases = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.listCustomTargetTypes(request), - expectedError - ); + await assert.rejects(client.listReleases(request), expectedError); const actualRequest = ( - client.innerApiCalls.listCustomTargetTypes as SinonStub + client.innerApiCalls.listReleases as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listCustomTargetTypes as SinonStub + client.innerApiCalls.listReleases as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listCustomTargetTypesStream without error', async () => { + it('invokes listReleasesStream without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() + new protos.google.cloud.deploy.v1.ListReleasesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', + '.google.cloud.deploy.v1.ListReleasesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), ]; - client.descriptors.page.listCustomTargetTypes.createStream = + client.descriptors.page.listReleases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCustomTargetTypesStream(request); + const stream = client.listReleasesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.CustomTargetType[] = []; - stream.on( - 'data', - (response: protos.google.cloud.deploy.v1.CustomTargetType) => { - responses.push(response); - } - ); + const responses: protos.google.cloud.deploy.v1.Release[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { + responses.push(response); + }); stream.on('end', () => { resolve(responses); }); @@ -6232,52 +7272,45 @@ describe('v1.CloudDeployClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - ( - client.descriptors.page.listCustomTargetTypes - .createStream as SinonStub - ) + (client.descriptors.page.listReleases.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listCustomTargetTypes, request) + .calledWith(client.innerApiCalls.listReleases, request) ); assert( - ( - client.descriptors.page.listCustomTargetTypes - .createStream as SinonStub - ) + (client.descriptors.page.listReleases.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); - it('invokes listCustomTargetTypesStream with error', async () => { + it('invokes listReleasesStream with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() + new protos.google.cloud.deploy.v1.ListReleasesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', + '.google.cloud.deploy.v1.ListReleasesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listCustomTargetTypes.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCustomTargetTypesStream(request); + client.descriptors.page.listReleases.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listReleasesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.CustomTargetType[] = []; - stream.on( - 'data', - (response: protos.google.cloud.deploy.v1.CustomTargetType) => { - responses.push(response); - } - ); + const responses: protos.google.cloud.deploy.v1.Release[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { + responses.push(response); + }); stream.on('end', () => { resolve(responses); }); @@ -6287,185 +7320,166 @@ describe('v1.CloudDeployClient', () => { }); await assert.rejects(promise, expectedError); assert( - ( - client.descriptors.page.listCustomTargetTypes - .createStream as SinonStub - ) + (client.descriptors.page.listReleases.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listCustomTargetTypes, request) + .calledWith(client.innerApiCalls.listReleases, request) ); assert( - ( - client.descriptors.page.listCustomTargetTypes - .createStream as SinonStub - ) + (client.descriptors.page.listReleases.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); - it('uses async iteration with listCustomTargetTypes without error', async () => { + it('uses async iteration with listReleases without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() + new protos.google.cloud.deploy.v1.ListReleasesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', + '.google.cloud.deploy.v1.ListReleasesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), - generateSampleMessage( - new protos.google.cloud.deploy.v1.CustomTargetType() - ), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), ]; - client.descriptors.page.listCustomTargetTypes.asyncIterate = + client.descriptors.page.listReleases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.deploy.v1.ICustomTargetType[] = []; - const iterable = client.listCustomTargetTypesAsync(request); + const responses: protos.google.cloud.deploy.v1.IRelease[] = []; + const iterable = client.listReleasesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listCustomTargetTypes - .asyncIterate as SinonStub + client.descriptors.page.listReleases.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - ( - client.descriptors.page.listCustomTargetTypes - .asyncIterate as SinonStub - ) + (client.descriptors.page.listReleases.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); - it('uses async iteration with listCustomTargetTypes with error', async () => { + it('uses async iteration with listReleases with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListCustomTargetTypesRequest() + new protos.google.cloud.deploy.v1.ListReleasesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListCustomTargetTypesRequest', + '.google.cloud.deploy.v1.ListReleasesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listCustomTargetTypes.asyncIterate = + client.descriptors.page.listReleases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCustomTargetTypesAsync(request); + const iterable = client.listReleasesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.deploy.v1.ICustomTargetType[] = []; + const responses: protos.google.cloud.deploy.v1.IRelease[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listCustomTargetTypes - .asyncIterate as SinonStub + client.descriptors.page.listReleases.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - ( - client.descriptors.page.listCustomTargetTypes - .asyncIterate as SinonStub - ) + (client.descriptors.page.listReleases.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); }); }); - describe('listReleases', () => { - it('invokes listReleases without error', async () => { + describe('listDeployPolicies', () => { + it('invokes listDeployPolicies without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListReleasesRequest() + new protos.google.cloud.deploy.v1.ListDeployPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListReleasesRequest', + '.google.cloud.deploy.v1.ListDeployPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), ]; - client.innerApiCalls.listReleases = stubSimpleCall(expectedResponse); - const [response] = await client.listReleases(request); + client.innerApiCalls.listDeployPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.listDeployPolicies(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listReleases as SinonStub + client.innerApiCalls.listDeployPolicies as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listReleases as SinonStub + client.innerApiCalls.listDeployPolicies as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listReleases without error using callback', async () => { + it('invokes listDeployPolicies without error using callback', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListReleasesRequest() + new protos.google.cloud.deploy.v1.ListDeployPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListReleasesRequest', + '.google.cloud.deploy.v1.ListDeployPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), ]; - client.innerApiCalls.listReleases = + client.innerApiCalls.listDeployPolicies = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listReleases( + client.listDeployPolicies( request, ( err?: Error | null, - result?: protos.google.cloud.deploy.v1.IRelease[] | null + result?: protos.google.cloud.deploy.v1.IDeployPolicy[] | null ) => { if (err) { reject(err); @@ -6478,74 +7492,77 @@ describe('v1.CloudDeployClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listReleases as SinonStub + client.innerApiCalls.listDeployPolicies as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listReleases as SinonStub + client.innerApiCalls.listDeployPolicies as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listReleases with error', async () => { + it('invokes listDeployPolicies with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListReleasesRequest() + new protos.google.cloud.deploy.v1.ListDeployPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListReleasesRequest', + '.google.cloud.deploy.v1.ListDeployPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listReleases = stubSimpleCall( + client.innerApiCalls.listDeployPolicies = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listReleases(request), expectedError); + await assert.rejects(client.listDeployPolicies(request), expectedError); const actualRequest = ( - client.innerApiCalls.listReleases as SinonStub + client.innerApiCalls.listDeployPolicies as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listReleases as SinonStub + client.innerApiCalls.listDeployPolicies as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listReleasesStream without error', async () => { + it('invokes listDeployPoliciesStream without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListReleasesRequest() + new protos.google.cloud.deploy.v1.ListDeployPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListReleasesRequest', + '.google.cloud.deploy.v1.ListDeployPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), ]; - client.descriptors.page.listReleases.createStream = + client.descriptors.page.listDeployPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listReleasesStream(request); + const stream = client.listDeployPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.Release[] = []; - stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { - responses.push(response); - }); + const responses: protos.google.cloud.deploy.v1.DeployPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeployPolicy) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -6556,12 +7573,12 @@ describe('v1.CloudDeployClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listReleases.createStream as SinonStub) + (client.descriptors.page.listDeployPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listReleases, request) + .calledWith(client.innerApiCalls.listDeployPolicies, request) ); assert( - (client.descriptors.page.listReleases.createStream as SinonStub) + (client.descriptors.page.listDeployPolicies.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers[ 'x-goog-request-params' @@ -6569,32 +7586,33 @@ describe('v1.CloudDeployClient', () => { ); }); - it('invokes listReleasesStream with error', async () => { + it('invokes listDeployPoliciesStream with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListReleasesRequest() + new protos.google.cloud.deploy.v1.ListDeployPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListReleasesRequest', + '.google.cloud.deploy.v1.ListDeployPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listReleases.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listReleasesStream(request); + client.descriptors.page.listDeployPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeployPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.deploy.v1.Release[] = []; - stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { - responses.push(response); - }); + const responses: protos.google.cloud.deploy.v1.DeployPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeployPolicy) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -6604,12 +7622,12 @@ describe('v1.CloudDeployClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listReleases.createStream as SinonStub) + (client.descriptors.page.listDeployPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listReleases, request) + .calledWith(client.innerApiCalls.listDeployPolicies, request) ); assert( - (client.descriptors.page.listReleases.createStream as SinonStub) + (client.descriptors.page.listDeployPolicies.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers[ 'x-goog-request-params' @@ -6617,42 +7635,42 @@ describe('v1.CloudDeployClient', () => { ); }); - it('uses async iteration with listReleases without error', async () => { + it('uses async iteration with listDeployPolicies without error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListReleasesRequest() + new protos.google.cloud.deploy.v1.ListDeployPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListReleasesRequest', + '.google.cloud.deploy.v1.ListDeployPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), - generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), + generateSampleMessage(new protos.google.cloud.deploy.v1.DeployPolicy()), ]; - client.descriptors.page.listReleases.asyncIterate = + client.descriptors.page.listDeployPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.deploy.v1.IRelease[] = []; - const iterable = client.listReleasesAsync(request); + const responses: protos.google.cloud.deploy.v1.IDeployPolicy[] = []; + const iterable = client.listDeployPoliciesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listReleases.asyncIterate as SinonStub + client.descriptors.page.listDeployPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listReleases.asyncIterate as SinonStub) + (client.descriptors.page.listDeployPolicies.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers[ 'x-goog-request-params' @@ -6660,39 +7678,39 @@ describe('v1.CloudDeployClient', () => { ); }); - it('uses async iteration with listReleases with error', async () => { + it('uses async iteration with listDeployPolicies with error', async () => { const client = new clouddeployModule.v1.CloudDeployClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.deploy.v1.ListReleasesRequest() + new protos.google.cloud.deploy.v1.ListDeployPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.deploy.v1.ListReleasesRequest', + '.google.cloud.deploy.v1.ListDeployPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listReleases.asyncIterate = + client.descriptors.page.listDeployPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listReleasesAsync(request); + const iterable = client.listDeployPoliciesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.deploy.v1.IRelease[] = []; + const responses: protos.google.cloud.deploy.v1.IDeployPolicy[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listReleases.asyncIterate as SinonStub + client.descriptors.page.listDeployPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listReleases.asyncIterate as SinonStub) + (client.descriptors.page.listDeployPolicies.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers[ 'x-goog-request-params' @@ -9218,6 +10236,70 @@ describe('v1.CloudDeployClient', () => { }); }); + describe('deployPolicy', () => { + const fakePath = '/rendered/path/deployPolicy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deploy_policy: 'deployPolicyValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deployPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deployPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deployPolicyPath', () => { + const result = client.deployPolicyPath( + 'projectValue', + 'locationValue', + 'deployPolicyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deployPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeployPolicyName', () => { + const result = client.matchProjectFromDeployPolicyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deployPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeployPolicyName', () => { + const result = client.matchLocationFromDeployPolicyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deployPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeployPolicyFromDeployPolicyName', () => { + const result = client.matchDeployPolicyFromDeployPolicyName(fakePath); + assert.strictEqual(result, 'deployPolicyValue'); + assert( + (client.pathTemplates.deployPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('job', () => { const fakePath = '/rendered/path/job'; const expectedParameters = {