|
| 1 | +import { CodeStarconnectionsClient } from "./CodeStarconnectionsClient"; |
| 2 | +import { |
| 3 | + CreateConnectionCommand, |
| 4 | + CreateConnectionCommandInput, |
| 5 | + CreateConnectionCommandOutput |
| 6 | +} from "./commands/CreateConnectionCommand"; |
| 7 | +import { |
| 8 | + DeleteConnectionCommand, |
| 9 | + DeleteConnectionCommandInput, |
| 10 | + DeleteConnectionCommandOutput |
| 11 | +} from "./commands/DeleteConnectionCommand"; |
| 12 | +import { |
| 13 | + GetConnectionCommand, |
| 14 | + GetConnectionCommandInput, |
| 15 | + GetConnectionCommandOutput |
| 16 | +} from "./commands/GetConnectionCommand"; |
| 17 | +import { |
| 18 | + ListConnectionsCommand, |
| 19 | + ListConnectionsCommandInput, |
| 20 | + ListConnectionsCommandOutput |
| 21 | +} from "./commands/ListConnectionsCommand"; |
| 22 | +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; |
| 23 | + |
| 24 | +/** |
| 25 | + * <p>This AWS CodeStar Connections API Reference provides descriptions and usage examples of |
| 26 | + * the operations and data types for the AWS CodeStar Connections API. You can use the |
| 27 | + * Connections API to work with connections and installations.</p> |
| 28 | + * <p> |
| 29 | + * <i>Connections</i> are configurations that you use to connect AWS |
| 30 | + * resources to external code repositories. Each connection is a resource that can be given to |
| 31 | + * services such as CodePipeline to connect to a third-party repository such as Bitbucket. For |
| 32 | + * example, you can add the connection in CodePipeline so that it triggers your pipeline when a |
| 33 | + * code change is made to your third-party code repository. Each connection is named and |
| 34 | + * associated with a unique ARN that is used to reference the connection.</p> |
| 35 | + * <p>When you create a connection, the console initiates a third-party connection handshake. |
| 36 | + * <i>Installations</i> are the apps that are used to conduct this handshake. For |
| 37 | + * example, the installation for the Bitbucket provider type is the Bitbucket Cloud app. When you |
| 38 | + * create a connection, you can choose an existing installation or create one.</p> |
| 39 | + * <p>You can work with connections by calling:</p> |
| 40 | + * <ul> |
| 41 | + * <li> |
| 42 | + * <p> |
| 43 | + * <a>CreateConnection</a>, which creates a uniquely named connection that can be |
| 44 | + * referenced by services such as CodePipeline.</p> |
| 45 | + * </li> |
| 46 | + * <li> |
| 47 | + * <p> |
| 48 | + * <a>DeleteConnection</a>, which deletes the specified connection.</p> |
| 49 | + * </li> |
| 50 | + * <li> |
| 51 | + * <p> |
| 52 | + * <a>GetConnection</a>, which returns information about the connection, including |
| 53 | + * the connection status.</p> |
| 54 | + * </li> |
| 55 | + * <li> |
| 56 | + * <p> |
| 57 | + * <a>ListConnections</a>, which lists the connections associated with your |
| 58 | + * account.</p> |
| 59 | + * </li> |
| 60 | + * </ul> |
| 61 | + * <p>For information about how to use AWS CodeStar Connections, see the <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html">AWS CodePipeline User |
| 62 | + * Guide</a>.</p> |
| 63 | + */ |
| 64 | +export class CodeStarconnections extends CodeStarconnectionsClient { |
| 65 | + /** |
| 66 | + * <p>Creates a connection that can then be given to other AWS services like CodePipeline so |
| 67 | + * that it can access third-party code repositories. The connection is in pending status until |
| 68 | + * the third-party connection handshake is completed from the console.</p> |
| 69 | + */ |
| 70 | + public createConnection( |
| 71 | + args: CreateConnectionCommandInput, |
| 72 | + options?: __HttpHandlerOptions |
| 73 | + ): Promise<CreateConnectionCommandOutput>; |
| 74 | + public createConnection( |
| 75 | + args: CreateConnectionCommandInput, |
| 76 | + cb: (err: any, data?: CreateConnectionCommandOutput) => void |
| 77 | + ): void; |
| 78 | + public createConnection( |
| 79 | + args: CreateConnectionCommandInput, |
| 80 | + options: __HttpHandlerOptions, |
| 81 | + cb: (err: any, data?: CreateConnectionCommandOutput) => void |
| 82 | + ): void; |
| 83 | + public createConnection( |
| 84 | + args: CreateConnectionCommandInput, |
| 85 | + optionsOrCb?: |
| 86 | + | __HttpHandlerOptions |
| 87 | + | ((err: any, data?: CreateConnectionCommandOutput) => void), |
| 88 | + cb?: (err: any, data?: CreateConnectionCommandOutput) => void |
| 89 | + ): Promise<CreateConnectionCommandOutput> | void { |
| 90 | + const command = new CreateConnectionCommand(args); |
| 91 | + if (typeof optionsOrCb === "function") { |
| 92 | + this.send(command, optionsOrCb); |
| 93 | + } else if (typeof cb === "function") { |
| 94 | + if (typeof optionsOrCb !== "object") |
| 95 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 96 | + this.send(command, optionsOrCb || {}, cb); |
| 97 | + } else { |
| 98 | + return this.send(command, optionsOrCb); |
| 99 | + } |
| 100 | + } |
| 101 | + |
| 102 | + /** |
| 103 | + * <p>The connection to be deleted.</p> |
| 104 | + */ |
| 105 | + public deleteConnection( |
| 106 | + args: DeleteConnectionCommandInput, |
| 107 | + options?: __HttpHandlerOptions |
| 108 | + ): Promise<DeleteConnectionCommandOutput>; |
| 109 | + public deleteConnection( |
| 110 | + args: DeleteConnectionCommandInput, |
| 111 | + cb: (err: any, data?: DeleteConnectionCommandOutput) => void |
| 112 | + ): void; |
| 113 | + public deleteConnection( |
| 114 | + args: DeleteConnectionCommandInput, |
| 115 | + options: __HttpHandlerOptions, |
| 116 | + cb: (err: any, data?: DeleteConnectionCommandOutput) => void |
| 117 | + ): void; |
| 118 | + public deleteConnection( |
| 119 | + args: DeleteConnectionCommandInput, |
| 120 | + optionsOrCb?: |
| 121 | + | __HttpHandlerOptions |
| 122 | + | ((err: any, data?: DeleteConnectionCommandOutput) => void), |
| 123 | + cb?: (err: any, data?: DeleteConnectionCommandOutput) => void |
| 124 | + ): Promise<DeleteConnectionCommandOutput> | void { |
| 125 | + const command = new DeleteConnectionCommand(args); |
| 126 | + if (typeof optionsOrCb === "function") { |
| 127 | + this.send(command, optionsOrCb); |
| 128 | + } else if (typeof cb === "function") { |
| 129 | + if (typeof optionsOrCb !== "object") |
| 130 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 131 | + this.send(command, optionsOrCb || {}, cb); |
| 132 | + } else { |
| 133 | + return this.send(command, optionsOrCb); |
| 134 | + } |
| 135 | + } |
| 136 | + |
| 137 | + /** |
| 138 | + * <p>Returns the connection ARN and details such as status, owner, and provider type.</p> |
| 139 | + */ |
| 140 | + public getConnection( |
| 141 | + args: GetConnectionCommandInput, |
| 142 | + options?: __HttpHandlerOptions |
| 143 | + ): Promise<GetConnectionCommandOutput>; |
| 144 | + public getConnection( |
| 145 | + args: GetConnectionCommandInput, |
| 146 | + cb: (err: any, data?: GetConnectionCommandOutput) => void |
| 147 | + ): void; |
| 148 | + public getConnection( |
| 149 | + args: GetConnectionCommandInput, |
| 150 | + options: __HttpHandlerOptions, |
| 151 | + cb: (err: any, data?: GetConnectionCommandOutput) => void |
| 152 | + ): void; |
| 153 | + public getConnection( |
| 154 | + args: GetConnectionCommandInput, |
| 155 | + optionsOrCb?: |
| 156 | + | __HttpHandlerOptions |
| 157 | + | ((err: any, data?: GetConnectionCommandOutput) => void), |
| 158 | + cb?: (err: any, data?: GetConnectionCommandOutput) => void |
| 159 | + ): Promise<GetConnectionCommandOutput> | void { |
| 160 | + const command = new GetConnectionCommand(args); |
| 161 | + if (typeof optionsOrCb === "function") { |
| 162 | + this.send(command, optionsOrCb); |
| 163 | + } else if (typeof cb === "function") { |
| 164 | + if (typeof optionsOrCb !== "object") |
| 165 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 166 | + this.send(command, optionsOrCb || {}, cb); |
| 167 | + } else { |
| 168 | + return this.send(command, optionsOrCb); |
| 169 | + } |
| 170 | + } |
| 171 | + |
| 172 | + /** |
| 173 | + * <p>Lists the connections associated with your account.</p> |
| 174 | + */ |
| 175 | + public listConnections( |
| 176 | + args: ListConnectionsCommandInput, |
| 177 | + options?: __HttpHandlerOptions |
| 178 | + ): Promise<ListConnectionsCommandOutput>; |
| 179 | + public listConnections( |
| 180 | + args: ListConnectionsCommandInput, |
| 181 | + cb: (err: any, data?: ListConnectionsCommandOutput) => void |
| 182 | + ): void; |
| 183 | + public listConnections( |
| 184 | + args: ListConnectionsCommandInput, |
| 185 | + options: __HttpHandlerOptions, |
| 186 | + cb: (err: any, data?: ListConnectionsCommandOutput) => void |
| 187 | + ): void; |
| 188 | + public listConnections( |
| 189 | + args: ListConnectionsCommandInput, |
| 190 | + optionsOrCb?: |
| 191 | + | __HttpHandlerOptions |
| 192 | + | ((err: any, data?: ListConnectionsCommandOutput) => void), |
| 193 | + cb?: (err: any, data?: ListConnectionsCommandOutput) => void |
| 194 | + ): Promise<ListConnectionsCommandOutput> | void { |
| 195 | + const command = new ListConnectionsCommand(args); |
| 196 | + if (typeof optionsOrCb === "function") { |
| 197 | + this.send(command, optionsOrCb); |
| 198 | + } else if (typeof cb === "function") { |
| 199 | + if (typeof optionsOrCb !== "object") |
| 200 | + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); |
| 201 | + this.send(command, optionsOrCb || {}, cb); |
| 202 | + } else { |
| 203 | + return this.send(command, optionsOrCb); |
| 204 | + } |
| 205 | + } |
| 206 | +} |
0 commit comments