// Copyright 2022 Luca Casonato. All rights reserved. MIT license.
/**
 * Cloud Number Registry API Client for Deno
 * =========================================
 * 
 * 
 * 
 * Docs: https://docs.cloud.google.com/number-registry/reference/rest
 * Source: https://googleapis.deno.dev/v1/cloudnumberregistry:v1alpha.ts
 */

import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts";
export { auth, GoogleAuth };
export type { CredentialsClient };

export class CloudNumberRegistry {
  #client: CredentialsClient | undefined;
  #baseUrl: string;

  constructor(client?: CredentialsClient, baseUrl: string = "https://cloudnumberregistry.googleapis.com/") {
    this.#client = client;
    this.#baseUrl = baseUrl;
  }

  /**
   * Creates a new CustomRange in a given project and location.
   *
   * @param parent Required. Value for parent.
   */
  async projectsLocationsCustomRangesCreate(parent: string, req: CustomRange, opts: ProjectsLocationsCustomRangesCreateOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/customRanges`);
    if (opts.customRangeId !== undefined) {
      url.searchParams.append("customRangeId", String(opts.customRangeId));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as Operation;
  }

  /**
   * Deletes a single CustomRange.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsCustomRangesDelete(name: string, opts: ProjectsLocationsCustomRangesDeleteOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.force !== undefined) {
      url.searchParams.append("force", String(opts.force));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "DELETE",
    });
    return data as Operation;
  }

  /**
   * Finds free IP ranges in a single CustomRange.
   *
   * @param name Required. Name of the CustomRange.
   */
  async projectsLocationsCustomRangesFindFreeIpRanges(name: string, opts: ProjectsLocationsCustomRangesFindFreeIpRangesOptions = {}): Promise<FindCustomRangeFreeIpRangesResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:findFreeIpRanges`);
    if (opts.cidrPrefixLength !== undefined) {
      url.searchParams.append("cidrPrefixLength", String(opts.cidrPrefixLength));
    }
    if (opts.rangeCount !== undefined) {
      url.searchParams.append("rangeCount", String(opts.rangeCount));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as FindCustomRangeFreeIpRangesResponse;
  }

