// Copyright 2023 Google LLC
//
// 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
//
//      https://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.

// Generated by the C++ microgenerator.
// If you make any local changes, they will be lost.
// file:///workspace/generator/discovery/compute_public_google_rest_v1.json
// revision: 20231110

syntax = "proto3";

package google.cloud.cpp.compute.global_network_endpoint_groups.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/cloud/compute/v1/internal/common_012.proto";
import "google/cloud/compute/v1/internal/common_016.proto";
import "google/cloud/compute/v1/internal/common_044.proto";
import "google/cloud/extended_operations.proto";

// Service for the globalNetworkEndpointGroups resource.
// https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups
service GlobalNetworkEndpointGroups {
  option (google.api.default_host) = "compute.googleapis.com";
  option (google.api.oauth_scopes) =
      "https://www.googleapis.com/auth/cloud-platform,"
      "https://www.googleapis.com/auth/compute,"
      "https://www.googleapis.com/auth/compute.readonly";

  // Attach a network endpoint to the specified network endpoint group.
  // https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups/attachNetworkEndpoints
  rpc AttachNetworkEndpoints(AttachNetworkEndpointsRequest)
      returns (google.cloud.cpp.compute.v1.Operation) {
    option (google.api.http) = {
      post: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints"
      body: "global_network_endpoint_groups_attach_endpoints_request_resource"
    };
    option (google.api.method_signature) =
        "project,network_endpoint_group,global_network_endpoint_groups_attach_endpoints_request_resource";
    option (google.cloud.operation_service) = "GlobalOperations";
  }

  // Deletes the specified network endpoint group.Note that the NEG cannot be
  // deleted if there are backend services referencing it.
  // https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups/delete
  rpc DeleteNetworkEndpointGroup(DeleteNetworkEndpointGroupRequest)
      returns (google.cloud.cpp.compute.v1.Operation) {
    option (google.api.http) = {
      delete: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}"
    };
    option (google.api.method_signature) = "project,network_endpoint_group";
    option (google.cloud.operation_service) = "GlobalOperations";
  }

  // Detach the network endpoint from the specified network endpoint group.
  // https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups/detachNetworkEndpoints
  rpc DetachNetworkEndpoints(DetachNetworkEndpointsRequest)
      returns (google.cloud.cpp.compute.v1.Operation) {
    option (google.api.http) = {
      post: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints"
      body: "global_network_endpoint_groups_detach_endpoints_request_resource"
    };
    option (google.api.method_signature) =
        "project,network_endpoint_group,global_network_endpoint_groups_detach_endpoints_request_resource";
    option (google.cloud.operation_service) = "GlobalOperations";
  }

  // Returns the specified network endpoint group.
  // https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups/get
  rpc GetNetworkEndpointGroup(GetNetworkEndpointGroupRequest)
      returns (google.cloud.cpp.compute.v1.NetworkEndpointGroup) {
    option (google.api.http) = {
      get: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}"
    };
    option (google.api.method_signature) = "project,network_endpoint_group";
  }

  // Creates a network endpoint group in the specified project using the
  // parameters that are included in the request.
  // https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups/insert
  rpc InsertNetworkEndpointGroup(InsertNetworkEndpointGroupRequest)
      returns (google.cloud.cpp.compute.v1.Operation) {
    option (google.api.http) = {
      post: "/compute/v1/projects/{project}/global/networkEndpointGroups"
      body: "network_endpoint_group_resource"
    };
    option (google.api.method_signature) =
        "project,network_endpoint_group_resource";
    option (google.cloud.operation_service) = "GlobalOperations";
  }

  // Retrieves the list of network endpoint groups that are located in the
  // specified project.
  // https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups/list
  rpc ListGlobalNetworkEndpointGroups(ListGlobalNetworkEndpointGroupsRequest)
      returns (google.cloud.cpp.compute.v1.NetworkEndpointGroupList) {
    option (google.api.http) = {
      get: "/compute/v1/projects/{project}/global/networkEndpointGroups"
    };
    option (google.api.method_signature) = "project";
  }

  // Lists the network endpoints in the specified network endpoint group.
  // https://cloud.google.com/compute/docs/reference/rest/v1/globalNetworkEndpointGroups/listNetworkEndpoints
  rpc ListNetworkEndpoints(ListNetworkEndpointsRequest) returns (
      google.cloud.cpp.compute.v1.NetworkEndpointGroupsListNetworkEndpoints) {
    option (google.api.http) = {
      post: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints"
      body: "*"
    };
    option (google.api.method_signature) = "project,network_endpoint_group";
  }
}

