Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify resource attribute 'input' to 'immutable' #7431

Merged
merged 5 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions mmv1/api/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Properties
# [Optional] If set to true, don't generate the resource.
attr_reader :exclude
# [Optional] If set to true, the resource is not able to be updated.
attr_reader :input
attr_reader :immutable
# [Optional] If set to true, this resource uses an update mask to perform
# updates. This is typical of newer GCP APIs.
attr_reader :update_mask
Expand Down Expand Up @@ -244,7 +244,7 @@ def validate
check :delete_verb, type: Symbol, default: :DELETE, allowed: %i[POST PUT PATCH DELETE]
check :update_verb, type: Symbol, default: :PUT, allowed: %i[POST PUT PATCH]

check :input, type: :boolean
check :immutable, type: :boolean
check :min_version, type: String

check :has_self_link, type: :boolean, default: false
Expand Down
4 changes: 2 additions & 2 deletions mmv1/api/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Fields
attr_reader :removed_message

attr_reader :output # If set value will not be sent to server on sync
attr_reader :input # If set to true value is used only on creation
attr_reader :immutable # If set to true value is used only on creation

# url_param_only will not send the field in the resource body and will
# not attempt to read the field from the API response.
Expand Down Expand Up @@ -214,7 +214,7 @@ def validate
check :allow_empty_object, type: :boolean
check :url_param_only, type: :boolean
check :read_query_params, type: ::String
check :input, type: :boolean
check :immutable, type: :boolean