  /**
   * Gets details of a single CustomRange.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsCustomRangesGet(name: string): Promise<CustomRange> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as CustomRange;
  }

  /**
   * Lists CustomRanges in a given project and location.
   *
   * @param parent Required. Parent value for ListCustomRangesRequest
   */
  async projectsLocationsCustomRangesList(parent: string, opts: ProjectsLocationsCustomRangesListOptions = {}): Promise<ListCustomRangesResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/customRanges`);
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.orderBy !== undefined) {
      url.searchParams.append("orderBy", String(opts.orderBy));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ListCustomRangesResponse;
  }

  /**
   * Updates the parameters of a single CustomRange.
   *
   * @param name Required. Identifier. name of resource
   */
  async projectsLocationsCustomRangesPatch(name: string, req: CustomRange, opts: ProjectsLocationsCustomRangesPatchOptions = {}): Promise<Operation> {
    opts = serializeProjectsLocationsCustomRangesPatchOptions(opts);
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    if (opts.updateMask !== undefined) {
      url.searchParams.append("updateMask", String(opts.updateMask));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "PATCH",
      body,
    });
    return data as Operation;
  }

  /**
   * Gets the details of a single CustomRange and its utilization.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsCustomRangesShowUtilization(name: string): Promise<ShowCustomRangeUtilizationResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:showUtilization`);
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ShowCustomRangeUtilizationResponse;
  }

  /**
   * Finds free IP ranges in a single DiscoveredRange.
   *
   * @param name Required. Name of the DiscoveredRange.
   */
  async projectsLocationsDiscoveredRangesFindFreeIpRanges(name: string, opts: ProjectsLocationsDiscoveredRangesFindFreeIpRangesOptions = {}): Promise<FindDiscoveredRangeFreeIpRangesResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:findFreeIpRanges`);
    if (opts.cidrPrefixLength !== undefined) {
      url.searchParams.append("cidrPrefixLength", String(opts.cidrPrefixLength));
    }
    if (opts.rangeCount !== undefined) {
      url.searchParams.append("rangeCount", String(opts.rangeCount));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as FindDiscoveredRangeFreeIpRangesResponse;
  }

  /**
   * Gets details of a single DiscoveredRange.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsDiscoveredRangesGet(name: string): Promise<DiscoveredRange> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as DiscoveredRange;
  }

  /**
   * Lists DiscoveredRanges in a given project and location.
   *
   * @param parent Required. Parent value for ListDiscoveredRangesRequest
   */
  async projectsLocationsDiscoveredRangesList(parent: string, opts: ProjectsLocationsDiscoveredRangesListOptions = {}): Promise<ListDiscoveredRangesResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/discoveredRanges`);
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.orderBy !== undefined) {
      url.searchParams.append("orderBy", String(opts.orderBy));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ListDiscoveredRangesResponse;
  }

  /**
   * Gets the details of a single DiscoveredRange and its utilization.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsDiscoveredRangesShowUtilization(name: string): Promise<ShowDiscoveredRangeUtilizationResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:showUtilization`);
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ShowDiscoveredRangeUtilizationResponse;
  }

  /**
   * Gets information about a location.
   *
   * @param name Resource name for the location.
   */
  async projectsLocationsGet(name: string): Promise<Location> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as Location;
  }

  /**
   * Checks the availability of IPAM admin scopes in a given project and
   * location.
   *
   * @param parent Required. Parent value for the IpamAdminScopes.
   */
  async projectsLocationsIpamAdminScopesCheckAvailability(parent: string, opts: ProjectsLocationsIpamAdminScopesCheckAvailabilityOptions = {}): Promise<CheckAvailabilityIpamAdminScopesResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/ipamAdminScopes:checkAvailability`);
    if (opts.scopes !== undefined) {
      url.searchParams.append("scopes", String(opts.scopes));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return deserializeCheckAvailabilityIpamAdminScopesResponse(data);
  }

  /**
   * Cleans up a single IpamAdminScope.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsIpamAdminScopesCleanup(name: string, req: CleanupIpamAdminScopeRequest): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:cleanup`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as Operation;
  }

  /**
   * Creates a new IpamAdminScope in a given project and location.
   *
   * @param parent Required. Value for parent.
   */
  async projectsLocationsIpamAdminScopesCreate(parent: string, req: IpamAdminScope, opts: ProjectsLocationsIpamAdminScopesCreateOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/ipamAdminScopes`);
    if (opts.ipamAdminScopeId !== undefined) {
      url.searchParams.append("ipamAdminScopeId", String(opts.ipamAdminScopeId));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as Operation;
  }

  /**
   * Deletes a single IpamAdminScope.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsIpamAdminScopesDelete(name: string, opts: ProjectsLocationsIpamAdminScopesDeleteOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.force !== undefined) {
      url.searchParams.append("force", String(opts.force));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "DELETE",
    });
    return data as Operation;
  }

  /**
   * Disables a single IpamAdminScope.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsIpamAdminScopesDisable(name: string, req: DisableIpamAdminScopeRequest): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:disable`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as Operation;
  }

  /**
   * Gets details of a single IpamAdminScope.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsIpamAdminScopesGet(name: string): Promise<IpamAdminScope> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as IpamAdminScope;
  }

  /**
   * List all IPAM admin scopes in a given project and location.
   *
   * @param parent Required. Parent value for ListIpamAdminScopesRequest
   */
  async projectsLocationsIpamAdminScopesList(parent: string, opts: ProjectsLocationsIpamAdminScopesListOptions = {}): Promise<ListIpamAdminScopesResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/ipamAdminScopes`);
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.orderBy !== undefined) {
      url.searchParams.append("orderBy", String(opts.orderBy));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ListIpamAdminScopesResponse;
  }

  /**
   * Updates the parameters of a single IpamAdminScope.
   *
   * @param name Required. Identifier. name of resource
   */
  async projectsLocationsIpamAdminScopesPatch(name: string, req: IpamAdminScope, opts: ProjectsLocationsIpamAdminScopesPatchOptions = {}): Promise<Operation> {
    opts = serializeProjectsLocationsIpamAdminScopesPatchOptions(opts);
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    if (opts.updateMask !== undefined) {
      url.searchParams.append("updateMask", String(opts.updateMask));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "PATCH",
      body,
    });
    return data as Operation;
  }

  /**
   * Lists information about the supported locations for this service. This
   * method lists locations based on the resource scope provided in the
   * ListLocationsRequest.name field: * **Global locations**: If `name` is
   * empty, the method lists the public locations available to all projects. *
   * **Project-specific locations**: If `name` follows the format
   * `projects/{project}`, the method lists locations visible to that specific
   * project. This includes public, private, or other project-specific locations
   * enabled for the project. For gRPC and client library implementations, the
   * resource name is passed as the `name` field. For direct service calls, the
   * resource name is incorporated into the request path based on the specific
   * service implementation and version.
   *
   * @param name The resource that owns the locations collection, if applicable.
   */
  async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise<ListLocationsResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }/locations`);
    if (opts.extraLocationTypes !== undefined) {
      url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes));
    }
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ListLocationsResponse;
  }

  /**
   * Starts asynchronous cancellation on a long-running operation. The server
   * makes a best effort to cancel the operation, but success is not guaranteed.
   * If the server doesn't support this method, it returns
   * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
   * other methods to check whether the cancellation succeeded or whether the
   * operation completed despite cancellation. On successful cancellation, the
   * operation is not deleted; instead, it becomes an operation with an
   * Operation.error value with a google.rpc.Status.code of `1`, corresponding
   * to `Code.CANCELLED`.
   *
   * @param name The name of the operation resource to be cancelled.
   */
  async projectsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise<Empty> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:cancel`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as Empty;
  }

  /**
   * Deletes a long-running operation. This method indicates that the client is
   * no longer interested in the operation result. It does not cancel the
   * operation. If the server doesn't support this method, it returns
   * `google.rpc.Code.UNIMPLEMENTED`.
   *
   * @param name The name of the operation resource to be deleted.
   */
  async projectsLocationsOperationsDelete(name: string): Promise<Empty> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    const data = await request(url.href, {
      client: this.#client,
      method: "DELETE",
    });
    return data as Empty;
  }

  /**
   * Gets the latest state of a long-running operation. Clients can use this
   * method to poll the operation result at intervals as recommended by the API
   * service.
   *
   * @param name The name of the operation resource.
   */
  async projectsLocationsOperationsGet(name: string): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as Operation;
  }

  /**
   * Lists operations that match the specified filter in the request. If the
   * server doesn't support this method, it returns `UNIMPLEMENTED`.
   *
   * @param name The name of the operation's parent resource.
   */
  async projectsLocationsOperationsList(name: string, opts: ProjectsLocationsOperationsListOptions = {}): Promise<ListOperationsResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }/operations`);
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    if (opts.returnPartialSuccess !== undefined) {
      url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ListOperationsResponse;
  }

  /**
   * Creates a new Realm in a given project and location.
   *
   * @param parent Required. Value for parent.
   */
  async projectsLocationsRealmsCreate(parent: string, req: Realm, opts: ProjectsLocationsRealmsCreateOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/realms`);
    if (opts.realmId !== undefined) {
      url.searchParams.append("realmId", String(opts.realmId));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as Operation;
  }

  /**
   * Deletes a single Realm.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsRealmsDelete(name: string, opts: ProjectsLocationsRealmsDeleteOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.force !== undefined) {
      url.searchParams.append("force", String(opts.force));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "DELETE",
    });
    return data as Operation;
  }

  /**
   * Gets details of a single Realm.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsRealmsGet(name: string, opts: ProjectsLocationsRealmsGetOptions = {}): Promise<Realm> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.view !== undefined) {
      url.searchParams.append("view", String(opts.view));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as Realm;
  }

  /**
   * Lists Realms in a given project and location.
   *
   * @param parent Required. Parent value for ListRealmsRequest
   */
  async projectsLocationsRealmsList(parent: string, opts: ProjectsLocationsRealmsListOptions = {}): Promise<ListRealmsResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/realms`);
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.orderBy !== undefined) {
      url.searchParams.append("orderBy", String(opts.orderBy));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    if (opts.view !== undefined) {
      url.searchParams.append("view", String(opts.view));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ListRealmsResponse;
  }

  /**
   * Updates the parameters of a single Realm.
   *
   * @param name Required. Identifier. Unique name/ID of the realm
   */
  async projectsLocationsRealmsPatch(name: string, req: Realm, opts: ProjectsLocationsRealmsPatchOptions = {}): Promise<Operation> {
    opts = serializeProjectsLocationsRealmsPatchOptions(opts);
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    if (opts.updateMask !== undefined) {
      url.searchParams.append("updateMask", String(opts.updateMask));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "PATCH",
      body,
    });
    return data as Operation;
  }

  /**
   * Creates a new RegistryBook in a given project and location.
   *
   * @param parent Required. Value for parent.
   */
  async projectsLocationsRegistryBooksCreate(parent: string, req: RegistryBook, opts: ProjectsLocationsRegistryBooksCreateOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/registryBooks`);
    if (opts.registryBookId !== undefined) {
      url.searchParams.append("registryBookId", String(opts.registryBookId));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as Operation;
  }

  /**
   * Deletes a single RegistryBook.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsRegistryBooksDelete(name: string, opts: ProjectsLocationsRegistryBooksDeleteOptions = {}): Promise<Operation> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.force !== undefined) {
      url.searchParams.append("force", String(opts.force));
    }
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "DELETE",
    });
    return data as Operation;
  }

  /**
   * Gets details of a single RegistryBook.
   *
   * @param name Required. Name of the resource
   */
  async projectsLocationsRegistryBooksGet(name: string, opts: ProjectsLocationsRegistryBooksGetOptions = {}): Promise<RegistryBook> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.view !== undefined) {
      url.searchParams.append("view", String(opts.view));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as RegistryBook;
  }

  /**
   * Lists RegistryBooks in a given project and location.
   *
   * @param parent Required. Parent value for ListRegistryBooksRequest
   */
  async projectsLocationsRegistryBooksList(parent: string, opts: ProjectsLocationsRegistryBooksListOptions = {}): Promise<ListRegistryBooksResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ parent }/registryBooks`);
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.orderBy !== undefined) {
      url.searchParams.append("orderBy", String(opts.orderBy));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    if (opts.view !== undefined) {
      url.searchParams.append("view", String(opts.view));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as ListRegistryBooksResponse;
  }

  /**
   * Updates the parameters of a single RegistryBook.
   *
   * @param name Required. Identifier. name of resource
   */
  async projectsLocationsRegistryBooksPatch(name: string, req: RegistryBook, opts: ProjectsLocationsRegistryBooksPatchOptions = {}): Promise<Operation> {
    opts = serializeProjectsLocationsRegistryBooksPatchOptions(opts);
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }`);
    if (opts.requestId !== undefined) {
      url.searchParams.append("requestId", String(opts.requestId));
    }
    if (opts.updateMask !== undefined) {
      url.searchParams.append("updateMask", String(opts.updateMask));
    }
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "PATCH",
      body,
    });
    return data as Operation;
  }

  /**
   * Searches IP resources in a given RegistryBook.
   *
   * @param name Required. The name of the RegistryBook to search in.
   */
  async projectsLocationsRegistryBooksSearchIpResources(name: string, req: SearchIpResourcesRequest): Promise<SearchIpResourcesResponse> {
    const url = new URL(`${this.#baseUrl}v1alpha/${ name }:searchIpResources`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as SearchIpResourcesResponse;
  }
}

