{
  "typeName" : "AWS::CloudFormation::Publisher",
  "description" : "Register as a publisher in the CloudFormation Registry.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudformation",
  "properties" : {
    "AcceptTermsAndConditions" : {
      "description" : "Whether you accept the terms and conditions for publishing extensions in the CloudFormation registry. You must accept the terms and conditions in order to publish public extensions to the CloudFormation registry. The terms and conditions can be found at https://cloudformation-registry-documents.s3.amazonaws.com/Terms_and_Conditions_for_AWS_CloudFormation_Registry_Publishers.pdf",
      "type" : "boolean"
    },
    "PublisherId" : {
      "description" : "The publisher id assigned by CloudFormation for publishing in this region.",
      "pattern" : "[0-9a-zA-Z]{40}",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 40
    },
    "ConnectionArn" : {
      "description" : "If you are using a Bitbucket or GitHub account for identity verification, the Amazon Resource Name (ARN) for your connection to that account.",
      "type" : "string",
      "pattern" : "arn:aws(-[w]+)*:.+:.+:[0-9]{12}:.+"
    },
    "PublisherStatus" : {
      "description" : "Whether the publisher is verified.",
      "type" : "string",
      "enum" : [ "VERIFIED", "UNVERIFIED" ]
    },
    "PublisherProfile" : {
      "description" : "The URL to the publisher's profile with the identity provider.",
      "pattern" : "(http:|https:)+[^s]+[w]",
      "type" : "string",
      "maxLength" : 1024
    },
    "IdentityProvider" : {
      "description" : "The type of account used as the identity provider when registering this publisher with CloudFormation.",
      "type" : "string",
      "enum" : [ "AWS_Marketplace", "GitHub", "Bitbucket" ]
    }
  },
  "required" : [ "AcceptTermsAndConditions" ],
  "readOnlyProperties" : [ "/properties/PublisherId", "/properties/PublisherStatus", "/properties/PublisherProfile", "/properties/IdentityProvider" ],
  "createOnlyProperties" : [ "/properties/AcceptTermsAndConditions", "/properties/ConnectionArn" ],
  "primaryIdentifier" : [ "/properties/PublisherId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "cloudformation:RegisterPublisher", "cloudformation:DescribePublisher", "codestar-connections:GetConnection", "codestar-connections:UseConnection" ]
    },
    "read" : {
      "permissions" : [ "cloudformation:DescribePublisher" ]
    },
    "delete" : {
      "permissions" : [ ]
    },
    "list" : {
      "permissions" : [ "cloudformation:DescribePublisher" ]
    }
  },
  "additionalProperties" : false
}