# WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
# See https://github.com/aws-beam/aws-codegen for more details.

defmodule AWS.Finspacedata do
  @moduledoc """
  The FinSpace APIs let you take actions inside the FinSpace.
  """

  alias AWS.Client
  alias AWS.Request

  @typedoc """

  ## Example:

      permission_group_params() :: %{
        "datasetPermissions" => list(resource_permission()),
        "permissionGroupId" => String.t() | atom()
      }

  """
  @type permission_group_params() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_permission_group_request() :: %{
        optional("clientToken") => String.t() | atom(),
        optional("description") => String.t() | atom(),
        required("applicationPermissions") => list(list(any())()),
        required("name") => String.t() | atom()
      }

  """
  @type create_permission_group_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_external_data_view_access_details_request() :: %{}

  """
  @type get_external_data_view_access_details_request() :: %{}

  @typedoc """

  ## Example:

      list_users_by_permission_group_response() :: %{
        "nextToken" => String.t() | atom(),
        "users" => list(user_by_permission_group())
      }

  """
  @type list_users_by_permission_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_permission_group_request() :: %{
        optional("clientToken") => String.t() | atom()
      }

  """
  @type delete_permission_group_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_dataset_response() :: %{
        "datasetId" => String.t() | atom()
      }

  """
  @type delete_dataset_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_programmatic_access_credentials_response() :: %{
        "credentials" => credentials(),
        "durationInMinutes" => float()
      }

  """
  @type get_programmatic_access_credentials_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_dataset_response() :: %{
        "datasetId" => String.t() | atom()
      }

  """
  @type update_dataset_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_user_response() :: %{
        "userId" => String.t() | atom()
      }

  """
  @type update_user_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      schema_definition() :: %{
        "columns" => list(column_definition()),
        "primaryKeyColumns" => list(String.t() | atom())
      }

  """
  @type schema_definition() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_data_view_response() :: %{
        "dataViewId" => String.t() | atom(),
        "datasetId" => String.t() | atom()
      }

  """
  @type create_data_view_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      credentials() :: %{
        "accessKeyId" => String.t() | atom(),
        "secretAccessKey" => String.t() | atom(),
        "sessionToken" => String.t() | atom()
      }

  """
  @type credentials() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_user_response() :: %{
        "apiAccess" => list(any()),
        "apiAccessPrincipalArn" => String.t() | atom(),
        "createTime" => float(),
        "emailAddress" => String.t() | atom(),
        "firstName" => String.t() | atom(),
        "lastDisabledTime" => float(),
        "lastEnabledTime" => float(),
        "lastLoginTime" => float(),
        "lastModifiedTime" => float(),
        "lastName" => String.t() | atom(),
        "status" => list(any()),
        "type" => list(any()),
        "userId" => String.t() | atom()
      }

  """
  @type get_user_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      disassociate_user_from_permission_group_response() :: %{
        "statusCode" => integer()
      }

  """
  @type disassociate_user_from_permission_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_permission_groups_by_user_request() :: %{
        optional("nextToken") => String.t() | atom(),
        required("maxResults") => integer()
      }

  """
  @type list_permission_groups_by_user_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_datasets_request() :: %{
        optional("maxResults") => integer(),
        optional("nextToken") => String.t() | atom()
      }

  """
  @type list_datasets_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      associate_user_to_permission_group_response() :: %{
        "statusCode" => integer()
      }

  """
  @type associate_user_to_permission_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_permission_group_request() :: %{}

  """
  @type get_permission_group_request() :: %{}

  @typedoc """

  ## Example:

      create_data_view_request() :: %{
        optional("asOfTimestamp") => float(),
        optional("autoUpdate") => boolean(),
        optional("clientToken") => String.t() | atom(),
        optional("partitionColumns") => list(String.t() | atom()),
        optional("sortColumns") => list(String.t() | atom()),
        required("destinationTypeParams") => data_view_destination_type_params()
      }

  """
  @type create_data_view_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_users_by_permission_group_request() :: %{
        optional("nextToken") => String.t() | atom(),
        required("maxResults") => integer()
      }

  """
  @type list_users_by_permission_group_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_external_data_view_access_details_response() :: %{
        "credentials" => aws_credentials(),
        "s3Location" => s3_location()
      }

  """
  @type get_external_data_view_access_details_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_changeset_request() :: %{}

  """
  @type get_changeset_request() :: %{}

  @typedoc """

  ## Example:

      create_permission_group_response() :: %{
        "permissionGroupId" => String.t() | atom()
      }

  """
  @type create_permission_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_permission_group_response() :: %{
        "permissionGroupId" => String.t() | atom()
      }

  """
  @type delete_permission_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_permission_groups_by_user_response() :: %{
        "nextToken" => String.t() | atom(),
        "permissionGroups" => list(permission_group_by_user())
      }

  """
  @type list_permission_groups_by_user_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      dataset() :: %{
        "alias" => String.t() | atom(),
        "createTime" => float(),
        "datasetArn" => String.t() | atom(),
        "datasetDescription" => String.t() | atom(),
        "datasetId" => String.t() | atom(),
        "datasetTitle" => String.t() | atom(),
        "kind" => list(any()),
        "lastModifiedTime" => float(),
        "ownerInfo" => dataset_owner_info(),
        "schemaDefinition" => schema_union()
      }

  """
  @type dataset() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_dataset_response() :: %{
        "datasetId" => String.t() | atom()
      }

  """
  @type create_dataset_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_data_view_request() :: %{}

  """
  @type get_data_view_request() :: %{}

  @typedoc """

  ## Example:

      conflict_exception() :: %{
        "message" => String.t() | atom(),
        "reason" => String.t() | atom()
      }

  """
  @type conflict_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      resource_not_found_exception() :: %{
        "message" => String.t() | atom(),
        "reason" => String.t() | atom()
      }

  """
  @type resource_not_found_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_changeset_response() :: %{
        "changesetId" => String.t() | atom(),
        "datasetId" => String.t() | atom()
      }

  """
  @type create_changeset_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_user_request() :: %{}

  """
  @type get_user_request() :: %{}

  @typedoc """

  ## Example:

      dataset_owner_info() :: %{
        "email" => String.t() | atom(),
        "name" => String.t() | atom(),
        "phoneNumber" => String.t() | atom()
      }

  """
  @type dataset_owner_info() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_working_location_response() :: %{
        "s3Bucket" => String.t() | atom(),
        "s3Path" => String.t() | atom(),
        "s3Uri" => String.t() | atom()
      }

  """
  @type get_working_location_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_data_view_response() :: %{
        "asOfTimestamp" => float(),
        "autoUpdate" => boolean(),
        "createTime" => float(),
        "dataViewArn" => String.t() | atom(),
        "dataViewId" => String.t() | atom(),
        "datasetId" => String.t() | atom(),
        "destinationTypeParams" => data_view_destination_type_params(),
        "errorInfo" => data_view_error_info(),
        "lastModifiedTime" => float(),
        "partitionColumns" => list(String.t() | atom()),
        "sortColumns" => list(String.t() | atom()),
        "status" => list(any())
      }

  """
  @type get_data_view_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      disassociate_user_from_permission_group_request() :: %{
        optional("clientToken") => String.t() | atom()
      }

  """
  @type disassociate_user_from_permission_group_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      reset_user_password_response() :: %{
        "temporaryPassword" => String.t() | atom(),
        "userId" => String.t() | atom()
      }

  """
  @type reset_user_password_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      permission_group_by_user() :: %{
        "membershipStatus" => list(any()),
        "name" => String.t() | atom(),
        "permissionGroupId" => String.t() | atom()
      }

  """
  @type permission_group_by_user() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_users_response() :: %{
        "nextToken" => String.t() | atom(),
        "users" => list(user())
      }

  """
  @type list_users_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_permission_group_response() :: %{
        "permissionGroup" => permission_group()
      }

  """
  @type get_permission_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      data_view_destination_type_params() :: %{
        "destinationType" => String.t() | atom(),
        "s3DestinationExportFileFormat" => list(any()),
        "s3DestinationExportFileFormatOptions" => map()
      }

  """
  @type data_view_destination_type_params() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_permission_group_request() :: %{
        optional("applicationPermissions") => list(list(any())()),
        optional("clientToken") => String.t() | atom(),
        optional("description") => String.t() | atom(),
        optional("name") => String.t() | atom()
      }

  """
  @type update_permission_group_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_changeset_request() :: %{
        optional("clientToken") => String.t() | atom(),
        required("changeType") => list(any()),
        required("formatParams") => map(),
        required("sourceParams") => map()
      }

  """
  @type create_changeset_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      schema_union() :: %{
        "tabularSchemaConfig" => schema_definition()
      }

  """
  @type schema_union() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_changeset_request() :: %{
        optional("clientToken") => String.t() | atom(),
        required("formatParams") => map(),
        required("sourceParams") => map()
      }

  """
  @type update_changeset_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      s3_location() :: %{
        "bucket" => String.t() | atom(),
        "key" => String.t() | atom()
      }

  """
  @type s3_location() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_dataset_request() :: %{
        optional("alias") => String.t() | atom(),
        optional("clientToken") => String.t() | atom(),
        optional("datasetDescription") => String.t() | atom(),
        optional("schemaDefinition") => schema_union(),
        required("datasetTitle") => String.t() | atom(),
        required("kind") => list(any())
      }

  """
  @type update_dataset_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_changesets_request() :: %{
        optional("maxResults") => integer(),
        optional("nextToken") => String.t() | atom()
      }

  """
  @type list_changesets_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      changeset_summary() :: %{
        "activeFromTimestamp" => float(),
        "activeUntilTimestamp" => float(),
        "changeType" => list(any()),
        "changesetArn" => String.t() | atom(),
        "changesetId" => String.t() | atom(),
        "createTime" => float(),
        "datasetId" => String.t() | atom(),
        "errorInfo" => changeset_error_info(),
        "formatParams" => map(),
        "sourceParams" => map(),
        "status" => list(any()),
        "updatedByChangesetId" => String.t() | atom(),
        "updatesChangesetId" => String.t() | atom()
      }

  """
  @type changeset_summary() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      internal_server_exception() :: %{
        "message" => String.t() | atom()
      }

  """
  @type internal_server_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      reset_user_password_request() :: %{
        optional("clientToken") => String.t() | atom()
      }

  """
  @type reset_user_password_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      disable_user_response() :: %{
        "userId" => String.t() | atom()
      }

  """
  @type disable_user_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      changeset_error_info() :: %{
        "errorCategory" => list(any()),
        "errorMessage" => String.t() | atom()
      }

  """
  @type changeset_error_info() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_changeset_response() :: %{
        "activeFromTimestamp" => float(),
        "activeUntilTimestamp" => float(),
        "changeType" => list(any()),
        "changesetArn" => String.t() | atom(),
        "changesetId" => String.t() | atom(),
        "createTime" => float(),
        "datasetId" => String.t() | atom(),
        "errorInfo" => changeset_error_info(),
        "formatParams" => map(),
        "sourceParams" => map(),
        "status" => list(any()),
        "updatedByChangesetId" => String.t() | atom(),
        "updatesChangesetId" => String.t() | atom()
      }

  """
  @type get_changeset_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_permission_groups_response() :: %{
        "nextToken" => String.t() | atom(),
        "permissionGroups" => list(permission_group())
      }

  """
  @type list_permission_groups_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_changeset_response() :: %{
        "changesetId" => String.t() | atom(),
        "datasetId" => String.t() | atom()
      }

  """
  @type update_changeset_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      access_denied_exception() :: %{
        "message" => String.t() | atom()
      }

  """
  @type access_denied_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      data_view_error_info() :: %{
        "errorCategory" => list(any()),
        "errorMessage" => String.t() | atom()
      }

  """
  @type data_view_error_info() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      aws_credentials() :: %{
        "accessKeyId" => String.t() | atom(),
        "expiration" => float(),
        "secretAccessKey" => String.t() | atom(),
        "sessionToken" => String.t() | atom()
      }

  """
  @type aws_credentials() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_dataset_request() :: %{}

  """
  @type get_dataset_request() :: %{}

  @typedoc """

  ## Example:

      update_user_request() :: %{
        optional("apiAccess") => list(any()),
        optional("apiAccessPrincipalArn") => String.t() | atom(),
        optional("clientToken") => String.t() | atom(),
        optional("firstName") => String.t() | atom(),
        optional("lastName") => String.t() | atom(),
        optional("type") => list(any())
      }

  """
  @type update_user_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_dataset_response() :: %{
        "alias" => String.t() | atom(),
        "createTime" => float(),
        "datasetArn" => String.t() | atom(),
        "datasetDescription" => String.t() | atom(),
        "datasetId" => String.t() | atom(),
        "datasetTitle" => String.t() | atom(),
        "kind" => list(any()),
        "lastModifiedTime" => float(),
        "schemaDefinition" => schema_union(),
        "status" => list(any())
      }

  """
  @type get_dataset_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      validation_exception() :: %{
        "message" => String.t() | atom(),
        "reason" => String.t() | atom()
      }

  """
  @type validation_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_dataset_request() :: %{
        optional("alias") => String.t() | atom(),
        optional("clientToken") => String.t() | atom(),
        optional("datasetDescription") => String.t() | atom(),
        optional("ownerInfo") => dataset_owner_info(),
        optional("schemaDefinition") => schema_union(),
        required("datasetTitle") => String.t() | atom(),
        required("kind") => list(any()),
        required("permissionGroupParams") => permission_group_params()
      }

  """
  @type create_dataset_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      enable_user_request() :: %{
        optional("clientToken") => String.t() | atom()
      }

  """
  @type enable_user_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_permission_group_response() :: %{
        "permissionGroupId" => String.t() | atom()
      }

  """
  @type update_permission_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      associate_user_to_permission_group_request() :: %{
        optional("clientToken") => String.t() | atom()
      }

  """
  @type associate_user_to_permission_group_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      throttling_exception() :: %{}

  """
  @type throttling_exception() :: %{}

  @typedoc """

  ## Example:

      user() :: %{
        "apiAccess" => list(any()),
        "apiAccessPrincipalArn" => String.t() | atom(),
        "createTime" => float(),
        "emailAddress" => String.t() | atom(),
        "firstName" => String.t() | atom(),
        "lastDisabledTime" => float(),
        "lastEnabledTime" => float(),
        "lastLoginTime" => float(),
        "lastModifiedTime" => float(),
        "lastName" => String.t() | atom(),
        "status" => list(any()),
        "type" => list(any()),
        "userId" => String.t() | atom()
      }

  """
  @type user() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_data_views_request() :: %{
        optional("maxResults") => integer(),
        optional("nextToken") => String.t() | atom()
      }

  """
  @type list_data_views_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_users_request() :: %{
        optional("nextToken") => String.t() | atom(),
        required("maxResults") => integer()
      }

  """
  @type list_users_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      user_by_permission_group() :: %{
        "apiAccess" => list(any()),
        "apiAccessPrincipalArn" => String.t() | atom(),
        "emailAddress" => String.t() | atom(),
        "firstName" => String.t() | atom(),
        "lastName" => String.t() | atom(),
        "membershipStatus" => list(any()),
        "status" => list(any()),
        "type" => list(any()),
        "userId" => String.t() | atom()
      }

  """
  @type user_by_permission_group() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      limit_exceeded_exception() :: %{
        "message" => String.t() | atom()
      }

  """
  @type limit_exceeded_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_working_location_request() :: %{
        optional("locationType") => list(any())
      }

  """
  @type get_working_location_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      resource_permission() :: %{
        "permission" => String.t() | atom()
      }

  """
  @type resource_permission() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_dataset_request() :: %{
        optional("clientToken") => String.t() | atom()
      }

  """
  @type delete_dataset_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_datasets_response() :: %{
        "datasets" => list(dataset()),
        "nextToken" => String.t() | atom()
      }

  """
  @type list_datasets_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      permission_group() :: %{
        "applicationPermissions" => list(list(any())()),
        "createTime" => float(),
        "description" => String.t() | atom(),
        "lastModifiedTime" => float(),
        "membershipStatus" => list(any()),
        "name" => String.t() | atom(),
        "permissionGroupId" => String.t() | atom()
      }

  """
  @type permission_group() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_programmatic_access_credentials_request() :: %{
        optional("durationInMinutes") => float(),
        required("environmentId") => String.t() | atom()
      }

  """
  @type get_programmatic_access_credentials_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_permission_groups_request() :: %{
        optional("nextToken") => String.t() | atom(),
        required("maxResults") => integer()
      }

  """
  @type list_permission_groups_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_changesets_response() :: %{
        "changesets" => list(changeset_summary()),
        "nextToken" => String.t() | atom()
      }

  """
  @type list_changesets_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      data_view_summary() :: %{
        "asOfTimestamp" => float(),
        "autoUpdate" => boolean(),
        "createTime" => float(),
        "dataViewArn" => String.t() | atom(),
        "dataViewId" => String.t() | atom(),
        "datasetId" => String.t() | atom(),
        "destinationTypeProperties" => data_view_destination_type_params(),
        "errorInfo" => data_view_error_info(),
        "lastModifiedTime" => float(),
        "partitionColumns" => list(String.t() | atom()),
        "sortColumns" => list(String.t() | atom()),
        "status" => list(any())
      }

  """
  @type data_view_summary() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      disable_user_request() :: %{
        optional("clientToken") => String.t() | atom()
      }

  """
  @type disable_user_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_user_response() :: %{
        "userId" => String.t() | atom()
      }

  """
  @type create_user_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      enable_user_response() :: %{
        "userId" => String.t() | atom()
      }

  """
  @type enable_user_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      column_definition() :: %{
        "columnDescription" => String.t() | atom(),
        "columnName" => String.t() | atom(),
        "dataType" => list(any())
      }

  """
  @type column_definition() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_data_views_response() :: %{
        "dataViews" => list(data_view_summary()),
        "nextToken" => String.t() | atom()
      }

  """
  @type list_data_views_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_user_request() :: %{
        optional("apiAccess") => list(any()),
        optional("apiAccessPrincipalArn") => String.t() | atom(),
        optional("clientToken") => String.t() | atom(),
        optional("firstName") => String.t() | atom(),
        optional("lastName") => String.t() | atom(),
        required("emailAddress") => String.t() | atom(),
        required("type") => list(any())
      }

  """
  @type create_user_request() :: %{(String.t() | atom()) => any()}

  @type associate_user_to_permission_group_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type create_changeset_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type create_data_view_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type create_dataset_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type create_permission_group_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | conflict_exception()

  @type create_user_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | conflict_exception()

  @type delete_dataset_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type delete_permission_group_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type disable_user_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type disassociate_user_from_permission_group_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type enable_user_errors() ::
          limit_exceeded_exception()
          | throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type get_changeset_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type get_data_view_errors() ::
          throttling_exception()
          | validation_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type get_dataset_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type get_external_data_view_access_details_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()

  @type get_permission_group_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()

  @type get_programmatic_access_credentials_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()

  @type get_user_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()

  @type get_working_location_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()

  @type list_changesets_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type list_data_views_errors() ::
          throttling_exception()
          | validation_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type list_datasets_errors() ::
          throttling_exception()
          | validation_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type list_permission_groups_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()

  @type list_permission_groups_by_user_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()

  @type list_users_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()

  @type list_users_by_permission_group_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()

  @type reset_user_password_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type update_changeset_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type update_dataset_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type update_permission_group_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  @type update_user_errors() ::
          throttling_exception()
          | validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()

  def metadata do
    %{
      api_version: "2020-07-13",
      content_type: "application/x-amz-json-1.1",
      credential_scope: nil,
      endpoint_prefix: "finspace-api",
      global?: false,
      hostname: nil,
      protocol: "rest-json",
      service_id: "finspace data",
      signature_version: "v4",
      signing_name: "finspace-api",
      target_prefix: nil
    }
  end

  @doc """
  Adds a user to a permission group to grant permissions for actions a user can
  perform in FinSpace.
  """
  @spec associate_user_to_permission_group(
          map(),
          String.t() | atom(),
          String.t() | atom(),
          associate_user_to_permission_group_request(),
          list()
        ) ::
          {:ok, associate_user_to_permission_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, associate_user_to_permission_group_errors()}
  def associate_user_to_permission_group(
        %Client{} = client,
        permission_group_id,
        user_id,
        input,
        options \\ []
      ) do
    url_path =
      "/permission-group/#{AWS.Util.encode_uri(permission_group_id)}/users/#{AWS.Util.encode_uri(user_id)}"

    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates a new Changeset in a FinSpace Dataset.
  """
  @spec create_changeset(map(), String.t() | atom(), create_changeset_request(), list()) ::
          {:ok, create_changeset_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_changeset_errors()}
  def create_changeset(%Client{} = client, dataset_id, input, options \\ []) do
    url_path = "/datasets/#{AWS.Util.encode_uri(dataset_id)}/changesetsv2"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates a Dataview for a Dataset.
  """
  @spec create_data_view(map(), String.t() | atom(), create_data_view_request(), list()) ::
          {:ok, create_data_view_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_data_view_errors()}
  def create_data_view(%Client{} = client, dataset_id, input, options \\ []) do
    url_path = "/datasets/#{AWS.Util.encode_uri(dataset_id)}/dataviewsv2"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates a new FinSpace Dataset.
  """
  @spec create_dataset(map(), create_dataset_request(), list()) ::
          {:ok, create_dataset_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_dataset_errors()}
  def create_dataset(%Client{} = client, input, options \\ []) do
    url_path = "/datasetsv2"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates a group of permissions for various actions that a user can perform in
  FinSpace.
  """
  @spec create_permission_group(map(), create_permission_group_request(), list()) ::
          {:ok, create_permission_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_permission_group_errors()}
  def create_permission_group(%Client{} = client, input, options \\ []) do
    url_path = "/permission-group"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates a new user in FinSpace.
  """
  @spec create_user(map(), create_user_request(), list()) ::
          {:ok, create_user_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_user_errors()}
  def create_user(%Client{} = client, input, options \\ []) do
    url_path = "/user"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Deletes a FinSpace Dataset.
  """
  @spec delete_dataset(map(), String.t() | atom(), delete_dataset_request(), list()) ::
          {:ok, delete_dataset_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, delete_dataset_errors()}
  def delete_dataset(%Client{} = client, dataset_id, input, options \\ []) do
    url_path = "/datasetsv2/#{AWS.Util.encode_uri(dataset_id)}"
    headers = []
    custom_headers = []

    {query_params, input} =
      [
        {"clientToken", "clientToken"}
      ]
      |> Request.build_params(input)

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :delete,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Deletes a permission group.

  This action is irreversible.
  """
  @spec delete_permission_group(
          map(),
          String.t() | atom(),
          delete_permission_group_request(),
          list()
        ) ::
          {:ok, delete_permission_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, delete_permission_group_errors()}
  def delete_permission_group(%Client{} = client, permission_group_id, input, options \\ []) do
    url_path = "/permission-group/#{AWS.Util.encode_uri(permission_group_id)}"
    headers = []
    custom_headers = []

    {query_params, input} =
      [
        {"clientToken", "clientToken"}
      ]
      |> Request.build_params(input)

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :delete,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Denies access to the FinSpace web application and API for the specified user.
  """
  @spec disable_user(map(), String.t() | atom(), disable_user_request(), list()) ::
          {:ok, disable_user_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, disable_user_errors()}
  def disable_user(%Client{} = client, user_id, input, options \\ []) do
    url_path = "/user/#{AWS.Util.encode_uri(user_id)}/disable"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Removes a user from a permission group.
  """
  @spec disassociate_user_from_permission_group(
          map(),
          String.t() | atom(),
          String.t() | atom(),
          disassociate_user_from_permission_group_request(),
          list()
        ) ::
          {:ok, disassociate_user_from_permission_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, disassociate_user_from_permission_group_errors()}
  def disassociate_user_from_permission_group(
        %Client{} = client,
        permission_group_id,
        user_id,
        input,
        options \\ []
      ) do
    url_path =
      "/permission-group/#{AWS.Util.encode_uri(permission_group_id)}/users/#{AWS.Util.encode_uri(user_id)}"

    headers = []
    custom_headers = []

    {query_params, input} =
      [
        {"clientToken", "clientToken"}
      ]
      |> Request.build_params(input)

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :delete,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Allows the specified user to access the FinSpace web application and API.
  """
  @spec enable_user(map(), String.t() | atom(), enable_user_request(), list()) ::
          {:ok, enable_user_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, enable_user_errors()}
  def enable_user(%Client{} = client, user_id, input, options \\ []) do
    url_path = "/user/#{AWS.Util.encode_uri(user_id)}/enable"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Get information about a Changeset.
  """
  @spec get_changeset(map(), String.t() | atom(), String.t() | atom(), list()) ::
          {:ok, get_changeset_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_changeset_errors()}
  def get_changeset(%Client{} = client, changeset_id, dataset_id, options \\ []) do
    url_path =
      "/datasets/#{AWS.Util.encode_uri(dataset_id)}/changesetsv2/#{AWS.Util.encode_uri(changeset_id)}"

    headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Gets information about a Dataview.
  """
  @spec get_data_view(map(), String.t() | atom(), String.t() | atom(), list()) ::
          {:ok, get_data_view_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_data_view_errors()}
  def get_data_view(%Client{} = client, data_view_id, dataset_id, options \\ []) do
    url_path =
      "/datasets/#{AWS.Util.encode_uri(dataset_id)}/dataviewsv2/#{AWS.Util.encode_uri(data_view_id)}"

    headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Returns information about a Dataset.
  """
  @spec get_dataset(map(), String.t() | atom(), list()) ::
          {:ok, get_dataset_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_dataset_errors()}
  def get_dataset(%Client{} = client, dataset_id, options \\ []) do
    url_path = "/datasetsv2/#{AWS.Util.encode_uri(dataset_id)}"
    headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Returns the credentials to access the external Dataview from an S3 location.

  To call this API:

    *
  You must retrieve the programmatic credentials.

    *
  You must be a member of a FinSpace user group, where the dataset that you want
  to access has `Read Dataset Data` permissions.
  """
  @spec get_external_data_view_access_details(
          map(),
          String.t() | atom(),
          String.t() | atom(),
          get_external_data_view_access_details_request(),
          list()
        ) ::
          {:ok, get_external_data_view_access_details_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_external_data_view_access_details_errors()}
  def get_external_data_view_access_details(
        %Client{} = client,
        data_view_id,
        dataset_id,
        input,
        options \\ []
      ) do
    url_path =
      "/datasets/#{AWS.Util.encode_uri(dataset_id)}/dataviewsv2/#{AWS.Util.encode_uri(data_view_id)}/external-access-details"

    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Retrieves the details of a specific permission group.
  """
  @spec get_permission_group(map(), String.t() | atom(), list()) ::
          {:ok, get_permission_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_permission_group_errors()}
  def get_permission_group(%Client{} = client, permission_group_id, options \\ []) do
    url_path = "/permission-group/#{AWS.Util.encode_uri(permission_group_id)}"
    headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Request programmatic credentials to use with FinSpace SDK.

  For more information, see [Step 2. Access credentials programmatically using IAM access key id and secret access
  key](https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#accessing-credentials).
  """
  @spec get_programmatic_access_credentials(
          map(),
          String.t() | atom() | nil,
          String.t() | atom(),
          list()
        ) ::
          {:ok, get_programmatic_access_credentials_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_programmatic_access_credentials_errors()}
  def get_programmatic_access_credentials(
        %Client{} = client,
        duration_in_minutes \\ nil,
        environment_id,
        options \\ []
      ) do
    url_path = "/credentials/programmatic"
    headers = []
    query_params = []

    query_params =
      if !is_nil(environment_id) do
        [{"environmentId", environment_id} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(duration_in_minutes) do
        [{"durationInMinutes", duration_in_minutes} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Retrieves details for a specific user.
  """
  @spec get_user(map(), String.t() | atom(), list()) ::
          {:ok, get_user_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_user_errors()}
  def get_user(%Client{} = client, user_id, options \\ []) do
    url_path = "/user/#{AWS.Util.encode_uri(user_id)}"
    headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  A temporary Amazon S3 location, where you can copy your files from a source
  location to stage or use
  as a scratch space in FinSpace notebook.
  """
  @spec get_working_location(map(), get_working_location_request(), list()) ::
          {:ok, get_working_location_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_working_location_errors()}
  def get_working_location(%Client{} = client, input, options \\ []) do
    url_path = "/workingLocationV1"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Lists the FinSpace Changesets for a Dataset.
  """
  @spec list_changesets(
          map(),
          String.t() | atom(),
          String.t() | atom() | nil,
          String.t() | atom() | nil,
          list()
        ) ::
          {:ok, list_changesets_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_changesets_errors()}
  def list_changesets(
        %Client{} = client,
        dataset_id,
        max_results \\ nil,
        next_token \\ nil,
        options \\ []
      ) do
    url_path = "/datasets/#{AWS.Util.encode_uri(dataset_id)}/changesetsv2"
    headers = []
    query_params = []

    query_params =
      if !is_nil(next_token) do
        [{"nextToken", next_token} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(max_results) do
        [{"maxResults", max_results} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Lists all available Dataviews for a Dataset.
  """
  @spec list_data_views(
          map(),
          String.t() | atom(),
          String.t() | atom() | nil,
          String.t() | atom() | nil,
          list()
        ) ::
          {:ok, list_data_views_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_data_views_errors()}
  def list_data_views(
        %Client{} = client,
        dataset_id,
        max_results \\ nil,
        next_token \\ nil,
        options \\ []
      ) do
    url_path = "/datasets/#{AWS.Util.encode_uri(dataset_id)}/dataviewsv2"
    headers = []
    query_params = []

    query_params =
      if !is_nil(next_token) do
        [{"nextToken", next_token} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(max_results) do
        [{"maxResults", max_results} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Lists all of the active Datasets that a user has access to.
  """
  @spec list_datasets(map(), String.t() | atom() | nil, String.t() | atom() | nil, list()) ::
          {:ok, list_datasets_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_datasets_errors()}
  def list_datasets(%Client{} = client, max_results \\ nil, next_token \\ nil, options \\ []) do
    url_path = "/datasetsv2"
    headers = []
    query_params = []

    query_params =
      if !is_nil(next_token) do
        [{"nextToken", next_token} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(max_results) do
        [{"maxResults", max_results} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Lists all available permission groups in FinSpace.
  """
  @spec list_permission_groups(map(), String.t() | atom(), String.t() | atom() | nil, list()) ::
          {:ok, list_permission_groups_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_permission_groups_errors()}
  def list_permission_groups(%Client{} = client, max_results, next_token \\ nil, options \\ []) do
    url_path = "/permission-group"
    headers = []
    query_params = []

    query_params =
      if !is_nil(next_token) do
        [{"nextToken", next_token} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(max_results) do
        [{"maxResults", max_results} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Lists all the permission groups that are associated with a specific user.
  """
  @spec list_permission_groups_by_user(
          map(),
          String.t() | atom(),
          String.t() | atom(),
          String.t() | atom() | nil,
          list()
        ) ::
          {:ok, list_permission_groups_by_user_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_permission_groups_by_user_errors()}
  def list_permission_groups_by_user(
        %Client{} = client,
        user_id,
        max_results,
        next_token \\ nil,
        options \\ []
      ) do
    url_path = "/user/#{AWS.Util.encode_uri(user_id)}/permission-groups"
    headers = []
    query_params = []

    query_params =
      if !is_nil(next_token) do
        [{"nextToken", next_token} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(max_results) do
        [{"maxResults", max_results} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Lists all available users in FinSpace.
  """
  @spec list_users(map(), String.t() | atom(), String.t() | atom() | nil, list()) ::
          {:ok, list_users_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_users_errors()}
  def list_users(%Client{} = client, max_results, next_token \\ nil, options \\ []) do
    url_path = "/user"
    headers = []
    query_params = []

    query_params =
      if !is_nil(next_token) do
        [{"nextToken", next_token} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(max_results) do
        [{"maxResults", max_results} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Lists details of all the users in a specific permission group.
  """
  @spec list_users_by_permission_group(
          map(),
          String.t() | atom(),
          String.t() | atom(),
          String.t() | atom() | nil,
          list()
        ) ::
          {:ok, list_users_by_permission_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_users_by_permission_group_errors()}
  def list_users_by_permission_group(
        %Client{} = client,
        permission_group_id,
        max_results,
        next_token \\ nil,
        options \\ []
      ) do
    url_path = "/permission-group/#{AWS.Util.encode_uri(permission_group_id)}/users"
    headers = []
    query_params = []

    query_params =
      if !is_nil(next_token) do
        [{"nextToken", next_token} | query_params]
      else
        query_params
      end

    query_params =
      if !is_nil(max_results) do
        [{"maxResults", max_results} | query_params]
      else
        query_params
      end

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Resets the password for a specified user ID and generates a temporary one.

  Only a superuser can reset password for other users. Resetting the password
  immediately invalidates the previous password associated with the user.
  """
  @spec reset_user_password(map(), String.t() | atom(), reset_user_password_request(), list()) ::
          {:ok, reset_user_password_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, reset_user_password_errors()}
  def reset_user_password(%Client{} = client, user_id, input, options \\ []) do
    url_path = "/user/#{AWS.Util.encode_uri(user_id)}/password"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Updates a FinSpace Changeset.
  """
  @spec update_changeset(
          map(),
          String.t() | atom(),
          String.t() | atom(),
          update_changeset_request(),
          list()
        ) ::
          {:ok, update_changeset_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, update_changeset_errors()}
  def update_changeset(%Client{} = client, changeset_id, dataset_id, input, options \\ []) do
    url_path =
      "/datasets/#{AWS.Util.encode_uri(dataset_id)}/changesetsv2/#{AWS.Util.encode_uri(changeset_id)}"

    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :put,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Updates a FinSpace Dataset.
  """
  @spec update_dataset(map(), String.t() | atom(), update_dataset_request(), list()) ::
          {:ok, update_dataset_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, update_dataset_errors()}
  def update_dataset(%Client{} = client, dataset_id, input, options \\ []) do
    url_path = "/datasetsv2/#{AWS.Util.encode_uri(dataset_id)}"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :put,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Modifies the details of a permission group.

  You cannot modify a `permissionGroupID`.
  """
  @spec update_permission_group(
          map(),
          String.t() | atom(),
          update_permission_group_request(),
          list()
        ) ::
          {:ok, update_permission_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, update_permission_group_errors()}
  def update_permission_group(%Client{} = client, permission_group_id, input, options \\ []) do
    url_path = "/permission-group/#{AWS.Util.encode_uri(permission_group_id)}"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :put,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Modifies the details of the specified user.

  You cannot update the `userId` for a user.
  """
  @spec update_user(map(), String.t() | atom(), update_user_request(), list()) ::
          {:ok, update_user_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, update_user_errors()}
  def update_user(%Client{} = client, user_id, input, options \\ []) do
    url_path = "/user/#{AWS.Util.encode_uri(user_id)}"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :put,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end
end
