# Copyright 2023 Google LLC. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
  title: Compute/ServiceAttachment
  description: Represents a ServiceAttachment resource.
  x-dcl-struct-name: ServiceAttachment
  x-dcl-has-iam: false
  x-dcl-ref:
    text: API documentation
    url: https://cloud.google.com/compute/docs/reference/rest/beta/serviceAttachments
  x-dcl-guides:
  - text: Configuring Private Service Connect to access services
    url: https://cloud.google.com/vpc/docs/configure-private-service-connect-services
paths:
  get:
    description: The function used to get information about a ServiceAttachment
    parameters:
    - name: serviceAttachment
      required: true
      description: A full instance of a ServiceAttachment
  apply:
    description: The function used to apply information about a ServiceAttachment
    parameters:
    - name: serviceAttachment
      required: true
      description: A full instance of a ServiceAttachment
  delete:
    description: The function used to delete a ServiceAttachment
    parameters:
    - name: serviceAttachment
      required: true
      description: A full instance of a ServiceAttachment
  deleteAll:
    description: The function used to delete all ServiceAttachment
    parameters:
    - name: project
      required: true
      schema:
        type: string
    - name: location
      required: true
      schema:
        type: string
  list:
    description: The function used to list information about many ServiceAttachment
    parameters:
    - name: project
      required: true
      schema:
        type: string
    - name: location
      required: true
      schema:
        type: string
