{
  "version": 3,
  "sources": ["../../../src/client-sns/commands/publish-command.ts"],
  "sourcesContent": ["import {\n  PublishCommand as BaseCommand,\n  PublishCommandInput as BaseCommandInput,\n  PublishCommandOutput as BaseCommandOutput,\n  SNSClientResolvedConfig as ResolvedConfiguration,\n} from \"@aws-sdk/client-sns\";\n\nimport { Handler, MiddlewareStack } from \"@aws-sdk/types\";\nimport { Command } from \"@smithy/smithy-client\";\nimport {\n  MaterializedTopicProps as MaterializedTopicProps,\n  Topic,\n  TopicArn,\n} from \"../../aws-sns/topic.js\";\nimport { ValueType } from \"../../core/value-type.js\";\nimport { OpaqueType } from \"../../opaque-type/index.js\";\nimport { staticTest } from \"../../static-test.js\";\nimport { ServiceInputTypes, ServiceOutputTypes } from \"../sns-client.js\";\n\nexport type PublishCommandInput<\n  T extends MaterializedTopicProps = MaterializedTopicProps,\n> = Omit<\n  BaseCommandInput,\n  | \"TopicArn\"\n  | \"Message\"\n  | \"MessageGroupId\"\n  | \"MessageDeduplicationId\"\n  | \"MessageAttributes\"\n> & {\n  TopicArn: TopicArn<T>;\n  Message: T[\"message\"];\n} & (T[\"messageGroupId\"] extends never\n    ? {}\n    : {\n        MessageGroupId: T[\"messageGroupId\"];\n      }) &\n  (T[\"messageDeduplicationId\"] extends never\n    ? {}\n    : {\n        MessageDeduplicationId: T[\"messageDeduplicationId\"];\n      }) &\n  (T[\"messageAttributes\"] extends never\n    ? {}\n    : {\n        MessageAttributes: T[\"messageAttributes\"];\n      });\n\nexport interface PublishCommandOutput extends BaseCommandOutput {}\n\nexport class PublishCommand<T extends MaterializedTopicProps>\n  implements\n    Command<BaseCommandInput, BaseCommandOutput, ResolvedConfiguration>\n{\n  input: any;\n  middlewareStack: any;\n  // @ts-expect-error\n  resolveMiddleware: (\n    clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,\n    configuration: ResolvedConfiguration,\n    options: any,\n  ) => Handler<BaseCommandInput, BaseCommandOutput>;\n  constructor(input: PublishCommandInput<T>) {\n    return new BaseCommand(input);\n  }\n}\n\nstaticTest((topic: Topic<{}>) => {\n  new PublishCommand({\n    TopicArn: topic.topicArn,\n    Message: \"\",\n  });\n  new PublishCommand({\n    TopicArn: topic.topicArn,\n    Message: \"\",\n    // @ts-expect-error: MessageGroupId and MessageDeduplicationId are forbidden.\n    MessageGroupId: \"\",\n    MessageDeduplicationId: \"\",\n  });\n});\n\nstaticTest((topic: Topic<{ fifo: true }>) => {\n  new PublishCommand({\n    TopicArn: topic.topicArn,\n    Message: \"\",\n    MessageGroupId: \"\",\n    MessageDeduplicationId: \"\",\n  });\n  // @ts-expect-error: MessageGroupId and MessageDeduplicationId are required.\n  new PublishCommand({\n    TopicArn: topic.topicArn,\n    Message: \"\",\n  });\n});\n\ntype MyString = OpaqueType<string, { readonly t: unique symbol }>;\nstaticTest((topic: Topic<{ messageType: ValueType<MyString> }>) => {\n  new PublishCommand({\n    TopicArn: topic.topicArn,\n    Message: \"\" as MyString,\n  });\n  new PublishCommand({\n    TopicArn: topic.topicArn,\n    // @ts-expect-error: Message must be of type MyString.\n    Message: \"\",\n  });\n});\n\nstaticTest(\n  (\n    topic: Topic<{\n      messageAttributesType: {\n        userId: { DataType: \"String\"; StringValue: ValueType<\"test\"> };\n      };\n    }>,\n  ) => {\n    new PublishCommand({\n      TopicArn: topic.topicArn,\n      Message: \"\",\n      MessageAttributes: {\n        userId: { DataType: \"String\", StringValue: \"test\" },\n      },\n    });\n    // @ts-expect-error: MessageAttributes are required.\n    new PublishCommand({\n      TopicArn: topic.topicArn,\n      Message: \"\",\n    });\n  },\n);\n"],
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAKO,+BAWPC,EAA2B,gCAiCpB,MAAMH,CAGb,CASE,YAAYI,EAA+B,CACzC,OAAO,IAAI,EAAAC,eAAYD,CAAK,CAC9B,CACF,IAEA,cAAYE,GAAqB,CAC/B,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAChB,QAAS,EACX,CAAC,EACD,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAChB,QAAS,GAET,eAAgB,GAChB,uBAAwB,EAC1B,CAAC,CACH,CAAC,KAED,cAAYA,GAAiC,CAC3C,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAChB,QAAS,GACT,eAAgB,GAChB,uBAAwB,EAC1B,CAAC,EAED,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAChB,QAAS,EACX,CAAC,CACH,CAAC,KAGD,cAAYA,GAAuD,CACjE,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAChB,QAAS,EACX,CAAC,EACD,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAEhB,QAAS,EACX,CAAC,CACH,CAAC,KAED,cAEIA,GAKG,CACH,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAChB,QAAS,GACT,kBAAmB,CACjB,OAAQ,CAAE,SAAU,SAAU,YAAa,MAAO,CACpD,CACF,CAAC,EAED,IAAIN,EAAe,CACjB,SAAUM,EAAM,SAChB,QAAS,EACX,CAAC,CACH,CACF",
  "names": ["publish_command_exports", "__export", "PublishCommand", "__toCommonJS", "import_client_sns", "import_static_test", "input", "BaseCommand", "topic"]
}
