// Copyright 2026 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
//
//     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.

syntax = "proto3";

package google.cloud.numberregistry.v1alpha;

import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.NumberRegistry.V1Alpha";
option go_package = "cloud.google.com/go/numberregistry/apiv1alpha/numberregistrypb;numberregistrypb";
option java_multiple_files = true;
option java_outer_classname = "CoreProto";
option java_package = "com.google.cloud.numberregistry.v1alpha";
option php_namespace = "Google\\Cloud\\NumberRegistry\\V1alpha";
option ruby_package = "Google::Cloud::NumberRegistry::V1alpha";

// IP version of the Realm.
enum IpVersion {
  // Unspecified IP version.
  IP_VERSION_UNSPECIFIED = 0;

  // IPv4 IP version.
  IPV4 = 1;

  // IPv6 IP version.
  IPV6 = 2;
}

// Enum for the view of the RegistryBook.
enum RegistryBookView {
  // Unspecified view. Defaults to BASIC.
  REGISTRY_BOOK_VIEW_UNSPECIFIED = 0;

  // Basic view.
  BASIC = 1;

  // Full view. Includes the same data as the BASIC view.
  FULL = 2;

  // Aggregate includes data about the child resources of the RegistryBook.
  AGGREGATE = 3;
}

// An IpamAdminScope defines the administrative boundary for IP address
// discovery and management. It configures which platforms and organizational
// scopes are enabled for IP tracking.
message IpamAdminScope {
  option (google.api.resource) = {
    type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    pattern: "projects/{project}/locations/{location}/ipamAdminScopes/{ipam_admin_scope}"
    plural: "ipamAdminScopes"
    singular: "ipamAdminScope"
  };

  // Enum for add-on platforms.
  enum AddOnPlatform {
    option allow_alias = true;

    // Unspecified add-on platform.
    ADD_ON_PLATFORM_UNSPECIFIED = 0;

    // Google Compute Engine.
    COMPUTE_ENGINE = 1;

    // Deprecated: Use COMPUTE_ENGINE instead.
    GCE = 1 [deprecated = true];
  }

  // Enum for IpamAdminScope discovery pipeline state.
  enum DiscoveryPipelineState {
    // Unspecified state.
    DISCOVERY_PIPELINE_STATE_UNSPECIFIED = 0;

    // Internal failure.
    INTERNAL_FAILURE = 1;

    // Failure.
    FAILED = 2;

    // Setup in progress.
    SETUP_IN_PROGRESS = 3;

    // Ready for use.
    READY_FOR_USE = 4;

    // Deleting in progress.
    DELETING_IN_PROGRESS = 5;

    // Updating.
    UPDATING = 6;

    // Recovering.
    RECOVERING = 7;

    // Disabled.
    DISABLED = 8;

    // Deleting completed.
    DELETION_COMPLETED = 9;

    // Cleanup in progress.
    CLEANUP_IN_PROGRESS = 11;

    // Ready for deletion.
    READY_FOR_DELETION = 12;
  }

  // Required. Identifier. The resource name of the IpamAdminScope.
  string name = 1 [
    (google.api.field_behavior) = IDENTIFIER,
    (google.api.field_behavior) = REQUIRED
  ];

  // Required. Add-on platforms that are enabled for this IpamAdminScope. Cloud
  // Number Registry only discovers the IP addresses from the enabled platforms.
  repeated AddOnPlatform enabled_addon_platforms = 2
      [(google.api.field_behavior) = REQUIRED];

  // Required. Administrative scopes enabled for IP address discovery and
  // management. For example, "organizations/1234567890". Minimum of 1 scope is
  // required. In preview, only one organization scope is allowed.
  repeated string scopes = 3 [(google.api.field_behavior) = REQUIRED];

  // Output only. State of resource discovery pipeline.
  DiscoveryPipelineState state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time at which the IpamAdminScope was created.
  google.protobuf.Timestamp create_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time at which the IpamAdminScope was last updated.
  google.protobuf.Timestamp update_time = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. User-defined labels.
  map<string, string> labels = 7 [(google.api.field_behavior) = OPTIONAL];
}