/**
 * Aggregated data for the RegistryBook.
 */
export interface AggregatedData {
  /**
   * Output only. Number of custom ranges in the RegistryBook.
   */
  readonly customRangesCount?: number;
  /**
   * Output only. Number of custom realms in the RegistryBook.
   */
  readonly customRealmsCount?: number;
  /**
   * Output only. Number of discovered ranges in the RegistryBook.
   */
  readonly discoveredRangesCount?: number;
  /**
   * Output only. Number of discovered realms in the RegistryBook.
   */
  readonly discoveredRealmsCount?: number;
  /**
   * Output only. Number of scopes unique to the RegistryBook.
   */
  readonly uniqueScopesCount?: number;
}

/**
 * Message describing Attribute object
 */
export interface Attribute {
  /**
   * Required. Key of attribute
   */
  key?: string;
  /**
   * Required. Value of attribute
   */
  value?: string;
}

/**
 * The request message for Operations.CancelOperation.
 */
export interface CancelOperationRequest {
}

/**
 * Message for response to checking the availability of IpamAdminScopes
 */
export interface CheckAvailabilityIpamAdminScopesResponse {
  /**
   * The details of the requested scopes.
   */
  scopeAvailabilities?: IpamAdminScopeAvailability[];
}

function serializeCheckAvailabilityIpamAdminScopesResponse(data: any): CheckAvailabilityIpamAdminScopesResponse {
  return {
    ...data,
    scopeAvailabilities: data["scopeAvailabilities"] !== undefined ? data["scopeAvailabilities"].map((item: any) => (serializeIpamAdminScopeAvailability(item))) : undefined,
  };
}

function deserializeCheckAvailabilityIpamAdminScopesResponse(data: any): CheckAvailabilityIpamAdminScopesResponse {
  return {
    ...data,
    scopeAvailabilities: data["scopeAvailabilities"] !== undefined ? data["scopeAvailabilities"].map((item: any) => (deserializeIpamAdminScopeAvailability(item))) : undefined,
  };
}

