{
  "typeName" : "AWS::Cognito::UserPoolClient",
  "description" : "Resource Type definition for AWS::Cognito::UserPoolClient",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "AnalyticsConfiguration" : {
      "type" : "object",
      "properties" : {
        "ApplicationArn" : {
          "type" : "string"
        },
        "ApplicationId" : {
          "type" : "string"
        },
        "ExternalId" : {
          "type" : "string"
        },
        "RoleArn" : {
          "type" : "string"
        },
        "UserDataShared" : {
          "type" : "boolean"
        }
      },
      "additionalProperties" : false
    },
    "TokenValidityUnits" : {
      "type" : "object",
      "properties" : {
        "AccessToken" : {
          "type" : "string"
        },
        "IdToken" : {
          "type" : "string"
        },
        "RefreshToken" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "RefreshTokenRotation" : {
      "type" : "object",
      "properties" : {
        "Feature" : {
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        },
        "RetryGracePeriodSeconds" : {
          "type" : "integer",
          "minimum" : 0,
          "maximum" : 60
        }
      }
    }
  },
  "properties" : {
    "ClientName" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 128
    },
    "ExplicitAuthFlows" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "GenerateSecret" : {
      "type" : "boolean"
    },
    "ReadAttributes" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "AuthSessionValidity" : {
      "type" : "integer",
      "minimum" : 3,
      "maximum" : 15
    },
    "RefreshTokenValidity" : {
      "type" : "integer",
      "minimum" : 1,
      "maximum" : 315360000
    },
    "AccessTokenValidity" : {
      "type" : "integer",
      "minimum" : 1,
      "maximum" : 86400
    },
    "IdTokenValidity" : {
      "type" : "integer",
      "minimum" : 1,
      "maximum" : 86400
    },
    "TokenValidityUnits" : {
      "$ref" : "#/definitions/TokenValidityUnits"
    },
    "RefreshTokenRotation" : {
      "$ref" : "#/definitions/RefreshTokenRotation"
    },
    "UserPoolId" : {
      "type" : "string"
    },
    "WriteAttributes" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "AllowedOAuthFlows" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "AllowedOAuthFlowsUserPoolClient" : {
      "type" : "boolean"
    },
    "AllowedOAuthScopes" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "CallbackURLs" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "DefaultRedirectURI" : {
      "type" : "string"
    },
    "LogoutURLs" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "SupportedIdentityProviders" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "AnalyticsConfiguration" : {
      "$ref" : "#/definitions/AnalyticsConfiguration"
    },
    "PreventUserExistenceErrors" : {
      "type" : "string"
    },
    "EnableTokenRevocation" : {
      "type" : "boolean"
    },
    "EnablePropagateAdditionalUserContextData" : {
      "type" : "boolean"
    },
    "Name" : {
      "type" : "string"
    },
    "ClientSecret" : {
      "type" : "string"
    },
    "ClientId" : {
      "type" : "string"
    }
  },
  "tagging" : {
    "taggable" : false,
    "tagOnCreate" : false,
    "tagUpdatable" : false,
    "cloudFormationSystemTags" : false
  },
  "additionalProperties" : false,
  "required" : [ "UserPoolId" ],
  "readOnlyProperties" : [ "/properties/ClientSecret", "/properties/Name", "/properties/ClientId" ],
  "primaryIdentifier" : [ "/properties/UserPoolId", "/properties/ClientId" ],
  "createOnlyProperties" : [ "/properties/GenerateSecret", "/properties/UserPoolId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "cognito-idp:CreateUserPoolClient", "iam:PassRole", "iam:PutRolePolicy", "iam:CreateServiceLinkedRole" ],
      "timeoutInMinutes" : 2
    },
    "read" : {
      "permissions" : [ "cognito-idp:DescribeUserPoolClient" ]
    },
    "update" : {
      "permissions" : [ "cognito-idp:UpdateUserPoolClient", "iam:PassRole", "iam:PutRolePolicy" ],
      "timeoutInMinutes" : 2
    },
    "delete" : {
      "permissions" : [ "cognito-idp:DeleteUserPoolClient", "iam:PutRolePolicy", "iam:DeleteRolePolicy" ],
      "timeoutInMinutes" : 2
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "UserPoolId" : {
            "$ref" : "resource-schema.json#/properties/UserPoolId"
          }
        },
        "required" : [ "UserPoolId" ]
      },
      "permissions" : [ "cognito-idp:ListUserPoolClients" ]
    }
  }
}