// Request message for the
// [CloudNumberRegistry.ListIpamAdminScopes][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListIpamAdminScopes]
// method.
message ListIpamAdminScopesRequest {
  // Required. The parent resource name, for example `projects/*/locations/*`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filter expression to filter the results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for the
// [CloudNumberRegistry.ListIpamAdminScopes][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListIpamAdminScopes]
// method.
message ListIpamAdminScopesResponse {
  // The list of IpamAdminScopes.
  repeated IpamAdminScope ipam_admin_scopes = 1;

  // A token to retrieve the next page of results, or empty if there are no more
  // results in the list.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Request message for the
// [CloudNumberRegistry.GetIpamAdminScope][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.GetIpamAdminScope]
// method.
message GetIpamAdminScopeRequest {
  // Required. The resource name of the IpamAdminScope to retrieve.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    }
  ];
}

// Request message for the
// [CloudNumberRegistry.CheckAvailabilityIpamAdminScopes][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.CheckAvailabilityIpamAdminScopes]
// method.
message CheckAvailabilityIpamAdminScopesRequest {
  // Required. The parent resource name, for example `projects/*/locations/*`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    }
  ];

  // Required. The administrative scopes to check for availability.
  repeated string scopes = 2 [(google.api.field_behavior) = REQUIRED];
}

// Response message for the
// [CloudNumberRegistry.CheckAvailabilityIpamAdminScopes][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.CheckAvailabilityIpamAdminScopes]
// method.
message CheckAvailabilityIpamAdminScopesResponse {
  // The details of the requested scopes.
  repeated IpamAdminScopeAvailability scope_availabilities = 1;
}

// Availability details for a specific IpamAdminScope.
message IpamAdminScopeAvailability {
  // Enum for the availability of a given scope.
  enum Availability {
    // Unspecified availability.
    AVAILABILITY_UNSPECIFIED = 0;

    // The scope is available.
    AVAILABLE = 1;

    // The scope is not available.
    UNAVAILABLE = 2;
  }

  // The scope of the IpamAdminScope.
  string scope = 1;

  // The admin project of the IpamAdminScope if it exists.
  int64 admin_project = 2;

  // The availability of the scope.
  Availability availability = 3;
}

// Request message for the
// [CloudNumberRegistry.CreateIpamAdminScope][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.CreateIpamAdminScope]
// method.
message CreateIpamAdminScopeRequest {
  // Required. The parent resource name where the IpamAdminScope will be
  // created.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    }
  ];

  // Required. The ID to use for the IpamAdminScope, which will become the final
  // segment of the resource name.
  string ipam_admin_scope_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The IpamAdminScope resource to create.
  IpamAdminScope ipam_admin_scope = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.DisableIpamAdminScope][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.DisableIpamAdminScope]
// method.
message DisableIpamAdminScopeRequest {
  // Required. The resource name of the IpamAdminScope to disable.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    }
  ];

  // Optional. 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. The server will
  // guarantee 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.CleanupIpamAdminScope][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.CleanupIpamAdminScope]
// method.
message CleanupIpamAdminScopeRequest {
  // Required. The resource name of the IpamAdminScope to clean up.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    }
  ];

  // Optional. 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. The server will
  // guarantee 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.UpdateIpamAdminScope][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.UpdateIpamAdminScope]
// method.
message UpdateIpamAdminScopeRequest {
  // Optional. Field mask is used to specify the fields to be overwritten in the
  // IpamAdminScope resource by the update.
  // The fields specified in the update_mask are relative to the resource, not
  // the full request. A field will be overwritten if it is in the mask. If the
  // user does not provide a mask then all fields will be overwritten.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = OPTIONAL];

  // Required. The IpamAdminScope resource to update.
  IpamAdminScope ipam_admin_scope = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.DeleteIpamAdminScope][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.DeleteIpamAdminScope]
// method.
message DeleteIpamAdminScopeRequest {
  // Required. The resource name of the IpamAdminScope to delete.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/IpamAdminScope"
    }
  ];

  // Optional. 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. The server will
  // guarantee 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. If set to true, all associated resources will be deleted.
  bool force = 3 [(google.api.field_behavior) = OPTIONAL];
}