/**
 * Message for cleaning up a IpamAdminScope
 */
export interface CleanupIpamAdminScopeRequest {
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Message describing CustomRange object
 */
export interface CustomRange {
  /**
   * Optional. The attributes of the CustomRange.
   */
  attributes?: Attribute[];
  /**
   * Optional. Description of the CustomRange.
   */
  description?: string;
  /**
   * Optional. The IPv4 CIDR range of the CustomRange.
   */
  ipv4CidrRange?: string;
  /**
   * Optional. The IPv6 CIDR range of the CustomRange.
   */
  ipv6CidrRange?: string;
  /**
   * Optional. Labels as key value pairs
   */
  labels?: {
    [key: string]: string
  };
  /**
   * Required. Identifier. name of resource
   */
  name?: string;
  /**
   * Optional. The parent range of the CustomRange. Do not allow setting parent
   * range if realm is specified. Format must follow this pattern:
   * projects/{project}/locations/{location}/customRanges/{custom_range}
   */
  parentRange?: string;
  /**
   * Optional. The realm of the CustomRange. The realm must be in the same
   * project as the custom range. Do not allow setting realm if parent range is
   * specified, since the realm should be inherited from the parent range.
   * Format must follow this pattern:
   * projects/{project}/locations/{location}/realms/{realm}
   */
  realm?: string;
  /**
   * Output only. The registry book of the CustomRange. This field is inherited
   * from the realm or parent range depending on which one is specified.
   */
  readonly registryBook?: string;
}

/**
 * Message for disabling a IpamAdminScope
 */
export interface DisableIpamAdminScopeRequest {
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Message describing DiscoveredRange object
 */
export interface DiscoveredRange {
  /**
   * Optional. The attributes of the DiscoveredRange.
   */
  attributes?: Attribute[];
  /**
   * Output only. If true, allow child ranges of this range to overlap with
   * each other.
   */
  readonly childCidrOverlapAllowed?: boolean;
  /**
   * Output only. [Output only] Create time stamp
   */
  readonly createTime?: Date;
  /**
   * Optional. Description of the DiscoveredRange.
   */
  description?: string;
  /**
   * 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.
   */
  readonly discoveryMetadata?: DiscoveryMetadata;
  /**
   * Optional. The IPv4 CIDR range of the DiscoveredRange.
   */
  ipv4CidrRange?: string;
  /**
   * Optional. The IPv6 CIDR range of the DiscoveredRange.
   */
  ipv6CidrRange?: string;
  /**
   * Optional. Labels as key value pairs
   */
  labels?: {
    [key: string]: string
  };
  /**
   * Required. Identifier. Name of the DiscoveredRange.
   */
  name?: string;
  /**
   * Optional. The parent range of the DiscoveredRange.
   */
  parentRange?: string;
  /**
   * Optional. The realm of the DiscoveredRange.
   */
  realm?: string;
  /**
   * Output only. The registry book of the DiscoveredRange.
   */
  readonly registryBook?: string;
  /**
   * Output only. [Output only] Update time stamp
   */
  readonly updateTime?: Date;
}

/**
 * Discovery metadata of the discovered resource.
 */
export interface DiscoveryMetadata {
  /**
   * Output only. The time when the resource was created.
   */
  readonly createTime?: Date;
  /**
   * Output only. The time when the event happened.
   */
  readonly eventTime?: Date;
  /**
   * Output only. The resource name of the discovered resource, should be
   * API-agnostic. Example: "projects/{project_number}/networks/{network_id}".
   */
  readonly resource?: string;
  /**
   * Output only. The resource uri of the discovered resource.
   */
  readonly resourceUri?: string;
  /**
   * Output only. The canonical google.aip.dev/122 name of the source resource.
   */
  readonly sourceId?: string;
  /**
   * 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".
   */
  readonly sourceSubId?: string;
  /**
   * Output only. The state of the resource.
   */
  readonly state?:  | "RESOURCE_STATE_UNSPECIFIED" | "INVALID" | "EXISTS" | "DOES_NOT_EXIST" | "ERROR";
  /**
   * Output only. The time when the resource was last modified.
   */
  readonly updateTime?: Date;
}

/**
 * A generic empty message that you can re-use to avoid defining duplicated
 * empty messages in your APIs. A typical example is to use it as the request or
 * the response type of an API method. For instance: service Foo { rpc
 * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
 */
export interface Empty {
}

/**
 * Message for the response to finding free IP ranges.
 */
export interface FindCustomRangeFreeIpRangesResponse {
  /**
   * Output only. Free IP CIDR ranges found in the CustomRange.
   */
  readonly freeIpCidrRanges?: string[];
}

/**
 * Message for the response to finding free IP ranges.
 */
export interface FindDiscoveredRangeFreeIpRangesResponse {
  /**
   * Output only. Free IP CIDR ranges found in the DiscoveredRange.
   */
  readonly freeIpCidrRanges?: string[];
}

/**
 * Message describing IpamAdminScope object
 */
export interface IpamAdminScope {
  /**
   * Output only. [Output only] Create time stamp
   */
  readonly createTime?: Date;
  /**
   * Required. Addon platforms that are enabled for this IPAM admin scope.
   * Cloud Number Registry only discovers the IP addresses from the enabled
   * platforms.
   */
  enabledAddonPlatforms?:  | "ADD_ON_PLATFORM_UNSPECIFIED" | "COMPUTE_ENGINE" | "GCE"[];
  /**
   * Optional. Labels as key value pairs
   */
  labels?: {
    [key: string]: string
  };
  /**
   * Required. Identifier. name of resource
   */
  name?: string;
  /**
   * 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.
   */
  scopes?: string[];
  /**
   * Output only. State of resource discovery pipeline.
   */
  readonly state?:  | "DISCOVERY_PIPELINE_STATE_UNSPECIFIED" | "INTERNAL_FAILURE" | "FAILED" | "SETUP_IN_PROGRESS" | "READY_FOR_USE" | "DELETING_IN_PROGRESS" | "UPDATING" | "RECOVERING" | "DISABLED" | "DELETION_COMPLETED" | "CLEANUP_IN_PROGRESS" | "READY_FOR_DELETION";
  /**
   * Output only. [Output only] Update time stamp
   */
  readonly updateTime?: Date;
}

/**
 * Message for the availability of an IpamAdminScope
 */
export interface IpamAdminScopeAvailability {
  /**
   * The admin project of the IpamAdminScope if it exists.
   */
  adminProject?: bigint;
  /**
   * The availability of the scope.
   */
  availability?:  | "AVAILABILITY_UNSPECIFIED" | "AVAILABLE" | "UNAVAILABLE";
  /**
   * The scope of the IpamAdminScope.
   */
  scope?: string;
}

function serializeIpamAdminScopeAvailability(data: any): IpamAdminScopeAvailability {
  return {
    ...data,
    adminProject: data["adminProject"] !== undefined ? String(data["adminProject"]) : undefined,
  };
}

function deserializeIpamAdminScopeAvailability(data: any): IpamAdminScopeAvailability {
  return {
    ...data,
    adminProject: data["adminProject"] !== undefined ? BigInt(data["adminProject"]) : undefined,
  };
}

/**
 * Message for response to listing CustomRanges
 */
export interface ListCustomRangesResponse {
  /**
   * The list of CustomRange
   */
  customRanges?: CustomRange[];
  /**
   * A token identifying a page of results the server should return.
   */
  nextPageToken?: string;
  /**
   * Locations that could not be reached.
   */
  unreachable?: string[];
}

/**
 * Message for response to listing DiscoveredRanges
 */
export interface ListDiscoveredRangesResponse {
  /**
   * The list of DiscoveredRange
   */
  discoveredRanges?: DiscoveredRange[];
  /**
   * A token identifying a page of results the server should return.
   */
  nextPageToken?: string;
  /**
   * Locations that could not be reached.
   */
  unreachable?: string[];
}

/**
 * Message for response to listing ipamAdminScopes
 */
export interface ListIpamAdminScopesResponse {
  /**
   * The list of IpamAdminScope
   */
  ipamAdminScopes?: IpamAdminScope[];
  /**
   * A token identifying a page of results the server should return.
   */
  nextPageToken?: string;
  /**
   * Locations that could not be reached.
   */
  unreachable?: string[];
}

/**
 * The response message for Locations.ListLocations.
 */
export interface ListLocationsResponse {
  /**
   * A list of locations that matches the specified filter in the request.
   */
  locations?: Location[];
  /**
   * The standard List next-page token.
   */
  nextPageToken?: string;
}

/**
 * The response message for Operations.ListOperations.
 */
export interface ListOperationsResponse {
  /**
   * The standard List next-page token.
   */
  nextPageToken?: string;
  /**
   * A list of operations that matches the specified filter in the request.
   */
  operations?: Operation[];
  /**
   * Unordered list. Unreachable resources. Populated when the request sets
   * `ListOperationsRequest.return_partial_success` and reads across
   * collections. For example, when attempting to list all resources across all
   * supported locations.
   */
  unreachable?: string[];
}

/**
 * Message for response to listing Realms
 */
export interface ListRealmsResponse {
  /**
   * A token identifying a page of results the server should return.
   */
  nextPageToken?: string;
  /**
   * The list of Realm
   */
  realms?: Realm[];
  /**
   * Locations that could not be reached.
   */
  unreachable?: string[];
}

/**
 * Message for response to listing RegistryBooks
 */
export interface ListRegistryBooksResponse {
  /**
   * A token identifying a page of results the server should return.
   */
  nextPageToken?: string;
  /**
   * The list of RegistryBook
   */
  registryBooks?: RegistryBook[];
  /**
   * Locations that could not be reached.
   */
  unreachable?: string[];
}

/**
 * A resource that represents a Google Cloud location.
 */
export interface Location {
  /**
   * The friendly name for this location, typically a nearby city name. For
   * example, "Tokyo".
   */
  displayName?: string;
  /**
   * Cross-service attributes for the location. For example
   * {"cloud.googleapis.com/region": "us-east1"}
   */
  labels?: {
    [key: string]: string
  };
  /**
   * The canonical id for this location. For example: `"us-east1"`.
   */
  locationId?: string;
  /**
   * Service-specific metadata. For example the available capacity at the given
   * location.
   */
  metadata?: {
    [key: string]: any
  };
  /**
   * Resource name for the location, which may vary between implementations.
   * For example: `"projects/example-project/locations/us-east1"`
   */
  name?: string;
}

/**
 * This resource represents a long-running operation that is the result of a
 * network API call.
 */
export interface Operation {
  /**
   * If the value is `false`, it means the operation is still in progress. If
   * `true`, the operation is completed, and either `error` or `response` is
   * available.
   */
  done?: boolean;
  /**
   * The error result of the operation in case of failure or cancellation.
   */
  error?: Status;
  /**
   * Service-specific metadata associated with the operation. It typically
   * contains progress information and common metadata such as create time. Some
   * services might not provide such metadata. Any method that returns a
   * long-running operation should document the metadata type, if any.
   */
  metadata?: {
    [key: string]: any
  };
  /**
   * The server-assigned name, which is only unique within the same service
   * that originally returns it. If you use the default HTTP mapping, the `name`
   * should be a resource name ending with `operations/{unique_id}`.
   */
  name?: string;
  /**
   * The normal, successful response of the operation. If the original method
   * returns no data on success, such as `Delete`, the response is
   * `google.protobuf.Empty`. If the original method is standard
   * `Get`/`Create`/`Update`, the response should be the resource. For other
   * methods, the response should have the type `XxxResponse`, where `Xxx` is
   * the original method name. For example, if the original method name is
   * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   */
  response?: {
    [key: string]: any
  };
}

/**
 * Represents the metadata of the long-running operation.
 */
export interface OperationMetadata {
  /**
   * Output only. API version used to start the operation.
   */
  readonly apiVersion?: string;
  /**
   * Output only. The time the operation was created.
   */
  readonly createTime?: Date;
  /**
   * Output only. The time the operation finished running.
   */
  readonly endTime?: Date;
  /**
   * Output only. Identifies whether the user has requested cancellation of the
   * operation. Operations that have been cancelled successfully have
   * Operation.error value with a google.rpc.Status.code of 1, corresponding to
   * `Code.CANCELLED`.
   */
  readonly requestedCancellation?: boolean;
  /**
   * Output only. Human-readable status of the operation, if any.
   */
  readonly statusMessage?: string;
  /**
   * Output only. Server-defined resource path for the target of the operation.
   */
  readonly target?: string;
  /**
   * Output only. Name of the verb executed by the operation.
   */
  readonly verb?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsCustomRangesCreate.
 */
export interface ProjectsLocationsCustomRangesCreateOptions {
  /**
   * Required. Id of the requesting object.
   */
  customRangeId?: string;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsCustomRangesDelete.
 */
export interface ProjectsLocationsCustomRangesDeleteOptions {
  /**
   * Optional. If set to true, all associated resources will be deleted.
   */
  force?: boolean;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsCustomRangesFindFreeIpRanges.
 */
export interface ProjectsLocationsCustomRangesFindFreeIpRangesOptions {
  /**
   * Required. The prefix length of the free IP ranges to find.
   */
  cidrPrefixLength?: number;
  /**
   * Optional. The number of free IP ranges to find.
   */
  rangeCount?: number;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsCustomRangesList.
 */
export interface ProjectsLocationsCustomRangesListOptions {
  /**
   * Optional. Filtering results.
   */
  filter?: string;
  /**
   * Optional. Hint for how to order the results.
   */
  orderBy?: string;
  /**
   * Optional. Requested page size. Server may return fewer items than
   * requested. If unspecified, server will pick an appropriate default.
   */
  pageSize?: number;
  /**
   * Optional. A token identifying a page of results the server should return.
   */
  pageToken?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsCustomRangesPatch.
 */
export interface ProjectsLocationsCustomRangesPatchOptions {
  /**
   * 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).
   */
  requestId?: string;
  /**
   * 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.
   */
  updateMask?: string /* FieldMask */;
}

function serializeProjectsLocationsCustomRangesPatchOptions(data: any): ProjectsLocationsCustomRangesPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

function deserializeProjectsLocationsCustomRangesPatchOptions(data: any): ProjectsLocationsCustomRangesPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsDiscoveredRangesFindFreeIpRanges.
 */
export interface ProjectsLocationsDiscoveredRangesFindFreeIpRangesOptions {
  /**
   * Required. The prefix length of the free IP ranges to find.
   */
  cidrPrefixLength?: number;
  /**
   * Optional. The number of free IP ranges to find.
   */
  rangeCount?: number;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsDiscoveredRangesList.
 */
export interface ProjectsLocationsDiscoveredRangesListOptions {
  /**
   * Optional. Filtering results.
   */
  filter?: string;
  /**
   * Optional. Hint for how to order the results.
   */
  orderBy?: string;
  /**
   * Optional. Requested page size. Server may return fewer items than
   * requested. If unspecified, server will pick an appropriate default.
   */
  pageSize?: number;
  /**
   * Optional. A token identifying a page of results the server should return.
   */
  pageToken?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsIpamAdminScopesCheckAvailability.
 */
export interface ProjectsLocationsIpamAdminScopesCheckAvailabilityOptions {
  /**
   * Required. The scopes of the IpamAdminScopes to look for.
   */
  scopes?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsIpamAdminScopesCreate.
 */
export interface ProjectsLocationsIpamAdminScopesCreateOptions {
  /**
   * Required. Id of the requesting object.
   */
  ipamAdminScopeId?: string;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsIpamAdminScopesDelete.
 */
export interface ProjectsLocationsIpamAdminScopesDeleteOptions {
  /**
   * Optional. If set to true, all associated resources will be deleted.
   */
  force?: boolean;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsIpamAdminScopesList.
 */
export interface ProjectsLocationsIpamAdminScopesListOptions {
  /**
   * Optional. Filtering results
   */
  filter?: string;
  /**
   * Optional. Hint for how to order the results
   */
  orderBy?: string;
  /**
   * Optional. Requested page size. Server may return fewer items than
   * requested. If unspecified, server will pick an appropriate default.
   */
  pageSize?: number;
  /**
   * Optional. A token identifying a page of results the server should return.
   */
  pageToken?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsIpamAdminScopesPatch.
 */
export interface ProjectsLocationsIpamAdminScopesPatchOptions {
  /**
   * 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).
   */
  requestId?: string;
  /**
   * 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.
   */
  updateMask?: string /* FieldMask */;
}

function serializeProjectsLocationsIpamAdminScopesPatchOptions(data: any): ProjectsLocationsIpamAdminScopesPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

function deserializeProjectsLocationsIpamAdminScopesPatchOptions(data: any): ProjectsLocationsIpamAdminScopesPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

/**
 * Additional options for CloudNumberRegistry#projectsLocationsList.
 */
export interface ProjectsLocationsListOptions {
  /**
   * Optional. Do not use this field unless explicitly documented otherwise.
   * This is primarily for internal usage.
   */
  extraLocationTypes?: string;
  /**
   * A filter to narrow down results to a preferred subset. The filtering
   * language accepts strings like `"displayName=tokyo"`, and is documented in
   * more detail in [AIP-160](https://google.aip.dev/160).
   */
  filter?: string;
  /**
   * The maximum number of results to return. If not set, the service selects a
   * default.
   */
  pageSize?: number;
  /**
   * A page token received from the `next_page_token` field in the response.
   * Send that page token to receive the subsequent page.
   */
  pageToken?: string;
}

/**
 * Additional options for CloudNumberRegistry#projectsLocationsOperationsList.
 */
export interface ProjectsLocationsOperationsListOptions {
  /**
   * The standard list filter.
   */
  filter?: string;
  /**
   * The standard list page size.
   */
  pageSize?: number;
  /**
   * The standard list page token.
   */
  pageToken?: string;
  /**
   * When set to `true`, operations that are reachable are returned as normal,
   * and those that are unreachable are returned in the
   * ListOperationsResponse.unreachable field. This can only be `true` when
   * reading across collections. For example, when `parent` is set to
   * `"projects/example/locations/-"`. This field is not supported by default
   * and will result in an `UNIMPLEMENTED` error if set unless explicitly
   * documented otherwise in service or product specific documentation.
   */
  returnPartialSuccess?: boolean;
}

/**
 * Additional options for CloudNumberRegistry#projectsLocationsRealmsCreate.
 */
export interface ProjectsLocationsRealmsCreateOptions {
  /**
   * Required. Id of the requesting object.
   */
  realmId?: string;
  /**
   * 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.
   */
  requestId?: string;
}

/**
 * Additional options for CloudNumberRegistry#projectsLocationsRealmsDelete.
 */
export interface ProjectsLocationsRealmsDeleteOptions {
  /**
   * Optional. If set to true, all associated resources will be deleted.
   */
  force?: boolean;
  /**
   * 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.
   */
  requestId?: string;
}

/**
 * Additional options for CloudNumberRegistry#projectsLocationsRealmsGet.
 */
export interface ProjectsLocationsRealmsGetOptions {
  /**
   * Optional. The view of the Realm.
   */
  view?:  | "REALM_VIEW_UNSPECIFIED" | "BASIC" | "FULL" | "AGGREGATE";
}

/**
 * Additional options for CloudNumberRegistry#projectsLocationsRealmsList.
 */
export interface ProjectsLocationsRealmsListOptions {
  /**
   * Optional. Filtering results
   */
  filter?: string;
  /**
   * Optional. Hint for how to order the results
   */
  orderBy?: string;
  /**
   * Optional. Requested page size. Server may return fewer items than
   * requested. If unspecified, server will pick an appropriate default.
   */
  pageSize?: number;
  /**
   * Optional. A token identifying a page of results the server should return.
   */
  pageToken?: string;
  /**
   * Optional. The view of the Realm.
   */
  view?:  | "REALM_VIEW_UNSPECIFIED" | "BASIC" | "FULL" | "AGGREGATE";
}

/**
 * Additional options for CloudNumberRegistry#projectsLocationsRealmsPatch.
 */
export interface ProjectsLocationsRealmsPatchOptions {
  /**
   * 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.
   */
  requestId?: string;
  /**
   * Optional. Field mask is used to specify the fields to be overwritten in
   * the Realm resource by the update.
   */
  updateMask?: string /* FieldMask */;
}

function serializeProjectsLocationsRealmsPatchOptions(data: any): ProjectsLocationsRealmsPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

function deserializeProjectsLocationsRealmsPatchOptions(data: any): ProjectsLocationsRealmsPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsRegistryBooksCreate.
 */
export interface ProjectsLocationsRegistryBooksCreateOptions {
  /**
   * Required. Id of the requesting object.
   */
  registryBookId?: string;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsRegistryBooksDelete.
 */
export interface ProjectsLocationsRegistryBooksDeleteOptions {
  /**
   * Optional. If set to true, all associated resources will be deleted.
   */
  force?: boolean;
  /**
   * 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).
   */
  requestId?: string;
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsRegistryBooksGet.
 */
export interface ProjectsLocationsRegistryBooksGetOptions {
  /**
   * Optional. The view of the RegistryBook.
   */
  view?:  | "REGISTRY_BOOK_VIEW_UNSPECIFIED" | "BASIC" | "FULL" | "AGGREGATE";
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsRegistryBooksList.
 */
export interface ProjectsLocationsRegistryBooksListOptions {
  /**
   * Optional. Filtering results
   */
  filter?: string;
  /**
   * Optional. Hint for how to order the results
   */
  orderBy?: string;
  /**
   * Optional. Requested page size. Server may return fewer items than
   * requested. If unspecified, server will pick an appropriate default.
   */
  pageSize?: number;
  /**
   * Optional. A token identifying a page of results the server should return.
   */
  pageToken?: string;
  /**
   * Optional. The view of the RegistryBook.
   */
  view?:  | "REGISTRY_BOOK_VIEW_UNSPECIFIED" | "BASIC" | "FULL" | "AGGREGATE";
}

/**
 * Additional options for
 * CloudNumberRegistry#projectsLocationsRegistryBooksPatch.
 */
export interface ProjectsLocationsRegistryBooksPatchOptions {
  /**
   * 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).
   */
  requestId?: string;
  /**
   * 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.
   */
  updateMask?: string /* FieldMask */;
}

function serializeProjectsLocationsRegistryBooksPatchOptions(data: any): ProjectsLocationsRegistryBooksPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

function deserializeProjectsLocationsRegistryBooksPatchOptions(data: any): ProjectsLocationsRegistryBooksPatchOptions {
  return {
    ...data,
    updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined,
  };
}

/**
 * Message describing either a CustomRange or a DiscoveredRange.
 */
export interface Range {
  /**
   * A custom range.
   */
  customRange?: CustomRange;
  /**
   * A discovered range.
   */
  discoveredRange?: DiscoveredRange;
  /**
   * The utilization of the range.
   */
  utilization?: RangeUtilization;
}

/**
 * Message for the utilization of an IP range
 */
export interface RangeUtilization {
  /**
   * Output only. The total number of IP addresses consumed in the range.
   */
  readonly totalConsumed?: string;
  /**
   * Output only. The total number of IP addresses produced in the range.
   */
  readonly totalProduced?: string;
  /**
   * 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.
   */
  readonly usage?: number;
}

/**
 * Message describing Realm object
 */
export interface Realm {
  /**
   * Output only. Aggregated data for the Realm. Populated only when the view
   * is AGGREGATE.
   */
  readonly aggregatedData?: RealmAggregatedData;
  /**
   * Output only. [Output only] Create time stamp
   */
  readonly createTime?: Date;
  /**
   * Output only. Discovery metadata of the realm.
   */
  readonly discoveryMetadata?: DiscoveryMetadata;
  /**
   * Optional. IP version of the realm.
   */
  ipVersion?:  | "IP_VERSION_UNSPECIFIED" | "IPV4" | "IPV6";
  /**
   * Optional. Labels as key value pairs
   */
  labels?: {
    [key: string]: string
  };
  /**
   * Required. Management type of realm.
   */
  managementType?:  | "MANAGEMENT_TYPE_UNSPECIFIED" | "CNR" | "USER";
  /**
   * Required. Identifier. Unique name/ID of the realm
   */
  name?: string;
  /**
   * Required. URI of the registry book that claims the realm.
   */
  registryBook?: string;
  /**
   * Required. Traffic type of realm.
   */
  trafficType?:  | "TRAFFIC_TYPE_UNSPECIFIED" | "UNSET" | "INTERNET" | "PRIVATE" | "LINKLOCAL";
  /**
   * Output only. [Output only] Update time stamp
   */
  readonly updateTime?: Date;
}

/**
 * Aggregated data for the Realm.
 */
export interface RealmAggregatedData {
  /**
   * Output only. Number of custom ranges in the Realm.
   */
  readonly customRangesCount?: number;
  /**
   * Output only. Number of discovered ranges in the Realm.
   */
  readonly discoveredRangesCount?: number;
}

/**
 * Message describing RegistryBook object
 */
export interface RegistryBook {
  /**
   * Output only. Aggregated data for the RegistryBook. Populated only when the
   * view is AGGREGATE.
   */
  readonly aggregatedData?: AggregatedData;
  /**
   * 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.
   */
  claimedScopes?: string[];
  /**
   * Output only. [Output only] Create time stamp
   */
  readonly createTime?: Date;
  /**
   * Output only. Whether the RegistryBook is the default one.
   */
  readonly isDefault?: boolean;
  /**
   * Optional. Labels as key value pairs
   */
  labels?: {
    [key: string]: string
  };
  /**
   * Required. Identifier. name of resource
   */
  name?: string;
  /**
   * Output only. [Output only] Update time stamp
   */
  readonly updateTime?: Date;
}

/**
 * Message for searching IP resources
 */
export interface SearchIpResourcesRequest {
  /**
   * Optional. Hint for how to order the results
   */
  orderBy?: string;
  /**
   * Optional. Requested page size. Server may return fewer items than
   * requested. If unspecified, server will pick an appropriate default.
   */
  pageSize?: number;
  /**
   * Optional. A token identifying a page of results the server should return.
   */
  pageToken?: string;
  /**
   * 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. 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`
   */
  query?: string;
  /**
   * Optional. The type of resources to search for. If not specified, the
   * server will return ranges.
   */
  searchResourceTypes?:  | "SEARCH_RESOURCE_TYPE_UNSPECIFIED" | "RANGES" | "REALMS"[];
  /**
   * Optional. Whether to show the utilization of the ranges in the response.
   */
  showUtilization?: boolean;
}

/**
 * Message for response to searching IP resources
 */
export interface SearchIpResourcesResponse {
  /**
   * A token identifying a page of results the server should return.
   */
  nextPageToken?: string;
  /**
   * Deprecated: Use results field instead. The list of ranges matching the
   * search query.
   */
  ranges?: Range[];
  /**
   * The list of results matching the search query.
   */
  results?: SearchIpResourcesResult[];
  /**
   * Locations that could not be reached.
   */
  unreachable?: string[];
}

/**
 * A result matching the search query, which can be either a range or a realm.
 */
export interface SearchIpResourcesResult {
  /**
   * A range matching the search query.
   */
  range?: Range;
  /**
   * A realm matching the search query.
   */
  realm?: Realm;
}

/**
 * Message for the response to getting the utilization of a CustomRange
 */
export interface ShowCustomRangeUtilizationResponse {
  /**
   * The CustomRange resource.
   */
  customRange?: CustomRange;
  /**
   * The utilization of the CustomRange.
   */
  rangeUtilization?: RangeUtilization;
}

/**
 * Message for the response to getting the utilization of a DiscoveredRange
 */
export interface ShowDiscoveredRangeUtilizationResponse {
  /**
   * The DiscoveredRange resource.
   */
  discoveredRange?: DiscoveredRange;
  /**
   * The utilization of the DiscoveredRange.
   */
  rangeUtilization?: RangeUtilization;
}

/**
 * The `Status` type defines a logical error model that is suitable for
 * different programming environments, including REST APIs and RPC APIs. It is
 * used by [gRPC](https://github.com/grpc). Each `Status` message contains three
 * pieces of data: error code, error message, and error details. You can find
 * out more about this error model and how to work with it in the [API Design
 * Guide](https://cloud.google.com/apis/design/errors).
 */
export interface Status {
  /**
   * The status code, which should be an enum value of google.rpc.Code.
   */
  code?: number;
  /**
   * A list of messages that carry the error details. There is a common set of
   * message types for APIs to use.
   */
  details?: {
    [key: string]: any
  }[];
  /**
   * A developer-facing error message, which should be in English. Any
   * user-facing error message should be localized and sent in the
   * google.rpc.Status.details field, or localized by the client.
   */
  message?: string;
}