// Request message for AttachNetworkEndpoints.
message AttachNetworkEndpointsRequest {
  // The GlobalNetworkEndpointGroupsAttachEndpointsRequest for this request.
  optional google.cloud.cpp.compute.v1
      .GlobalNetworkEndpointGroupsAttachEndpointsRequest
          global_network_endpoint_groups_attach_endpoints_request_resource = 1
      [json_name = "__json_request_body"];

  // The name of the network endpoint group where you are attaching network
  // endpoints to. It should comply with RFC1035.
  string network_endpoint_group = 2 [
    (google.api.field_behavior) = REQUIRED,
    json_name = "networkEndpointGroup"
  ];

  // Project ID for this request.
  string project = 3 [
    (google.api.field_behavior) = REQUIRED,
    (google.cloud.operation_request_field) = "project",
    json_name = "project"
  ];

  // An optional request ID to identify requests. Specify a unique request ID so
  // that if you must retry your request, the server will know to ignore the
  // request if it has already been completed. 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).
  optional string request_id = 4 [json_name = "requestId"];
}

// Request message for DeleteNetworkEndpointGroup.
message DeleteNetworkEndpointGroupRequest {
  // The name of the network endpoint group to delete. It should comply with
  // RFC1035.
  string network_endpoint_group = 1 [
    (google.api.field_behavior) = REQUIRED,
    json_name = "networkEndpointGroup"
  ];

  // Project ID for this request.
  string project = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.cloud.operation_request_field) = "project",
    json_name = "project"
  ];

  // An optional request ID to identify requests. Specify a unique request ID so
  // that if you must retry your request, the server will know to ignore the
  // request if it has already been completed. 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).
  optional string request_id = 3 [json_name = "requestId"];
}

// Request message for DetachNetworkEndpoints.
message DetachNetworkEndpointsRequest {
  // The GlobalNetworkEndpointGroupsDetachEndpointsRequest for this request.
  optional google.cloud.cpp.compute.v1
      .GlobalNetworkEndpointGroupsDetachEndpointsRequest
          global_network_endpoint_groups_detach_endpoints_request_resource = 1
      [json_name = "__json_request_body"];

  // The name of the network endpoint group where you are removing network
  // endpoints. It should comply with RFC1035.
  string network_endpoint_group = 2 [
    (google.api.field_behavior) = REQUIRED,
    json_name = "networkEndpointGroup"
  ];

  // Project ID for this request.
  string project = 3 [
    (google.api.field_behavior) = REQUIRED,
    (google.cloud.operation_request_field) = "project",
    json_name = "project"
  ];

  // An optional request ID to identify requests. Specify a unique request ID so
  // that if you must retry your request, the server will know to ignore the
  // request if it has already been completed. 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).
  optional string request_id = 4 [json_name = "requestId"];
}

// Request message for GetNetworkEndpointGroup.
message GetNetworkEndpointGroupRequest {
  // The name of the network endpoint group. It should comply with RFC1035.
  string network_endpoint_group = 1 [
    (google.api.field_behavior) = REQUIRED,
    json_name = "networkEndpointGroup"
  ];

  // Project ID for this request.
  string project = 2
      [(google.api.field_behavior) = REQUIRED, json_name = "project"];
}

// Request message for InsertNetworkEndpointGroup.
message InsertNetworkEndpointGroupRequest {
  // The NetworkEndpointGroup for this request.
  optional google.cloud.cpp.compute.v1.NetworkEndpointGroup
      network_endpoint_group_resource = 1 [json_name = "__json_request_body"];

  // Project ID for this request.
  string project = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.cloud.operation_request_field) = "project",
    json_name = "project"
  ];

  // An optional request ID to identify requests. Specify a unique request ID so
  // that if you must retry your request, the server will know to ignore the
  // request if it has already been completed. 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).
  optional string request_id = 3 [json_name = "requestId"];
}

// Request message for ListGlobalNetworkEndpointGroups.
message ListGlobalNetworkEndpointGroupsRequest {
  // A filter expression that filters resources listed in the response. Most
  // Compute resources support two types of filter expressions: expressions that
  // support regular expressions and expressions that follow API improvement
  // proposal AIP-160. These two types of filter expressions cannot be mixed in
  // one request. If you want to use AIP-160, your expression must specify the
  // field name, an operator, and the value that you want to use for filtering.
  // The value must be a string, a number, or a boolean. The operator must be
  // either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are
  // filtering Compute Engine instances, you can exclude instances named
  // `example-instance` by specifying `name != example-instance`. The `:*`
  // comparison can be used to test whether a key has been defined. For example,
  // to find all objects with `owner` label use: ``` labels.owner:* ``` You can
  // also filter nested fields. For example, you could specify
  // `scheduling.automaticRestart = false` to include instances only if they are
  // not scheduled for automatic restarts. You can use filtering on nested
  // fields to filter based on resource labels. To filter on multiple
  // expressions, provide each separate expression within parentheses. For
  // example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
  // Skylake") ``` By default, each expression is an `AND` expression. However,
  // you can include `AND` and `OR` expressions explicitly. For example: ```
  // (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
  // (scheduling.automaticRestart = true) ``` If you want to use a regular
  // expression, use the `eq` (equal) or `ne` (not equal) operator against a
  // single un-parenthesized expression with or without quotes or against
  // multiple parenthesized expressions. Examples: `fieldname eq unquoted
  // literal` `fieldname eq 'single quoted literal'` `fieldname eq "double
  // quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The
  // literal value is interpreted as a regular expression using Google RE2
  // library syntax. The literal value must match the entire field. For example,
  // to filter for instances that do not end with name "instance", you would use
  // `name ne .*instance`. You cannot combine constraints on multiple fields
  // using regular expressions.
  optional string filter = 1 [json_name = "filter"];

  // The maximum number of results per page that should be returned. If the
  // number of available results is larger than `maxResults`, Compute Engine
  // returns a `nextPageToken` that can be used to get the next page of results
  // in subsequent list requests. Acceptable values are `0` to `500`, inclusive.
  // (Default: `500`)
  optional uint32 max_results = 2 [json_name = "maxResults"];

  // Sorts list results by a certain order. By default, results are returned in
  // alphanumerical order based on the resource name. You can also sort results
  // in descending order based on the creation timestamp using
  // `orderBy="creationTimestamp desc"`. This sorts results based on the
  // `creationTimestamp` field in reverse chronological order (newest result
  // first). Use this to sort resources like operations so that the newest
  // operation is returned first. Currently, only sorting by `name` or
  // `creationTimestamp desc` is supported.
  optional string order_by = 3 [json_name = "orderBy"];

  // Specifies a page token to use. Set `pageToken` to the `nextPageToken`
  // returned by a previous list request to get the next page of results.
  optional string page_token = 4 [json_name = "pageToken"];

  // Project ID for this request.
  string project = 5
      [(google.api.field_behavior) = REQUIRED, json_name = "project"];

  // Opt-in for partial success behavior which provides partial results in case
  // of failure. The default value is false.
  optional bool return_partial_success = 6 [json_name = "returnPartialSuccess"];
}