// A RegistryBook organizes and manages IP address space.
// It claims specific scopes (such as projects) and groups related Realms and
// Ranges.
message RegistryBook {
  option (google.api.resource) = {
    type: "cloudnumberregistry.googleapis.com/RegistryBook"
    pattern: "projects/{project}/locations/{location}/registryBooks/{registry_book}"
    plural: "registryBooks"
    singular: "registryBook"
  };

  // Aggregated data for the RegistryBook.
  message AggregatedData {
    // Output only. Number of scopes unique to the RegistryBook.
    int32 unique_scopes_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. Number of discovered Realms in the RegistryBook.
    int32 discovered_realms_count = 2
        [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. Number of DiscoveredRanges in the RegistryBook.
    int32 discovered_ranges_count = 3
        [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. Number of custom Realms in the RegistryBook.
    int32 custom_realms_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. Number of CustomRanges in the RegistryBook.
    int32 custom_ranges_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  }

  // Required. Identifier. The resource name of the RegistryBook.
  string name = 1 [
    (google.api.field_behavior) = IDENTIFIER,
    (google.api.field_behavior) = REQUIRED
  ];

  // Output only. The time at which the RegistryBook was created.
  google.protobuf.Timestamp create_time = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time at which the RegistryBook was last updated.
  google.protobuf.Timestamp update_time = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. User-defined labels.
  map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. List of scopes claimed by the RegistryBook. In Preview, Only
  // project scope is supported. Each scope is in the format of
  // projects/{project}. Each scope can only be claimed once.
  repeated string claimed_scopes = 5 [(google.api.field_behavior) = OPTIONAL];

  // Output only. Whether the RegistryBook is the default one.
  bool is_default = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Aggregated data for the RegistryBook. Populated only when the
  // view is AGGREGATE.
  AggregatedData aggregated_data = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for the
// [CloudNumberRegistry.ListRegistryBooks][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListRegistryBooks]
// method.
message ListRegistryBooksRequest {
  // Required. The parent resource name, for example `projects/*/locations/*`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/RegistryBook"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filter expression to filter the results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The view of the RegistryBook to retrieve.
  RegistryBookView view = 6 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for the
// [CloudNumberRegistry.ListRegistryBooks][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListRegistryBooks]
// method.
message ListRegistryBooksResponse {
  // The list of RegistryBook
  repeated RegistryBook registry_books = 1;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Request message for the
// [CloudNumberRegistry.GetRegistryBook][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.GetRegistryBook]
// method.
message GetRegistryBookRequest {
  // Required. The resource name of the RegistryBook to retrieve.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/RegistryBook"
    }
  ];

  // Optional. The view of the RegistryBook to retrieve.
  RegistryBookView view = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Request message for the
// [CloudNumberRegistry.SearchIpResources][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.SearchIpResources]
// method.
message SearchIpResourcesRequest {
  // The type of resources to search for.
  enum SearchResourceType {
    // Unspecified search type.
    SEARCH_RESOURCE_TYPE_UNSPECIFIED = 0;

    // Search for Ranges.
    RANGES = 1;

    // Search for Realms.
    REALMS = 2;
  }

  // Required. The resource name of the RegistryBook to search in.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/RegistryBook"
    }
  ];

  // Optional. Search query. This string filters resources in an AIP-160-like
  // format. It has some limitations. You can only specify top level
  // conjunctions or attribute level negations. Each restriction can only be
  // used once except the attribute restriction.
  //
  // The available restrictions for Ranges are:
  // - `realm`: The Realm name to search in.
  // - `ip_address`: The IP address to search for within Ranges.
  // - `ip_version`: The IP version to filter by (e.g., "IPV4", "IPV6").
  // - `parent_range`: The parent Range of the Range to search for.
  // - `attribute_text`: The attribute text to search for within Ranges.
  // - `attribute`: The attribute key and value to filter by.
  //
  // The available restrictions for Realms are:
  // - `ip_version`: The IP version to search for.
  // - `management_type`: The management type of the Realm (e.g., "CNR",
  // "USER").
  //
  // Only one of attribute_text or multiple attribute filters can be specified.
  // Examples:
  // - `realm=test-realm`
  // - `realm=test-realm AND ip_address=10.0.0.0`
  // - `realm=test-realm AND ip_version=IPV6`
  // - `realm=test-realm AND attribute_text=test`
  // - `ip_address=10.0.0.0 AND attribute:(key1=value1) AND
  // attribute:(key2=value2)`
  // - `attribute_text=test AND
  // parent_range=projects/123/locations/global/discoveredRanges/test-parent-range`
  // - `management_type=CNR`
  string query = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  // Supported sort fields are:
  // - `name`: Sort alphabetically by the resource name.
  // - `create_time`: Sort by the creation timestamp of the resource.
  // - `update_time`: Sort by the last update timestamp of the resource.
  //
  // Supported directions are `asc` (ascending) and `desc` (descending).
  // If unspecified, direction defaults to `asc`.
  // Only sorting by a single field is supported.
  string order_by = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 5 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether to show the utilization of the Ranges in the response.
  bool show_utilization = 6 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The type of resources to search for. If not specified, the server
  // will return Ranges.
  repeated SearchResourceType search_resource_types = 7
      [(google.api.field_behavior) = OPTIONAL];
}

// Represents either a CustomRange or a DiscoveredRange.
message Range {
  // The Range.
  oneof range {
    // A CustomRange.
    CustomRange custom_range = 1;

    // A DiscoveredRange.
    DiscoveredRange discovered_range = 2;
  }

  // The utilization of the Range.
  RangeUtilization utilization = 3;
}

// Response message for the
// [CloudNumberRegistry.SearchIpResources][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.SearchIpResources]
// method.
message SearchIpResourcesResponse {
  // A result matching the search query, which can be either a Range or a Realm.
  message SearchIpResourcesResult {
    // Either a Range or a Realm matching the search query.
    oneof result {
      // A Range matching the search query.
      Range range = 1;

      // A Realm matching the search query.
      Realm realm = 2;
    }
  }

  // Deprecated: Use results field instead.
  // The list of Ranges matching the search query.
  repeated Range ranges = 1 [deprecated = true];

  // The list of results matching the search query.
  repeated SearchIpResourcesResult results = 4;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Request message for the
// [CloudNumberRegistry.CreateRegistryBook][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.CreateRegistryBook]
// method.
message CreateRegistryBookRequest {
  // Required. The parent resource name where the RegistryBook will be created.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/RegistryBook"
    }
  ];

  // Required. The ID to use for the RegistryBook, which will become the final
  // segment of the resource name.
  string registry_book_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The RegistryBook resource to create.
  RegistryBook registry_book = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.UpdateRegistryBook][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.UpdateRegistryBook]
// method.
message UpdateRegistryBookRequest {
  // Optional. Field mask is used to specify the fields to be overwritten in the
  // RegistryBook resource by the update.
  // The fields specified in the update_mask are relative to the resource, not
  // the full request. A field will be overwritten if it is in the mask. If the
  // user does not provide a mask then all fields will be overwritten.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = OPTIONAL];

  // Required. The RegistryBook resource to update.
  RegistryBook registry_book = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.DeleteRegistryBook][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.DeleteRegistryBook]
// method.
message DeleteRegistryBookRequest {
  // Required. The resource name of the RegistryBook to delete.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/RegistryBook"
    }
  ];

  // Optional. 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. The server will
  // guarantee 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. If set to true, all associated resources will be deleted.
  bool force = 3 [(google.api.field_behavior) = OPTIONAL];
}