raise 'Property cannot be output and required at the same time.' \
if @output && @required
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accessapproval/FolderSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description: |
ID of the folder of the access approval settings.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accessapproval/OrganizationSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description: |
ID of the organization of the access approval settings.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accessapproval/ProjectSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description: |
ID of the project of the access approval settings.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accesscontextmanager/AccessLevel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
# This must be done at the provider level.
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
description: |
The AccessPolicy this AccessLevel lives in.
Format: accessPolicies/{policy_id}
ignore_read: true
- !ruby/object:Api::Type::String
name: name
input: true
immutable: true
required: true
description: |
Resource name for the Access Level. The short_name component must begin
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accesscontextmanager/AccessLevelCondition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
self_link: "{{access_level}}"
create_verb: :PATCH
delete_verb: :PATCH
input: true
immutable: true
update_mask: true
identity:
- ipSubnetworks
Expand Down Expand Up @@ -82,7 +82,7 @@
description: |
The name of the Access Level to add this condition to.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::Array
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accesscontextmanager/AccessLevels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# This must be done at the provider level.
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
url_param_only: true
description: |
Expand All @@ -63,7 +63,7 @@
properties:
- !ruby/object:Api::Type::String
name: name
input: true
immutable: true
required: true
description: |
Resource name for the Access Level. The short_name component must begin
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accesscontextmanager/AccessPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
parameters:
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
description: |
The parent of this AccessPolicy in the Cloud Resource Hierarchy.
Expand Down
10 changes: 5 additions & 5 deletions mmv1/products/accesscontextmanager/AuthorizedOrgsDesc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
parameters:
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
description: |
Required. Resource name for the access policy which owns this `AuthorizedOrgsDesc`.
ignore_read: true
- !ruby/object:Api::Type::String
name: name
input: true
immutable: true
required: true
description: |
Resource name for the `AuthorizedOrgsDesc`. Format:
Expand All @@ -75,7 +75,7 @@
item_type: Api::Type::String
- !ruby/object:Api::Type::Enum
name: assetType
input: true
immutable: true
description: |
The type of entities that need to use the authorization relationship during
evaluation, such as a device. Valid values are "ASSET_TYPE_DEVICE" and
Expand All @@ -85,7 +85,7 @@
- :ASSET_TYPE_CREDENTIAL_STRENGTH
- !ruby/object:Api::Type::Enum
name: authorizationDirection
input: true
immutable: true
description: |
The direction of the authorization relationship between this organization
and the organizations listed in the "orgs" field. The valid values for this
Expand All @@ -109,7 +109,7 @@
- :AUTHORIZATION_DIRECTION_FROM
- !ruby/object:Api::Type::Enum
name: authorizationType
input: true
immutable: true
description: |
A granular control type for authorization levels. Valid value is "AUTHORIZATION_TYPE_TRUST".
values:
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accesscontextmanager/GcpUserAccessBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# This must be done at the provider level.
- !ruby/object:Api::Type::String
name: organizationId
input: true
immutable: true
required: true
url_param_only: true
description: |
Expand All @@ -59,7 +59,7 @@
- !ruby/object:Api::Type::String
name: 'groupKey'
required: true
input: true
immutable: true
description: |
Required. Immutable. Google Group id whose members are subject to this binding's restrictions. See "id" in the G Suite Directory API's Groups resource. If a group's email address/alias is changed, this resource will continue to point at the changed group. This field does not accept group email addresses or aliases. Example: "01d520gv4vjcrht"
- !ruby/object:Api::Type::Array
Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/accesscontextmanager/ServicePerimeter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@
# This must be done at the provider level.
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
description: |
The AccessPolicy this ServicePerimeter lives in.
Format: accessPolicies/{policy_id}
ignore_read: true
- !ruby/object:Api::Type::String
name: name
input: true
immutable: true
required: true
description: |
Resource name for the ServicePerimeter. The short_name component must
Expand Down Expand Up @@ -137,7 +137,7 @@
- :PERIMETER_TYPE_BRIDGE
default_value: :PERIMETER_TYPE_REGULAR
custom_flatten: templates/terraform/custom_flatten/default_if_empty.erb
input: true
immutable: true
- !ruby/object:Api::Type::NestedObject
name: 'status'
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
self_link: "{{perimeter_name}}"
create_verb: :PATCH
delete_verb: :PATCH
input: true
immutable: true
update_mask: true
identity:
- resource
Expand Down Expand Up @@ -71,7 +71,7 @@
description: |
The name of the Service Perimeter to add this resource to.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
Expand All @@ -81,4 +81,4 @@
Currently only projects are allowed.
Format: projects/{project_number}
required: true
input: true
immutable: true
6 changes: 3 additions & 3 deletions mmv1/products/accesscontextmanager/ServicePerimeters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# This must be done at the provider level.
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
description: |
The AccessPolicy this ServicePerimeter lives in.
Expand All @@ -62,7 +62,7 @@
properties:
- !ruby/object:Api::Type::String
name: name
input: true
immutable: true
required: true
description: |
Resource name for the ServicePerimeter. The short_name component must
Expand Down Expand Up @@ -112,7 +112,7 @@
- :PERIMETER_TYPE_BRIDGE
default_value: :PERIMETER_TYPE_REGULAR
custom_flatten: templates/terraform/custom_flatten/default_if_empty.erb
input: true
immutable: true
- !ruby/object:Api::Type::NestedObject
name: 'status'
description: |
Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/activedirectory/Domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
name: domainName
required: true
url_param_only: true
input: true
immutable: true
description: |
The fully qualified domain name. e.g. mydomain.myorganization.com, with the restrictions,
https://cloud.google.com/managed-microsoft-ad/reference/rest/v1/projects.locations.global.domains.
Expand All @@ -73,7 +73,7 @@
- !ruby/object:Api::Type::String
name: 'reservedIpRange'
required: true
input: true
immutable: true
description: |
The CIDR range of internal addresses that are reserved for this domain. Reserved networks must be /24 or larger.
Ranges must be unique and non-overlapping with existing subnets in authorizedNetworks
Expand All @@ -87,7 +87,7 @@
- !ruby/object:Api::Type::String
name: 'admin'
default_value: 'setupadmin'
input: true
immutable: true
description: |
The name of delegated administrator account used to perform Active Directory operations.
If not specified, setupadmin will be used.
Expand Down
10 changes: 5 additions & 5 deletions mmv1/products/activedirectory/DomainTrust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
name: domain
required: true
url_param_only: true
input: true
immutable: true
description: |
The fully qualified domain name. e.g. mydomain.myorganization.com, with the restrictions,
https://cloud.google.com/managed-microsoft-ad/reference/rest/v1/projects.locations.global.domains.
Expand All @@ -65,23 +65,23 @@
- !ruby/object:Api::Type::Enum
name: 'trustType'
required: true
input: true
immutable: true
description: 'The type of trust represented by the trust resource.'
values:
- FOREST
- EXTERNAL
- !ruby/object:Api::Type::Enum
name: 'trustDirection'
required: true
input: true
immutable: true
description: 'The trust direction, which decides if the current domain is trusted, trusting, or both.'
values:
- INBOUND
- OUTBOUND
- BIDIRECTIONAL
- !ruby/object:Api::Type::Boolean
name: 'selectiveAuthentication'
input: true
immutable: true
description: |
Whether the trusted side has forest/domain wide access or selective access to an approved set of resources.
- !ruby/object:Api::Type::Array
Expand All @@ -93,6 +93,6 @@
- !ruby/object:Api::Type::String
name: 'trustHandshakeSecret'
required: true
input: true
immutable: true
description: |
The trust secret used for the handshake with the target domain. This will not be stored.
6 changes: 3 additions & 3 deletions mmv1/products/activedirectory/Peering.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
name: peeringId
required: true
url_param_only: true
input: true
immutable: true
description: ""
properties:
- !ruby/object:Api::Type::String
Expand All @@ -62,13 +62,13 @@
- !ruby/object:Api::Type::String
name: authorizedNetwork
required: true
input: true
immutable: true
description: |
The full names of the Google Compute Engine networks to which the instance is connected. Caller needs to make sure that CIDR subnets do not overlap between networks, else peering creation will fail.
- !ruby/object:Api::Type::String
name: domainResource
required: true
input: true
immutable: true
description: |
Full domain resource path for the Managed AD Domain involved in peering. The resource path should be in the form projects/{projectId}/locations/global/domains/{domainName}
- !ruby/object:Api::Type::String
Expand Down
8 changes: 4 additions & 4 deletions mmv1/products/alloydb/Backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
- !ruby/object:Api::Type::String
name: "backupId"
required: true
input: true
immutable: true
url_param_only: true
description: |
The ID of the alloydb backup.
- !ruby/object:Api::Type::String
name: "location"
input: true
immutable: true
url_param_only: true
description: |
The location where the alloydb backup should reside.
Expand All @@ -72,7 +72,7 @@
name: "clusterName"
description: "The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId})."
required: true
input: true
immutable: true
- !ruby/object:Api::Type::KeyValuePairs
name: "labels"
description: "User-defined labels for the alloydb backup."
Expand All @@ -95,7 +95,7 @@
name: "description"
description: |
User-provided description of the backup.
input: true
immutable: true
- !ruby/object:Api::Type::Boolean
name: "reconciling"
output: true
Expand Down
Loading