syntax = "proto3";

package temporal.api.cloud.cloudservice.v1;

option go_package = "go.temporal.io/api/cloud/cloudservice/v1;cloudservice";
option java_package = "io.temporal.api.cloud.cloudservice.v1";
option java_multiple_files = true;
option java_outer_classname = "RequestResponseProto";
option ruby_package = "Temporalio::Api::Cloud::CloudService::V1";
option csharp_namespace = "Temporalio.Api.Cloud.CloudService.V1";

import "google/protobuf/timestamp.proto";

import "temporal/api/cloud/operation/v1/message.proto";
import "temporal/api/cloud/identity/v1/message.proto";
import "temporal/api/cloud/namespace/v1/message.proto";
import "temporal/api/cloud/nexus/v1/message.proto";
import "temporal/api/cloud/region/v1/message.proto";
import "temporal/api/cloud/account/v1/message.proto";
import "temporal/api/cloud/usage/v1/message.proto";
import "temporal/api/cloud/connectivityrule/v1/message.proto";

message GetUsersRequest {
    // The requested size of the page to retrieve - optional.
    // Cannot exceed 1000. Defaults to 100.
    int32 page_size = 1;
    // The page token if this is continuing from another response - optional.
    string page_token = 2;
    // Filter users by email address - optional.
    string email = 3;
    // Filter users by the namespace they have access to - optional.
    string namespace = 4;
}

message GetUsersResponse {
    // The list of users in ascending ids order
    repeated temporal.api.cloud.identity.v1.User users = 1;
    // The next page's token
    string next_page_token = 2;
}

message GetUserRequest {
    // The id of the user to get
    string user_id = 1;
}

message GetUserResponse {
    // The user
    temporal.api.cloud.identity.v1.User user = 1;
}

message CreateUserRequest {
    // The spec for the user to invite
    temporal.api.cloud.identity.v1.UserSpec spec = 1;
    // The id to use for this async operation - optional
    string async_operation_id = 2;
}