// A Realm represents a distinct network domain or security zone.
// It groups Ranges that share the same traffic and management characteristics.
// All the ranges in a Realm are routable to each other, meaning that they
// cannot overlap.
message Realm {
  option (google.api.resource) = {
    type: "cloudnumberregistry.googleapis.com/Realm"
    pattern: "projects/{project}/locations/{location}/realms/{realm}"
    plural: "realms"
    singular: "realm"
  };

  // Aggregated data for the Realm.
  message RealmAggregatedData {
    // Output only. Number of DiscoveredRanges in the Realm.
    int32 discovered_ranges_count = 1
        [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. Number of CustomRanges in the Realm.
    int32 custom_ranges_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  }

  // Traffic type of the Realm.
  enum TrafficType {
    // Unspecified traffic type.
    TRAFFIC_TYPE_UNSPECIFIED = 0;

    // Unset traffic type.
    UNSET = 1;

    // Internet traffic.
    INTERNET = 2;

    // Private traffic.
    PRIVATE = 3;

    // Linklocal traffic.
    LINKLOCAL = 4;
  }

  // Management type of the Realm.
  enum ManagementType {
    // Unspecified management type.
    MANAGEMENT_TYPE_UNSPECIFIED = 0;

    // Managed by Cloud Number Registry.
    CNR = 1;

    // Managed by User.
    USER = 2;
  }

  // Enum for the view of the Realm.
  enum RealmView {
    // Unspecified view. Defaults to BASIC.
    REALM_VIEW_UNSPECIFIED = 0;

    // Basic view.
    BASIC = 1;

    // Full view. Includes the same data as the BASIC view.
    FULL = 2;

    // Aggregate includes data about the child resources of the Realm.
    AGGREGATE = 3;
  }

  // Required. Identifier. The resource name of the Realm.
  string name = 1 [
    (google.api.field_behavior) = IDENTIFIER,
    (google.api.field_behavior) = REQUIRED
  ];

  // Required. Traffic type of the Realm.
  TrafficType traffic_type = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. Management type of the Realm.
  ManagementType management_type = 3 [(google.api.field_behavior) = REQUIRED];

  // Required. Name of the RegistryBook that claims the Realm.
  string registry_book = 4 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/RegistryBook"
    }
  ];

  // Output only. Discovery metadata of the Realm.
  DiscoveryMetadata discovery_metadata = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time at which the Realm was created.
  google.protobuf.Timestamp create_time = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time at which the Realm was last updated.
  google.protobuf.Timestamp update_time = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. User-defined labels.
  map<string, string> labels = 8 [(google.api.field_behavior) = OPTIONAL];

  // Optional. IP version of the Realm.
  IpVersion ip_version = 9 [(google.api.field_behavior) = OPTIONAL];

  // Output only. Aggregated data for the Realm. Populated only when the view is
  // AGGREGATE.
  RealmAggregatedData aggregated_data = 10
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Metadata about a discovered resource, tracking event times, state, and source
// information.
message DiscoveryMetadata {
  // The state of the resource.
  enum ResourceState {
    // Unspecified state.
    RESOURCE_STATE_UNSPECIFIED = 0;

    // The resource is in an invalid state.
    INVALID = 1;

    // The resource exists in the backing store (is not tombstoned or
    // completely missing) and there were no failures reading out the resource
    // level metadata.
    EXISTS = 2;

    // Resource does not exist or has been deleted or soft-deleted.
    DOES_NOT_EXIST = 3;

    // There was an error reading out the resource level metadata.
    ERROR = 4;
  }

  // Output only. The time when the event happened.
  google.protobuf.Timestamp event_time = 1
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time when the resource was created.
  google.protobuf.Timestamp create_time = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time when the resource was last modified.
  google.protobuf.Timestamp update_time = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The state of the resource.
  ResourceState state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The resource name of the discovered resource, should be
  // API-agnostic. Example: "projects/{project_number}/networks/{network_id}".
  string resource = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The resource uri of the discovered resource.
  string resource_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The canonical google.aip.dev/122 name of the source resource.
  string source_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. A single source resource can be the source of multiple CNR
  // resources. This sub_id is used to distinguish between the different CNR
  // resources derived from the same upstream resource. For example, a single
  // subnetwork can be the source of multiple Ranges, one for each protocol. In
  // this case, the sub_id could be "private-ipv4" or "private-ipv6".
  string source_sub_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for the
// [CloudNumberRegistry.ListRealms][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListRealms]
// method.
message ListRealmsRequest {
  // Required. The parent resource name, for example `projects/*/locations/*`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/Realm"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filter expression to filter the results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The view of the Realm to retrieve.
  Realm.RealmView view = 6 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for the
// [CloudNumberRegistry.ListRealms][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListRealms]
// method.
message ListRealmsResponse {
  // The list of Realms.
  repeated Realm realms = 1;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Request message for the
// [CloudNumberRegistry.GetRealm][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.GetRealm]
// method.
message GetRealmRequest {
  // Required. The resource name of the Realm to retrieve.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/Realm"
    }
  ];

  // Optional. The view of the Realm to retrieve.
  Realm.RealmView view = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Request message for the
// [CloudNumberRegistry.CreateRealm][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.CreateRealm]
// method.
message CreateRealmRequest {
  // Required. The parent resource name where the Realm will be created.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/Realm"
    }
  ];

  // Required. The ID to use for the Realm, which will become the final segment
  // of the resource name.
  string realm_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The Realm resource to create.
  Realm realm = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  string request_id = 4 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.UpdateRealm][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.UpdateRealm]