components:
  schemas:
    ServiceAttachment:
      title: ServiceAttachment
      x-dcl-id: projects/{{project}}/regions/{{location}}/serviceAttachments/{{name}}
      x-dcl-locations:
      - region
      x-dcl-parent-container: project
      x-dcl-has-create: true
      x-dcl-has-iam: false
      x-dcl-read-timeout: 0
      x-dcl-apply-timeout: 0
      x-dcl-delete-timeout: 0
      type: object
      required:
      - name
      - targetService
      - connectionPreference
      - natSubnets
      - project
      - location
      properties:
        connectedEndpoints:
          type: array
          x-dcl-go-name: ConnectedEndpoints
          readOnly: true
          description: An array of connections for all the consumers connected to
            this service attachment.
          x-kubernetes-immutable: true
          x-dcl-list-type: list
          items:
            type: object
            x-dcl-go-type: ServiceAttachmentConnectedEndpoints
            properties:
              endpoint:
                type: string
                x-dcl-go-name: Endpoint
                description: The url of a connected endpoint.
              pscConnectionId:
                type: integer
                format: int64
                x-dcl-go-name: PscConnectionId
                description: The PSC connection id of the connected endpoint.
              status:
                type: string
                x-dcl-go-name: Status
                x-dcl-go-type: ServiceAttachmentConnectedEndpointsStatusEnum
                description: 'The status of a connected endpoint to this service attachment.
                  Possible values: PENDING, RUNNING, DONE'
                enum:
                - PENDING
                - RUNNING
                - DONE
        connectionPreference:
          type: string
          x-dcl-go-name: ConnectionPreference
          x-dcl-go-type: ServiceAttachmentConnectionPreferenceEnum
          description: 'The connection preference of service attachment. The value
            can be set to `ACCEPT_AUTOMATIC`. An `ACCEPT_AUTOMATIC` service attachment
            is one that always accepts the connection from consumer forwarding rules.
            Possible values: CONNECTION_PREFERENCE_UNSPECIFIED, ACCEPT_AUTOMATIC,
            ACCEPT_MANUAL'
          enum:
          - CONNECTION_PREFERENCE_UNSPECIFIED
          - ACCEPT_AUTOMATIC
          - ACCEPT_MANUAL
        consumerAcceptLists:
          type: array
          x-dcl-go-name: ConsumerAcceptLists
          description: Projects that are allowed to connect to this service attachment.
          x-dcl-send-empty: true
          x-dcl-list-type: list
          items:
            type: object
            x-dcl-go-type: ServiceAttachmentConsumerAcceptLists
            required:
            - projectIdOrNum
            properties:
              connectionLimit:
                type: integer
                format: int64
                x-dcl-go-name: ConnectionLimit
                description: The value of the limit to set.
              projectIdOrNum:
                type: string
                x-dcl-go-name: ProjectIdOrNum
                description: The project id or number for the project to set the limit
                  for.
                x-dcl-references:
                - resource: Cloudresourcemanager/Project
                  field: name
        consumerRejectLists:
          type: array
          x-dcl-go-name: ConsumerRejectLists
          description: Projects that are not allowed to connect to this service attachment.
            The project can be specified using its id or number.
          x-dcl-send-empty: true
          x-dcl-list-type: list
          items:
            type: string
            x-dcl-go-type: string
            x-dcl-references:
            - resource: Cloudresourcemanager/Project
              field: name
        description:
          type: string
          x-dcl-go-name: Description
          description: An optional description of this resource. Provide this property
            when you create the resource.
        enableProxyProtocol:
          type: boolean
          x-dcl-go-name: EnableProxyProtocol
          description: If true, enable the proxy protocol which is for supplying client
            TCP/IP address data in TCP connections that traverse proxies on their
            way to destination servers.
          x-kubernetes-immutable: true
        fingerprint:
          type: string
          x-dcl-go-name: Fingerprint
          readOnly: true
          description: Fingerprint of this resource. This field is used internally
            during updates of this resource.
          x-kubernetes-immutable: true
        id:
          type: integer
          format: int64
          x-dcl-go-name: Id
          readOnly: true
          description: The unique identifier for the resource type. The server generates
            this identifier.
          x-kubernetes-immutable: true
        location:
          type: string
          x-dcl-go-name: Location
          description: The location for the resource
          x-kubernetes-immutable: true
        name:
          type: string
          x-dcl-go-name: Name
          description: Name of the resource. Provided by the client when the resource
            is created. The name must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
            Specifically, the name must be 1-63 characters long and match the regular
            expression `)?` which means the first character must be a lowercase letter,
            and all following characters must be a dash, lowercase letter, or digit,
            except the last character, which cannot be a dash.
          x-kubernetes-immutable: true
        natSubnets:
          type: array
          x-dcl-go-name: NatSubnets
          description: An array of URLs where each entry is the URL of a subnet provided
            by the service producer to use for NAT in this service attachment.
          x-dcl-send-empty: true
          x-dcl-list-type: list
          items:
            type: string
            x-dcl-go-type: string
            x-dcl-references:
            - resource: Compute/Subnetwork
              field: selfLink
        project:
          type: string
          x-dcl-go-name: Project
          description: The project for the resource
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Cloudresourcemanager/Project
            field: name
            parent: true
        pscServiceAttachmentId:
          type: object
          x-dcl-go-name: PscServiceAttachmentId
          x-dcl-go-type: ServiceAttachmentPscServiceAttachmentId
          readOnly: true
          description: An 128-bit global unique ID of the PSC service attachment.
          x-kubernetes-immutable: true
          properties:
            high:
              type: integer
              format: int64
              x-dcl-go-name: High
              readOnly: true
              x-kubernetes-immutable: true
            low:
              type: integer
              format: int64
              x-dcl-go-name: Low
              readOnly: true
              x-kubernetes-immutable: true
        region:
          type: string
          x-dcl-go-name: Region
          readOnly: true
          description: URL of the region where the service attachment resides. This
            field applies only to the region resource. You must specify this field
            as part of the HTTP request URL. It is not settable as a field in the
            request body.
          x-kubernetes-immutable: true
        selfLink:
          type: string
          x-dcl-go-name: SelfLink
          readOnly: true
          description: Server-defined URL for the resource.
          x-kubernetes-immutable: true
        targetService:
          type: string
          x-dcl-go-name: TargetService
          description: The URL of a service serving the endpoint identified by this
            service attachment.
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Compute/ForwardingRule
            field: selfLink