message CreateUserResponse {
    // The id of the user that was invited
    string user_id = 1;
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message UpdateUserRequest {
    // The id of the user to update
    string user_id = 1;
    // The new user specification
    temporal.api.cloud.identity.v1.UserSpec spec = 2;
    // The version of the user for which this update is intended for
    // The latest version can be found in the GetUser operation response
    string resource_version = 3;
    // The id to use for this async operation - optional
    string async_operation_id = 4;
}

message UpdateUserResponse {
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteUserRequest {
    // The id of the user to delete
    string user_id = 1;
    // The version of the user for which this delete is intended for
    // The latest version can be found in the GetUser operation response
    string resource_version = 2;
    // The id to use for this async operation - optional
    string async_operation_id = 3;
}

message DeleteUserResponse {
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message SetUserNamespaceAccessRequest {
    // The namespace to set permissions for
    string namespace = 1;
    // The id of the user to set permissions for
    string user_id = 2;
    // The namespace access to assign the user
    temporal.api.cloud.identity.v1.NamespaceAccess access = 3;
    // The version of the user for which this update is intended for
    // The latest version can be found in the GetUser operation response
    string resource_version = 4;
    // The id to use for this async operation - optional
    string async_operation_id = 5;
}

message SetUserNamespaceAccessResponse {
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetAsyncOperationRequest {
    // The id of the async operation to get
    string async_operation_id = 1;
}

message GetAsyncOperationResponse {
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message CreateNamespaceRequest {
    // The namespace specification.
    temporal.api.cloud.namespace.v1.NamespaceSpec spec = 2;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 3;
    // The tags to add to the namespace.
    // Note: This field can be set by global admins or account owners only.
    map<string, string> tags = 4;
}

message CreateNamespaceResponse {
    // The namespace that was created.
    string namespace = 1;
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message GetNamespacesRequest {
    // The requested size of the page to retrieve.
    // Cannot exceed 1000.
    // Optional, defaults to 100.
    int32 page_size = 1;
    // The page token if this is continuing from another response.
    // Optional, defaults to empty.
    string page_token = 2;
    // Filter namespaces by their name.
    // Optional, defaults to empty.
    string name = 3;
}

message GetNamespacesResponse {
    // The list of namespaces in ascending name order.
    repeated temporal.api.cloud.namespace.v1.Namespace namespaces = 1;
    // The next page's token.
    string next_page_token = 2;
}

message GetNamespaceRequest {
    // The namespace to get.
    string namespace = 1;
}

message GetNamespaceResponse {
    // The namespace.
    temporal.api.cloud.namespace.v1.Namespace namespace = 1;
}

message UpdateNamespaceRequest {
    // The namespace to update.
    string namespace = 1;
    // The new namespace specification.
    temporal.api.cloud.namespace.v1.NamespaceSpec spec = 2;
    // The version of the namespace for which this update is intended for.
    // The latest version can be found in the namespace status.
    string resource_version = 3;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 4;
}

message UpdateNamespaceResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message RenameCustomSearchAttributeRequest {
    // The namespace to rename the custom search attribute for.
    string namespace = 1;
    // The existing name of the custom search attribute to be renamed.
    string existing_custom_search_attribute_name = 2;
    // The new name of the custom search attribute.
    string new_custom_search_attribute_name = 3;
    // The version of the namespace for which this update is intended for.
    // The latest version can be found in the namespace status.
    string resource_version = 4;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 5;
}

message RenameCustomSearchAttributeResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteNamespaceRequest {
    // The namespace to delete.
    string namespace = 1;
    // The version of the namespace for which this delete is intended for.
    // The latest version can be found in the namespace status.
    string resource_version = 2;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 3;
}

message DeleteNamespaceResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message FailoverNamespaceRegionRequest {
    // The namespace to failover.
    string namespace = 1;
    // The id of the region to failover to.
    // Must be a region that the namespace is currently available in.
    string region = 2;
    // The id to use for this async operation - optional.
    string async_operation_id = 3;
}

message FailoverNamespaceRegionResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message AddNamespaceRegionRequest {
    // The namespace to add the region to.
    string namespace = 1;
    // The id of the standby region to add to the namespace.
    // The GetRegions API can be used to get the list of valid region ids.
    // Example: "aws-us-west-2".
    string region = 2;
    // The version of the namespace for which this add region operation is intended for.
    // The latest version can be found in the GetNamespace operation response.
    string resource_version = 3;
    // The id to use for this async operation - optional.
    string async_operation_id = 4;
}

message AddNamespaceRegionResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteNamespaceRegionRequest {
    // The namespace to delete a region.
    string namespace = 1;
    // The id of the standby region to be deleted.
    // The GetRegions API can be used to get the list of valid region ids.
    // Example: "aws-us-west-2".
    string region = 2;
    // The version of the namespace for which this delete region operation is intended for.
    // The latest version can be found in the GetNamespace operation response.
    string resource_version = 3;
    // The id to use for this async operation - optional.
    string async_operation_id = 4;
}

message DeleteNamespaceRegionResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetRegionsRequest {
}

message GetRegionsResponse {
    // The temporal cloud regions.
    repeated temporal.api.cloud.region.v1.Region regions = 1;
}

message GetRegionRequest {
    // The id of the region to get.
    string region = 1;
}

message GetRegionResponse {
    // The temporal cloud region.
    temporal.api.cloud.region.v1.Region region = 1;
}

message GetApiKeysRequest {
    // The requested size of the page to retrieve - optional.
    // Cannot exceed 1000. Defaults to 100.
    int32 page_size = 1;
    // The page token if this is continuing from another response - optional.
    string page_token = 2;
    // Filter api keys by owner id - optional.
    string owner_id = 3;
    // Filter api keys by owner type - optional.
    // Possible values: user, service-account
    string owner_type_deprecated = 4 [deprecated = true];
    // Filter api keys by owner type - optional.
    // temporal:enums:replaces=owner_type_deprecated
    temporal.api.cloud.identity.v1.OwnerType owner_type = 5;
}

message GetApiKeysResponse {
    // The list of api keys in ascending id order.
    repeated temporal.api.cloud.identity.v1.ApiKey api_keys = 1;

    // The next page's token.
    string next_page_token = 2;
}

message GetApiKeyRequest {
    // The id of the api key to get.
    string key_id = 1;
}

message GetApiKeyResponse {
    // The api key.
    temporal.api.cloud.identity.v1.ApiKey api_key = 1;
}

message CreateApiKeyRequest {
    // The spec for the api key to create.
    // Create api key only supports service-account owner type for now.
    temporal.api.cloud.identity.v1.ApiKeySpec spec = 1;

    // The id to use for this async operation - optional.
    string async_operation_id = 2;
}

message CreateApiKeyResponse {
    // The id of the api key created.
    string key_id = 1;
    // The token of the api key created.
    // This is a secret and should be stored securely.
    // It will not be retrievable after this response.
    string token = 2;
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 3;
}

message UpdateApiKeyRequest {
    // The id of the api key to update.
    string key_id = 1;
    // The new api key specification.
    temporal.api.cloud.identity.v1.ApiKeySpec spec = 2;
    // The version of the api key for which this update is intended for.
    // The latest version can be found in the GetApiKey operation response.
    string resource_version = 3;

    // The id to use for this async operation - optional.
    string async_operation_id = 4;
}

message UpdateApiKeyResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteApiKeyRequest {
    // The id of the api key to delete.
    string key_id = 1;
    // The version of the api key for which this delete is intended for.
    // The latest version can be found in the GetApiKey operation response.
    string resource_version = 2;

    // The id to use for this async operation - optional.
    string async_operation_id = 3;
}

message DeleteApiKeyResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetNexusEndpointsRequest {
    // The requested size of the page to retrieve - optional.
    // Cannot exceed 1000. Defaults to 100.
    int32 page_size = 1;

    // The page token if this is continuing from another response - optional.
    string page_token = 2;

    // optional, treated as an AND if specified
    string target_namespace_id = 3;

    // optional, treated as an AND if specified
    string target_task_queue = 4;

    // Filter endpoints by their name - optional, treated as an AND if specified. Specifying this will result in zero or one results.
    string name = 5;
}

message GetNexusEndpointsResponse {
    // The list of endpoints in ascending id order.
    repeated temporal.api.cloud.nexus.v1.Endpoint endpoints = 1;

    // The next page's token.
    string next_page_token = 2;
}

message GetNexusEndpointRequest {
    // The id of the nexus endpoint to get.
    string endpoint_id = 1;
}

message GetNexusEndpointResponse {
    // The nexus endpoint.
    temporal.api.cloud.nexus.v1.Endpoint endpoint = 1;
}

message CreateNexusEndpointRequest {
    // The spec for the nexus endpoint.
    temporal.api.cloud.nexus.v1.EndpointSpec spec = 1;

    // The id to use for this async operation - optional.
    string async_operation_id = 2;
}

message CreateNexusEndpointResponse {
    // The id of the endpoint that was created.
    string endpoint_id = 1;

    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message UpdateNexusEndpointRequest {
    // The id of the nexus endpoint to update.
    string endpoint_id = 1;

    // The updated nexus endpoint specification.
    temporal.api.cloud.nexus.v1.EndpointSpec spec = 2;

    // The version of the nexus endpoint for which this update is intended for.
    // The latest version can be found in the GetNexusEndpoint operation response.
    string resource_version = 3;

    // The id to use for this async operation - optional.
    string async_operation_id = 4;
}

message UpdateNexusEndpointResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteNexusEndpointRequest {
    // The id of the nexus endpoint to delete.
    string endpoint_id = 1;

    // The version of the endpoint for which this delete is intended for.
    // The latest version can be found in the GetNexusEndpoint operation response.
    string resource_version = 2;

    // The id to use for this async operation - optional.
    string async_operation_id = 3;
}

message DeleteNexusEndpointResponse {
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetUserGroupsRequest {
    // The requested size of the page to retrieve - optional.
    // Cannot exceed 1000. Defaults to 100.
    int32 page_size = 1;
    // The page token if this is continuing from another response - optional.
    string page_token = 2;
    // Filter groups by the namespace they have access to - optional.
    string namespace = 3;
    // Filter groups by the display name - optional.
    string display_name = 4;
    // Filter groups by the google group specification - optional.
    GoogleGroupFilter google_group = 5;
    // Filter groups by the SCIM group specification - optional.
    SCIMGroupFilter scim_group = 6;


    message GoogleGroupFilter {
        // Filter groups by the google group email - optional.
        string email_address = 1;
    }
    message SCIMGroupFilter {
        // Filter groups by the SCIM IDP id - optional.
        string idp_id = 1;
    }
}

message GetUserGroupsResponse {
    // The list of groups in ascending name order.
    repeated temporal.api.cloud.identity.v1.UserGroup groups = 1;
    // The next page's token.
    string next_page_token = 2;
}

message GetUserGroupRequest {
    // The id of the group to get.
    string group_id = 1;
}

message GetUserGroupResponse {
    // The group.
    temporal.api.cloud.identity.v1.UserGroup group = 1;
}

message CreateUserGroupRequest {
    // The spec for the group to create.
    temporal.api.cloud.identity.v1.UserGroupSpec spec = 1;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 2;
}

message CreateUserGroupResponse {
    // The id of the group that was created.
    string group_id = 1;

    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message UpdateUserGroupRequest {
    // The id of the group to update.
    string group_id = 1;
    // The new group specification.
    temporal.api.cloud.identity.v1.UserGroupSpec spec = 2;
    // The version of the group for which this update is intended for.
    // The latest version can be found in the GetGroup operation response.
    string resource_version = 3;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 4;
}

message UpdateUserGroupResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteUserGroupRequest {
    // The id of the group to delete.
    string group_id = 1;
    // The version of the group for which this delete is intended for.
    // The latest version can be found in the GetGroup operation response.
    string resource_version = 2;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 3;
}

message DeleteUserGroupResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message SetUserGroupNamespaceAccessRequest {
    // The namespace to set permissions for.
    string namespace = 1;
    // The id of the group to set permissions for.
    string group_id = 2;
    // The namespace access to assign the group. If left empty, the group will be removed from the namespace access.
    temporal.api.cloud.identity.v1.NamespaceAccess access = 3;
    // The version of the group for which this update is intended for.
    // The latest version can be found in the GetGroup operation response.
    string resource_version = 4;
    // The id to use for this async operation - optional.
    string async_operation_id = 5;
}

message SetUserGroupNamespaceAccessResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message AddUserGroupMemberRequest {
    // The id of the group to add the member for.
    string group_id = 1;

    // The member id to add to the group.
    temporal.api.cloud.identity.v1.UserGroupMemberId member_id = 2;

    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 3;
}

message AddUserGroupMemberResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message RemoveUserGroupMemberRequest {
    // The id of the group to add the member for.
    string group_id = 1;

    // The member id to add to the group.
    temporal.api.cloud.identity.v1.UserGroupMemberId member_id = 2;

    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 3;
}

message RemoveUserGroupMemberResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetUserGroupMembersRequest {
    // The requested size of the page to retrieve - optional.
    // Cannot exceed 1000. Defaults to 100.
    int32 page_size = 1;
    // The page token if this is continuing from another response - optional.
    string page_token = 2;

    // The group id to list members of.
    string group_id = 3;
}

message GetUserGroupMembersResponse {
    // The list of group members
    repeated temporal.api.cloud.identity.v1.UserGroupMember members = 1;
    // The next page's token.
    string next_page_token = 2;
}

message CreateServiceAccountRequest {
    // The spec of the service account to create.
    temporal.api.cloud.identity.v1.ServiceAccountSpec spec = 1;
    // The ID to use for this async operation - optional.
    string async_operation_id = 2;
}

message CreateServiceAccountResponse {
    // The ID of the created service account.
    string service_account_id = 1;
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message GetServiceAccountRequest {
    // ID of the service account to retrieve.
    string service_account_id = 1;
}

message GetServiceAccountResponse {
    // The service account retrieved.
    temporal.api.cloud.identity.v1.ServiceAccount service_account = 1;
}

message GetServiceAccountsRequest {
    // The requested size of the page to retrieve - optional.
    // Cannot exceed 1000. Defaults to 100.
    int32 page_size = 1;
    // The page token if this is continuing from another response - optional.
    string page_token = 2;
}

message GetServiceAccountsResponse {
    // The list of service accounts in ascending ID order.
    repeated temporal.api.cloud.identity.v1.ServiceAccount service_account = 1;
    // The next page token, set if there is another page.
    string next_page_token = 2;
}

message UpdateServiceAccountRequest {
    // The ID of the service account to update.
    string service_account_id = 1;
    // The new service account specification.
    temporal.api.cloud.identity.v1.ServiceAccountSpec spec = 2;
    // The version of the service account for which this update is intended for.
    // The latest version can be found in the GetServiceAccount response.
    string resource_version = 3;
    // The ID to use for this async operation - optional.
    string async_operation_id = 4;
}

message UpdateServiceAccountResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message SetServiceAccountNamespaceAccessRequest {
    // The ID of the service account to update.
    string service_account_id = 1;
    // The namespace to set permissions for.
    string namespace = 2;
    // The namespace access to assign the service account.
    temporal.api.cloud.identity.v1.NamespaceAccess access = 3;
    // The version of the service account for which this update is intended for.
    // The latest version can be found in the GetServiceAccount response.
    string resource_version = 4;
    // The ID to use for this async operation - optional.
    string async_operation_id = 5;
}

message SetServiceAccountNamespaceAccessResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteServiceAccountRequest {
    // The ID of the service account to delete;
    string service_account_id = 1;
    // The version of the service account for which this update is intended for.
    // The latest version can be found in the GetServiceAccount response.
    string resource_version = 2;
    // The ID to use for this async operation - optional.
    string async_operation_id = 3;
}

message DeleteServiceAccountResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetUsageRequest {
    // Filter for UTC time >= - optional.
    // Defaults to: start of the current month.
    // Must be: within the last 90 days from the current date.
    // Must be: midnight UTC time.
    google.protobuf.Timestamp start_time_inclusive = 1;

    // Filter for UTC time < - optional.
    // Defaults to: start of the next UTC day.
    // Must be: within the last 90 days from the current date.
    // Must be: midnight UTC time.
    google.protobuf.Timestamp end_time_exclusive = 2;

    // The requested size of the page to retrieve - optional.
    // Each count corresponds to a single object - per day per namespace
    // Cannot exceed 1000. Defaults to 100.
    int32 page_size = 3;

    // The page token if this is continuing from another response - optional.
    string page_token = 4;
}

message GetUsageResponse {
    // The list of data based on granularity (per Day for now)
    // Ordered by: time range in ascending order
    repeated temporal.api.cloud.usage.v1.Summary summaries = 1;
    // The next page's token.
    string next_page_token = 2;
}

message GetAccountRequest {
}

message GetAccountResponse {
    // The account.
    temporal.api.cloud.account.v1.Account account = 1;
}

message UpdateAccountRequest {
    // The updated account specification to apply.
    temporal.api.cloud.account.v1.AccountSpec spec = 1;
    // The version of the account for which this update is intended for.
    // The latest version can be found in the GetAccount operation response.
    string resource_version = 2;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 3;
}

message UpdateAccountResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message CreateNamespaceExportSinkRequest {
    // The namespace under which the sink is configured.
    string namespace = 1;
    // The specification for the export sink.
    temporal.api.cloud.namespace.v1.ExportSinkSpec spec = 2;
    // Optional. The ID to use for this async operation.
    string async_operation_id = 3;
}

message CreateNamespaceExportSinkResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message GetNamespaceExportSinkRequest {
    // The namespace to which the sink belongs.
    string namespace = 1;
    // The name of the sink to retrieve.
    string name = 2;
}

message GetNamespaceExportSinkResponse {
    // The export sink retrieved.
   temporal.api.cloud.namespace.v1.ExportSink sink = 1;
}

message GetNamespaceExportSinksRequest {
    // The namespace to which the sinks belong.
    string namespace = 1;
    // The requested size of the page to retrieve. Cannot exceed 1000.
    // Defaults to 100 if not specified.
    int32 page_size = 2;
    // The page token if this is continuing from another response - optional.
    string page_token = 3;
}

message GetNamespaceExportSinksResponse {
    // The list of export sinks retrieved.
    repeated temporal.api.cloud.namespace.v1.ExportSink sinks = 1;
    // The next page token, set if there is another page.
    string next_page_token = 2;
}

message UpdateNamespaceExportSinkRequest {
    // The namespace to which the sink belongs.
    string namespace = 1;
    // The updated export sink specification.
    temporal.api.cloud.namespace.v1.ExportSinkSpec spec = 2;
    // The version of the sink to update. The latest version can be
    // retrieved using the GetNamespaceExportSink call.
    string resource_version = 3;
    // The ID to use for this async operation - optional.
    string async_operation_id = 4;
}

message UpdateNamespaceExportSinkResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteNamespaceExportSinkRequest {
    // The namespace to which the sink belongs.
    string namespace = 1;
    // The name of the sink to delete.
    string name = 2;
    // The version of the sink to delete. The latest version can be
    // retrieved using the GetNamespaceExportSink call.
    string resource_version = 3;
    // The ID to use for this async operation - optional.
    string async_operation_id = 4;
}

message DeleteNamespaceExportSinkResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message ValidateNamespaceExportSinkRequest {
    // The namespace to which the sink belongs.
    string namespace = 1;
    // The export sink specification to validate.
    temporal.api.cloud.namespace.v1.ExportSinkSpec spec = 2;
}

message ValidateNamespaceExportSinkResponse {
}

message UpdateNamespaceTagsRequest {
    // The namespace to set tags for.
    string namespace = 1;
    // A list of tags to add or update.
    // If a key of an existing tag is added, the tag's value is updated.
    // At least one of tags_to_upsert or tags_to_remove must be specified.
    map<string, string> tags_to_upsert = 2;
    // A list of tag keys to remove.
    // If a tag key doesn't exist, it is silently ignored.
    // At least one of tags_to_upsert or tags_to_remove must be specified.
    repeated string tags_to_remove = 3;
    // The id to use for this async operation - optional.
    string async_operation_id = 4;
}

message UpdateNamespaceTagsResponse {
    // The async operation.
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message CreateConnectivityRuleRequest {
    // The connectivity rule specification.
    temporal.api.cloud.connectivityrule.v1.ConnectivityRuleSpec spec = 1;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 2;
}

message CreateConnectivityRuleResponse {
    // The id of the connectivity rule that was created.
    string connectivity_rule_id = 1;
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message GetConnectivityRuleRequest {
    // The id of the connectivity rule to get.
    string connectivity_rule_id = 1;
}

message GetConnectivityRuleResponse {
    temporal.api.cloud.connectivityrule.v1.ConnectivityRule connectivity_rule = 1;
}

message GetConnectivityRulesRequest {
    // The requested size of the page to retrieve.
    // Optional, defaults to 100.
    int32 page_size = 1;
    // The page token if this is continuing from another response.
    // Optional, defaults to empty.
    string page_token = 2;
    // Filter connectivity rule by the namespace id.
    string namespace = 3;
}

message GetConnectivityRulesResponse {
    // connectivity_rules returned
    repeated temporal.api.cloud.connectivityrule.v1.ConnectivityRule connectivity_rules = 1;
    // The next page token
    string next_page_token = 2;
}

message DeleteConnectivityRuleRequest {
    // The ID of the connectivity rule that need be deleted, required.
    string connectivity_rule_id = 1;

    // The resource version which should be the same from the the db, required
    // The latest version can be found in the GetConnectivityRule operation response
    string resource_version = 2;
    // The id to use for this async operation.
    // Optional, if not provided a random id will be generated.
    string async_operation_id = 3;
}

message DeleteConnectivityRuleResponse {
    // The async operation
    temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message ValidateAccountAuditLogSinkRequest {
  // The audit log sink spec that will be validated
  temporal.api.cloud.account.v1.AuditLogSinkSpec spec = 1;
}

message ValidateAccountAuditLogSinkResponse {
}