// method.
message UpdateRealmRequest {
  // Optional. Field mask is used to specify the fields to be overwritten in the
  // Realm resource by the update.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = OPTIONAL];

  // Required. The Realm resource to update.
  Realm realm = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  string request_id = 3 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.DeleteRealm][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.DeleteRealm]
// method.
message DeleteRealmRequest {
  // Required. The resource name of the Realm to delete.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/Realm"
    }
  ];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes after the first request.
  string request_id = 2 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. If set to true, all associated resources will be deleted.
  bool force = 3 [(google.api.field_behavior) = OPTIONAL];
}

// A DiscoveredRange represents an IP address range automatically detected by
// the discovery pipeline.
message DiscoveredRange {
  option (google.api.resource) = {
    type: "cloudnumberregistry.googleapis.com/DiscoveredRange"
    pattern: "projects/{project}/locations/{location}/discoveredRanges/{discovered_range}"
    plural: "discoveredRanges"
    singular: "discoveredRange"
  };

  // The IP CIDR range of the DiscoveredRange.
  oneof ip_cidr_range {
    // Optional. The IPv4 CIDR range of the DiscoveredRange.
    string ipv4_cidr_range = 2 [(google.api.field_behavior) = OPTIONAL];

    // Optional. The IPv6 CIDR range of the DiscoveredRange.
    string ipv6_cidr_range = 3 [(google.api.field_behavior) = OPTIONAL];
  }

  // Required. Identifier. The resource name of the DiscoveredRange, in the
  // format
  // `projects/{project}/locations/{location}/discoveredRanges/{discovered_range}`.
  string name = 1 [
    (google.api.field_behavior) = IDENTIFIER,
    (google.api.field_behavior) = REQUIRED
  ];

  // Optional. The Realm of the DiscoveredRange.
  string realm = 4 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/Realm"
    }
  ];

  // Optional. The resource name of the parent DiscoveredRange, in the format
  // `projects/{project}/locations/{location}/discoveredRanges/{discovered_range}`.
  string parent_range = 6 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/DiscoveredRange"
    }
  ];

  // Output only. The RegistryBook of the DiscoveredRange.
  string registry_book = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Description of the DiscoveredRange.
  string description = 7 [(google.api.field_behavior) = OPTIONAL];

  // Output only. Owner metadata for this DiscoveredRange.
  // A unique set of metadata is associated with each DiscoveredRange.
  // If an IP range is shared by multiple resources (e.g., an Address resource
  // and an Instance resource, or multiple ForwardingRules),separate
  // DiscoveredRanges are created, each with a distinct owner. This ensures each
  // DiscoveredRange has its own unique set of attributes, labels, create time
  // and update time.
  DiscoveryMetadata discovery_metadata = 8
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The attributes of the DiscoveredRange.
  repeated Attribute attributes = 9 [(google.api.field_behavior) = OPTIONAL];

  // Output only. The time at which the DiscoveredRange was created.
  google.protobuf.Timestamp create_time = 10
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time at which the DiscoveredRange was last updated.
  google.protobuf.Timestamp update_time = 11
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. User-defined labels.
  map<string, string> labels = 12 [(google.api.field_behavior) = OPTIONAL];

  // Output only. If true, allows child DiscoveredRanges of this DiscoveredRange
  // to overlap with each other.
  bool child_cidr_overlap_allowed = 13
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for the
// [CloudNumberRegistry.ListDiscoveredRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListDiscoveredRanges]
// method.
message ListDiscoveredRangesRequest {
  // Required. The parent resource name, for example `projects/*/locations/*`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/DiscoveredRange"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filter expression to filter the results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for the
// [CloudNumberRegistry.ListDiscoveredRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListDiscoveredRanges]
// method.
message ListDiscoveredRangesResponse {
  // The list of DiscoveredRanges.
  repeated DiscoveredRange discovered_ranges = 1;

  // A token to retrieve the next page of results, or empty if there are no more
  // results in the list.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Request message for the
// [CloudNumberRegistry.GetDiscoveredRange][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.GetDiscoveredRange]
// method.
message GetDiscoveredRangeRequest {
  // Required. The resource name of the DiscoveredRange to retrieve.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/DiscoveredRange"
    }
  ];
}