// Request message for ListNetworkEndpoints.
message ListNetworkEndpointsRequest {
  // A filter expression that filters resources listed in the response. Most
  // Compute resources support two types of filter expressions: expressions that
  // support regular expressions and expressions that follow API improvement
  // proposal AIP-160. These two types of filter expressions cannot be mixed in
  // one request. If you want to use AIP-160, your expression must specify the
  // field name, an operator, and the value that you want to use for filtering.
  // The value must be a string, a number, or a boolean. The operator must be
  // either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are
  // filtering Compute Engine instances, you can exclude instances named
  // `example-instance` by specifying `name != example-instance`. The `:*`
  // comparison can be used to test whether a key has been defined. For example,
  // to find all objects with `owner` label use: ``` labels.owner:* ``` You can
  // also filter nested fields. For example, you could specify
  // `scheduling.automaticRestart = false` to include instances only if they are
  // not scheduled for automatic restarts. You can use filtering on nested
  // fields to filter based on resource labels. To filter on multiple
  // expressions, provide each separate expression within parentheses. For
  // example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
  // Skylake") ``` By default, each expression is an `AND` expression. However,
  // you can include `AND` and `OR` expressions explicitly. For example: ```
  // (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
  // (scheduling.automaticRestart = true) ``` If you want to use a regular
  // expression, use the `eq` (equal) or `ne` (not equal) operator against a
  // single un-parenthesized expression with or without quotes or against
  // multiple parenthesized expressions. Examples: `fieldname eq unquoted
  // literal` `fieldname eq 'single quoted literal'` `fieldname eq "double
  // quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The
  // literal value is interpreted as a regular expression using Google RE2
  // library syntax. The literal value must match the entire field. For example,
  // to filter for instances that do not end with name "instance", you would use
  // `name ne .*instance`. You cannot combine constraints on multiple fields
  // using regular expressions.
  optional string filter = 1 [json_name = "filter"];

  // The maximum number of results per page that should be returned. If the
  // number of available results is larger than `maxResults`, Compute Engine
  // returns a `nextPageToken` that can be used to get the next page of results
  // in subsequent list requests. Acceptable values are `0` to `500`, inclusive.
  // (Default: `500`)
  optional uint32 max_results = 2 [json_name = "maxResults"];

  // The name of the network endpoint group from which you want to generate a
  // list of included network endpoints. It should comply with RFC1035.
  string network_endpoint_group = 3 [
    (google.api.field_behavior) = REQUIRED,
    json_name = "networkEndpointGroup"
  ];

  // Sorts list results by a certain order. By default, results are returned in
  // alphanumerical order based on the resource name. You can also sort results
  // in descending order based on the creation timestamp using
  // `orderBy="creationTimestamp desc"`. This sorts results based on the
  // `creationTimestamp` field in reverse chronological order (newest result
  // first). Use this to sort resources like operations so that the newest
  // operation is returned first. Currently, only sorting by `name` or
  // `creationTimestamp desc` is supported.
  optional string order_by = 4 [json_name = "orderBy"];

  // Specifies a page token to use. Set `pageToken` to the `nextPageToken`
  // returned by a previous list request to get the next page of results.
  optional string page_token = 5 [json_name = "pageToken"];

  // Project ID for this request.
  string project = 6
      [(google.api.field_behavior) = REQUIRED, json_name = "project"];

  // Opt-in for partial success behavior which provides partial results in case
  // of failure. The default value is false.
  optional bool return_partial_success = 7 [json_name = "returnPartialSuccess"];
}