// Request message for the
// [CloudNumberRegistry.FindDiscoveredRangeFreeIpRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.FindDiscoveredRangeFreeIpRanges]
// method.
message FindDiscoveredRangeFreeIpRangesRequest {
  // Required. The resource name of the DiscoveredRange to search within.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/DiscoveredRange"
    }
  ];

  // Required. The prefix length of the free IP ranges to find.
  int32 cidr_prefix_length = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. The number of free IP ranges to find.
  int32 range_count = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Response message for the
// [CloudNumberRegistry.FindDiscoveredRangeFreeIpRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.FindDiscoveredRangeFreeIpRanges]
// method.
message FindDiscoveredRangeFreeIpRangesResponse {
  // Output only. The free IP CIDR ranges found.
  repeated string free_ip_cidr_ranges = 1
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// A CustomRange represents a user-defined IP address range.
message CustomRange {
  option (google.api.resource) = {
    type: "cloudnumberregistry.googleapis.com/CustomRange"
    pattern: "projects/{project}/locations/{location}/customRanges/{custom_range}"
    plural: "customRanges"
    singular: "customRange"
  };

  // The IP CIDR range of the CustomRange.
  oneof ip_cidr_range {
    // Optional. The IPv4 CIDR range of the CustomRange.
    string ipv4_cidr_range = 2 [(google.api.field_behavior) = OPTIONAL];

    // Optional. The IPv6 CIDR range of the CustomRange.
    string ipv6_cidr_range = 3 [(google.api.field_behavior) = OPTIONAL];
  }

  // Required. Identifier. The resource name of the CustomRange, in the format
  // `projects/{project}/locations/{location}/customRanges/{custom_range}`.
  string name = 1 [
    (google.api.field_behavior) = IDENTIFIER,
    (google.api.field_behavior) = REQUIRED
  ];

  // Optional. The resource name of the Realm associated with the CustomRange,
  // in the format `projects/{project}/locations/{location}/realms/{realm}`. The
  // Realm must be in the same project as the CustomRange. This field must not
  // be set if the `parent_range` field is set, as the Realm will be inherited
  // from the parent CustomRange.
  string realm = 4 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/Realm"
    }
  ];

  // Optional. The resource name of the parent CustomRange, in the format
  // `projects/{project}/locations/{location}/customRanges/{custom_range}`.
  // If specified, the parent CustomRange must be in the same RegistryBook.
  // This field is mutually exclusive with the `realm` field, as the Realm is
  // inherited from the parent CustomRange.
  string parent_range = 6 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/CustomRange"
    }
  ];

  // Output only. The RegistryBook of the CustomRange. This field is inherited
  // from the Realm or parent CustomRange depending on which one is specified.
  string registry_book = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The attributes of the CustomRange.
  repeated Attribute attributes = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The description of the CustomRange.
  string description = 8 [(google.api.field_behavior) = OPTIONAL];

  // Optional. User-defined labels.
  map<string, string> labels = 9 [(google.api.field_behavior) = OPTIONAL];
}

// A key-value pair representing a custom attribute associated with a resource.
message Attribute {
  // Required. The key of the attribute.
  string key = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The value of the attribute.
  string value = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request message for the
// [CloudNumberRegistry.ListCustomRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListCustomRanges]
// method.
message ListCustomRangesRequest {
  // Required. The parent resource name, for example `projects/*/locations/*`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/CustomRange"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filter expression to filter the results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for the
// [CloudNumberRegistry.ListCustomRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ListCustomRanges]
// method.
message ListCustomRangesResponse {
  // The list of CustomRanges.
  repeated CustomRange custom_ranges = 1;

  // A token to retrieve the next page of results, or empty if there are no more
  // results in the list.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Request message for the
// [CloudNumberRegistry.GetCustomRange][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.GetCustomRange]
// method.
message GetCustomRangeRequest {
  // Required. The resource name of the CustomRange to retrieve.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/CustomRange"
    }
  ];
}

// Request message for the
// [CloudNumberRegistry.ShowCustomRangeUtilization][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ShowCustomRangeUtilization]
// method.
message ShowCustomRangeUtilizationRequest {
  // Required. The resource name of the CustomRange.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/CustomRange"
    }
  ];
}

// Response message for the
// [CloudNumberRegistry.ShowCustomRangeUtilization][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ShowCustomRangeUtilization]
// method.
message ShowCustomRangeUtilizationResponse {
  // The CustomRange resource.
  CustomRange custom_range = 1;

  // The utilization details of the CustomRange.
  RangeUtilization range_utilization = 2;
}

// Request message for the
// [CloudNumberRegistry.ShowDiscoveredRangeUtilization][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ShowDiscoveredRangeUtilization]
// method.
message ShowDiscoveredRangeUtilizationRequest {
  // Required. The resource name of the DiscoveredRange.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/DiscoveredRange"
    }
  ];
}

// Response message for the
// [CloudNumberRegistry.ShowDiscoveredRangeUtilization][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.ShowDiscoveredRangeUtilization]
// method.
message ShowDiscoveredRangeUtilizationResponse {
  // The DiscoveredRange resource.
  DiscoveredRange discovered_range = 1;

  // The utilization details of the DiscoveredRange.
  RangeUtilization range_utilization = 2;
}

// Utilization metrics for an IP Range, including consumed and produced address
// counts.
message RangeUtilization {
  // Output only. The total number of IP addresses consumed in the Range.
  string total_consumed = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The total number of IP addresses produced in the Range.
  string total_produced = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The usage of the Range as a percentage. This is marked as
  // optional so that we have presence tracking and API responses show 0.0
  // instead of NULL.
  optional double usage = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for the
// [CloudNumberRegistry.CreateCustomRange][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.CreateCustomRange]
// method.
message CreateCustomRangeRequest {
  // Required. The parent resource name where the CustomRange will be created.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "cloudnumberregistry.googleapis.com/CustomRange"
    }
  ];

  // Required. The ID to use for the CustomRange, which will become the final
  // segment of the resource name.
  string custom_range_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The CustomRange resource to create.
  CustomRange custom_range = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.UpdateCustomRange][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.UpdateCustomRange]
// method.
message UpdateCustomRangeRequest {
  // Optional. Field mask is used to specify the fields to be overwritten in the
  // CustomRange resource by the update.
  // The fields specified in the update_mask are relative to the resource, not
  // the full request. A field will be overwritten if it is in the mask. If the
  // user does not provide a mask then all fields will be overwritten.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = OPTIONAL];

  // Required. The CustomRange resource to update.
  CustomRange custom_range = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Request message for the
// [CloudNumberRegistry.DeleteCustomRange][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.DeleteCustomRange]
// method.
message DeleteCustomRangeRequest {
  // Required. The resource name of the CustomRange to delete.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/CustomRange"
    }
  ];

  // Optional. 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. The server will
  // guarantee 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. If set to true, all associated resources will be deleted.
  bool force = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Request message for the
// [CloudNumberRegistry.FindCustomRangeFreeIpRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.FindCustomRangeFreeIpRanges]
// method.
message FindCustomRangeFreeIpRangesRequest {
  // Required. The resource name of the CustomRange to search within.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudnumberregistry.googleapis.com/CustomRange"
    }
  ];

  // Required. The prefix length of the free IP ranges to find.
  int32 cidr_prefix_length = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. The number of free IP ranges to find.
  int32 range_count = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. 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. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and 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_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Response message for the
// [CloudNumberRegistry.FindCustomRangeFreeIpRanges][google.cloud.numberregistry.v1alpha.CloudNumberRegistry.FindCustomRangeFreeIpRanges]
// method.
message FindCustomRangeFreeIpRangesResponse {
  // Output only. The free IP CIDR ranges found.
  repeated string free_ip_cidr_ranges = 1
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
