<!--
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
-->

[![Version](https://img.shields.io/npm/v/@adobe/aio-lib-cloudmanager.svg)](https://npmjs.org/package/@adobe/aio-lib-cloudmanager)
[![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-cloudmanager.svg)](https://npmjs.org/package/@adobe/aio-lib-cloudmanager)
[![Build Status](https://github.com/adobe/aio-lib-cloudmanager/workflows/CI%20Build/badge.svg?branch=main)](https://github.com/adobe/aio-lib-cloudmanager/actions?query=workflow%3A%22CI+Build%22)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-cloudmanager/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-cloudmanager/)

# Adobe I/O Cloud Manager Library

JavaScript SDK wrapping the [Adobe Cloud Manager API](https://www.adobe.io/experience-cloud/cloud-manager/).

### Installing

```bash
$ npm install @adobe/aio-lib-cloudmanager
```

### Usage
1) Initialize the SDK

```javascript
const sdk = require('@adobe/aio-lib-cloudmanager')

async function sdkTest() {
  //initialize sdk
  const client = await sdk.init('<orgId>', 'x-api-key', '<valid auth token>')
}
```

2) Call methods using the initialized SDK

```javascript
const sdk = require('@adobe/aio-lib-cloudmanager')

async function sdkTest() {
  // initialize sdk
  const client = await sdk.init('<orgId>', 'x-api-key', '<valid auth token>')

  // call methods
  try {
    // get... something
    const result = await client.listPrograms()
    console.log(result)

  } catch (e) {
    console.error(e)
  }
}
```

## Classes

<dl>
<dt><a href="#CloudManagerAPI">CloudManagerAPI</a></dt>
<dd><p>This class provides methods to call your Cloud Manager APIs.
Before calling any method initialize the instance by calling the <code>init</code> method on it
with valid values for orgId, apiKey and accessToken</p>
</dd>
</dl>

## Functions

<dl>
<dt><a href="#getCurrentStep">getCurrentStep(execution)</a> ⇒ <code><a href="#PipelineExecutionStepState">PipelineExecutionStepState</a></code></dt>
<dd><p>Find the first non-finished step in a pipeline execution</p>
</dd>
<dt><a href="#getWaitingStep">getWaitingStep(execution)</a> ⇒ <code><a href="#PipelineExecutionStepState">PipelineExecutionStepState</a></code></dt>
<dd><p>Find the first waiting step in a pipeline execution</p>
</dd>
<dt><a href="#init">init(orgId, apiKey, accessToken, baseUrl)</a> ⇒ <code><a href="#CloudManagerAPI">Promise.&lt;CloudManagerAPI&gt;</a></code></dt>
<dd><p>Returns a Promise that resolves with a new CloudManagerAPI object.</p>
</dd>
</dl>

## Typedefs

<dl>
<dt><a href="#EmbeddedProgram">EmbeddedProgram</a> : <code>object</code></dt>
<dd><p>A lightweight representation of a Program</p>
</dd>
<dt><a href="#Pipeline">Pipeline</a> : <code>object</code></dt>
<dd><p>A representation of a CI/CD Pipeline</p>
</dd>
<dt><a href="#PipelinePhase">PipelinePhase</a> : <code>object</code></dt>
<dd><p>Describes a phase of a pipeline</p>
</dd>
<dt><a href="#PipelineExecution">PipelineExecution</a> : <code>object</code></dt>
<dd><p>A representation of an execution of a CI/CD Pipeline.</p>
</dd>
<dt><a href="#PipelineExecutionStepState">PipelineExecutionStepState</a> : <code>object</code></dt>
<dd><p>Describes the status of a particular pipeline execution step for display purposes</p>
</dd>
<dt><a href="#PipelineStepMetrics">PipelineStepMetrics</a> : <code>object</code></dt>
<dd></dd>
<dt><a href="#Metric">Metric</a> : <code>object</code></dt>
<dd><p>A representation of a specific metric generated by a CI/CD Pipeline step.</p>
</dd>
<dt><a href="#Environment">Environment</a> : <code>object</code></dt>
<dd><p>A representation of an Environment known to Cloud Manager.</p>
</dd>
<dt><a href="#Variable">Variable</a> : <code>object</code></dt>
<dd><p>A named value than can be set on an Environment or Pipeline</p>
</dd>
<dt><a href="#ContentSet">ContentSet</a> : <code>object</code></dt>
<dd><p>A representation of a ContentSet custom</p>
</dd>
<dt><a href="#ContentFlow">ContentFlow</a> : <code>object</code></dt>
<dd><p>The Content Flow Execution</p>
</dd>
<dt><a href="#LogOptionRepresentation">LogOptionRepresentation</a> : <code>object</code></dt>
<dd></dd>
<dt><a href="#IPAllowedListBinding">IPAllowedListBinding</a> : <code>object</code></dt>
<dd><p>Describes an <strong>IP Allowed List Binding</strong></p>
</dd>
<dt><a href="#IPAllowedList">IPAllowedList</a> : <code>object</code></dt>
<dd><p>Describes an <strong>IP Allowed List</strong></p>
</dd>
<dt><a href="#ListPipelineOptions">ListPipelineOptions</a> : <code>object</code></dt>
<dd><p>Options to the listPipeline function</p>
</dd>
<dt><a href="#DownloadedLog">DownloadedLog</a> : <code>object</code></dt>
<dd></dd>
<dt><a href="#PipelineUpdate">PipelineUpdate</a> : <code>object</code></dt>
<dd></dd>
</dl>

<a name="CloudManagerAPI"></a>

## CloudManagerAPI
This class provides methods to call your Cloud Manager APIs.
Before calling any method initialize the instance by calling the `init` method on it
with valid values for orgId, apiKey and accessToken

**Kind**: global class  

* [CloudManagerAPI](#CloudManagerAPI)
    * [.orgId](#CloudManagerAPI+orgId) : <code>string</code>
    * [.apiKey](#CloudManagerAPI+apiKey) : <code>string</code>
    * [.accessToken](#CloudManagerAPI+accessToken) : <code>string</code>
    * [.baseUrl](#CloudManagerAPI+baseUrl) : <code>string</code>
    * [.addIpAllowlistBinding(programId, ipAllowlistId, environmentId, service)](#CloudManagerAPI+addIpAllowlistBinding) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.advanceCurrentExecution(programId, pipelineId)](#CloudManagerAPI+advanceCurrentExecution) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.cancelContentFlow(programId, contentFlowId)](#CloudManagerAPI+cancelContentFlow) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.cancelCurrentExecution(programId, pipelineId)](#CloudManagerAPI+cancelCurrentExecution) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.createContentFlow(programId, environmentId, contentFlow)](#CloudManagerAPI+createContentFlow) ⇒ [<code>Promise.&lt;ContentFlow&gt;</code>](#ContentFlow)
    * [.createContentSet(programId, contentSet)](#CloudManagerAPI+createContentSet) ⇒ [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet)
    * [.createExecution(programId, pipelineId, mode)](#CloudManagerAPI+createExecution) ⇒ [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution)
    * [.createIpAllowlist(programId, name, cidrBlocks)](#CloudManagerAPI+createIpAllowlist) ⇒ [<code>Promise.&lt;IPAllowedList&gt;</code>](#IPAllowedList)
    * [.deleteContentSet(programId, contentSetId)](#CloudManagerAPI+deleteContentSet) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.deleteEnvironment(programId, environmentId)](#CloudManagerAPI+deleteEnvironment) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.deleteIpAllowlist(programId, ipAllowlistId)](#CloudManagerAPI+deleteIpAllowlist) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.deletePipeline(programId, pipelineId)](#CloudManagerAPI+deletePipeline) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.deleteProgram(programId)](#CloudManagerAPI+deleteProgram) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.downloadLogs(programId, environmentId, service, name, days, outputDirectory)](#CloudManagerAPI+downloadLogs) ⇒ <code>Promise.&lt;Array.&lt;DownloadedLog&gt;&gt;</code>
    * [.getContentFlow(programId, contentFlowId)](#CloudManagerAPI+getContentFlow) ⇒ [<code>Promise.&lt;ContentFlow&gt;</code>](#ContentFlow)
    * [.getContentSet(programId, contentSetId)](#CloudManagerAPI+getContentSet) ⇒ [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet)
    * [.getCurrentExecution(programId, pipelineId)](#CloudManagerAPI+getCurrentExecution) ⇒ [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution)
    * [.getDeveloperConsoleUrl(programId, environmentId)](#CloudManagerAPI+getDeveloperConsoleUrl) ⇒ <code>Promise.&lt;string&gt;</code>
    * [.getEnvironmentVariables(programId, environmentId)](#CloudManagerAPI+getEnvironmentVariables) ⇒ <code>Promise.&lt;Array.&lt;Variable&gt;&gt;</code>
    * [.getExecution(programId, pipelineId, executionId)](#CloudManagerAPI+getExecution) ⇒ [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution)
    * [.getExecutionStepLog(programId, pipelineId, executionId, action, logFile, outputStream)](#CloudManagerAPI+getExecutionStepLog) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.getPipelineVariables(programId, pipelineId)](#CloudManagerAPI+getPipelineVariables) ⇒ <code>Promise.&lt;Array.&lt;Variable&gt;&gt;</code>
    * [.getQualityGateResults(programId, pipelineId, executionId, action)](#CloudManagerAPI+getQualityGateResults) ⇒ [<code>Promise.&lt;PipelineStepMetrics&gt;</code>](#PipelineStepMetrics)
    * [.init(orgId, apiKey, accessToken, baseUrl)](#CloudManagerAPI+init) ⇒ [<code>Promise.&lt;CloudManagerAPI&gt;</code>](#CloudManagerAPI)
    * [.invalidatePipelineCache(programId, pipelineId)](#CloudManagerAPI+invalidatePipelineCache) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.listAvailableLogOptions(programId, environmentId)](#CloudManagerAPI+listAvailableLogOptions) ⇒ <code>Promise.&lt;Array.&lt;LogOptionRepresentation&gt;&gt;</code>
    * [.listContentFlows(programId)](#CloudManagerAPI+listContentFlows) ⇒ <code>Promise.&lt;Array.&lt;ContentFlow&gt;&gt;</code>
    * [.listContentSets(programId)](#CloudManagerAPI+listContentSets) ⇒ <code>Promise.&lt;Array.&lt;ContentSet&gt;&gt;</code>
    * [.listEnvironments(programId)](#CloudManagerAPI+listEnvironments) ⇒ <code>Promise.&lt;Array.&lt;Environment&gt;&gt;</code>
    * [.listExecutions(programId, pipelineId, limit)](#CloudManagerAPI+listExecutions) ⇒ <code>Promise.&lt;Array.&lt;PipelineExecution&gt;&gt;</code>
    * [.listIpAllowlists(programId)](#CloudManagerAPI+listIpAllowlists) ⇒ [<code>Promise.&lt;IPAllowedList&gt;</code>](#IPAllowedList)
    * [.listPipelines(programId, options)](#CloudManagerAPI+listPipelines) ⇒ <code>Promise.&lt;Array.&lt;Pipeline&gt;&gt;</code>
    * [.listPrograms()](#CloudManagerAPI+listPrograms) ⇒ <code>Promise.&lt;Array.&lt;EmbeddedProgram&gt;&gt;</code>
    * [.removeIpAllowlistBinding(programId, ipAllowlistId, environmentId, service)](#CloudManagerAPI+removeIpAllowlistBinding) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.setEnvironmentVariables(programId, environmentId, variables)](#CloudManagerAPI+setEnvironmentVariables) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.setPipelineVariables(programId, pipelineId, variables)](#CloudManagerAPI+setPipelineVariables) ⇒ <code>Promise.&lt;object&gt;</code>
    * ~~[.startExecution(programId, pipelineId, mode)](#CloudManagerAPI+startExecution) ⇒ <code>Promise.&lt;string&gt;</code>~~
    * [.tailExecutionStepLog(programId, pipelineId, action, logFile, outputStream)](#CloudManagerAPI+tailExecutionStepLog) ⇒ [<code>Promise.&lt;PipelineExecutionStepState&gt;</code>](#PipelineExecutionStepState)
    * [.updateContentSet(programId, contentSetId, updatedContentSet)](#CloudManagerAPI+updateContentSet) ⇒ [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet)
    * [.updateIpAllowlist(programId, ipAllowlistId, cidrBlocks)](#CloudManagerAPI+updateIpAllowlist) ⇒ <code>Promise.&lt;object&gt;</code>
    * [.updatePipeline(programId, pipelineId, changes)](#CloudManagerAPI+updatePipeline) ⇒ [<code>Promise.&lt;Pipeline&gt;</code>](#Pipeline)

<a name="CloudManagerAPI+orgId"></a>

### cloudManagerAPI.orgId : <code>string</code>
The organization id

**Kind**: instance property of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
<a name="CloudManagerAPI+apiKey"></a>

### cloudManagerAPI.apiKey : <code>string</code>
The api key from your integration

**Kind**: instance property of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
<a name="CloudManagerAPI+accessToken"></a>

### cloudManagerAPI.accessToken : <code>string</code>
The access token from your integration

**Kind**: instance property of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
<a name="CloudManagerAPI+baseUrl"></a>

### cloudManagerAPI.baseUrl : <code>string</code>
The base URL for the API endpoint

**Kind**: instance property of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
<a name="CloudManagerAPI+addIpAllowlistBinding"></a>

### cloudManagerAPI.addIpAllowlistBinding(programId, ipAllowlistId, environmentId, service) ⇒ <code>Promise.&lt;object&gt;</code>
Bind an IP Allow List to an environment

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| ipAllowlistId | <code>string</code> | the allow list id |
| environmentId | <code>string</code> | the environment id |
| service | <code>string</code> | the service name |

<a name="CloudManagerAPI+advanceCurrentExecution"></a>

### cloudManagerAPI.advanceCurrentExecution(programId, pipelineId) ⇒ <code>Promise.&lt;object&gt;</code>
Advance current execution

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |

<a name="CloudManagerAPI+cancelContentFlow"></a>

### cloudManagerAPI.cancelContentFlow(programId, contentFlowId) ⇒ <code>Promise.&lt;object&gt;</code>
Cancel a content flow
Cancels an in progress flow

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| contentFlowId | <code>string</code> | the flow id |

<a name="CloudManagerAPI+cancelCurrentExecution"></a>

### cloudManagerAPI.cancelCurrentExecution(programId, pipelineId) ⇒ <code>Promise.&lt;object&gt;</code>
Cancel current execution

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |

<a name="CloudManagerAPI+createContentFlow"></a>

### cloudManagerAPI.createContentFlow(programId, environmentId, contentFlow) ⇒ [<code>Promise.&lt;ContentFlow&gt;</code>](#ContentFlow)
Create content Set Flow for environment

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;ContentFlow&gt;</code>](#ContentFlow) - the created content flow representation  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | The program id |
| environmentId | <code>string</code> | The environment id |
| contentFlow | [<code>ContentFlow</code>](#ContentFlow) | The body of the contentFlow |

<a name="CloudManagerAPI+createContentSet"></a>

### cloudManagerAPI.createContentSet(programId, contentSet) ⇒ [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet)
Create a Content set

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet) - the created content set  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| contentSet | <code>string</code> | the body of the content set. |

<a name="CloudManagerAPI+createExecution"></a>

### cloudManagerAPI.createExecution(programId, pipelineId, mode) ⇒ [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution)
Create a new execution for a pipeline, returning the execution.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution) - the new execution  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| mode | <code>string</code> | the pipeline execution mode |

<a name="CloudManagerAPI+createIpAllowlist"></a>

### cloudManagerAPI.createIpAllowlist(programId, name, cidrBlocks) ⇒ [<code>Promise.&lt;IPAllowedList&gt;</code>](#IPAllowedList)
Create IP Allow List

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;IPAllowedList&gt;</code>](#IPAllowedList) - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| name | <code>string</code> | the name |
| cidrBlocks | <code>Array.&lt;string&gt;</code> | the CIDR blocks |

<a name="CloudManagerAPI+deleteContentSet"></a>

### cloudManagerAPI.deleteContentSet(programId, contentSetId) ⇒ <code>Promise.&lt;object&gt;</code>
Delete Content Set

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| contentSetId | <code>string</code> | the content set id |

<a name="CloudManagerAPI+deleteEnvironment"></a>

### cloudManagerAPI.deleteEnvironment(programId, environmentId) ⇒ <code>Promise.&lt;object&gt;</code>
Delete an environment

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| environmentId | <code>string</code> | the environment id |

<a name="CloudManagerAPI+deleteIpAllowlist"></a>

### cloudManagerAPI.deleteIpAllowlist(programId, ipAllowlistId) ⇒ <code>Promise.&lt;object&gt;</code>
Update the CIDR blocks of an IP Allow List

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| ipAllowlistId | <code>string</code> | the allow list id |

<a name="CloudManagerAPI+deletePipeline"></a>

### cloudManagerAPI.deletePipeline(programId, pipelineId) ⇒ <code>Promise.&lt;object&gt;</code>
Delete a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy object  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |

<a name="CloudManagerAPI+deleteProgram"></a>

### cloudManagerAPI.deleteProgram(programId) ⇒ <code>Promise.&lt;object&gt;</code>
Delete a program

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |

<a name="CloudManagerAPI+downloadLogs"></a>

### cloudManagerAPI.downloadLogs(programId, environmentId, service, name, days, outputDirectory) ⇒ <code>Promise.&lt;Array.&lt;DownloadedLog&gt;&gt;</code>
Download log files from the environment to a specified directory.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;DownloadedLog&gt;&gt;</code> - the list of downloaded logs  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| environmentId | <code>string</code> | the environment id |
| service | <code>string</code> | the service specification |
| name | <code>string</code> | the log name |
| days | <code>number</code> | the number of days |
| outputDirectory | <code>string</code> | the output directory |

<a name="CloudManagerAPI+getContentFlow"></a>

### cloudManagerAPI.getContentFlow(programId, contentFlowId) ⇒ [<code>Promise.&lt;ContentFlow&gt;</code>](#ContentFlow)
Get Content Flow

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;ContentFlow&gt;</code>](#ContentFlow) - the Content Flow  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | The program id |
| contentFlowId | <code>string</code> | the content flow id |

<a name="CloudManagerAPI+getContentSet"></a>

### cloudManagerAPI.getContentSet(programId, contentSetId) ⇒ [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet)
Get Content Set

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet) - the content set  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| contentSetId | <code>string</code> | the content set id |

<a name="CloudManagerAPI+getCurrentExecution"></a>

### cloudManagerAPI.getCurrentExecution(programId, pipelineId) ⇒ [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution)
Get the current execution for a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution) - the execution  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |

<a name="CloudManagerAPI+getDeveloperConsoleUrl"></a>

### cloudManagerAPI.getDeveloperConsoleUrl(programId, environmentId) ⇒ <code>Promise.&lt;string&gt;</code>
Get the link to the developer console

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;string&gt;</code> - the console url  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| environmentId | <code>string</code> | the environment id |

<a name="CloudManagerAPI+getEnvironmentVariables"></a>

### cloudManagerAPI.getEnvironmentVariables(programId, environmentId) ⇒ <code>Promise.&lt;Array.&lt;Variable&gt;&gt;</code>
Get the list of variables for an environment

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;Variable&gt;&gt;</code> - the variables  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| environmentId | <code>string</code> | the environment id |

<a name="CloudManagerAPI+getExecution"></a>

### cloudManagerAPI.getExecution(programId, pipelineId, executionId) ⇒ [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution)
Get an execution for a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;PipelineExecution&gt;</code>](#PipelineExecution) - the execution  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| executionId | <code>string</code> | the execution id |

<a name="CloudManagerAPI+getExecutionStepLog"></a>

### cloudManagerAPI.getExecutionStepLog(programId, pipelineId, executionId, action, logFile, outputStream) ⇒ <code>Promise.&lt;object&gt;</code>
Write step log to an output stream.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| executionId | <code>string</code> | the execution id |
| action | <code>string</code> | the action |
| logFile | <code>string</code> | the log file to select a non-default value |
| outputStream | <code>object</code> | the output stream to write to |

<a name="CloudManagerAPI+getPipelineVariables"></a>

### cloudManagerAPI.getPipelineVariables(programId, pipelineId) ⇒ <code>Promise.&lt;Array.&lt;Variable&gt;&gt;</code>
Get the list of variables for a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;Variable&gt;&gt;</code> - the variables  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |

<a name="CloudManagerAPI+getQualityGateResults"></a>

### cloudManagerAPI.getQualityGateResults(programId, pipelineId, executionId, action) ⇒ [<code>Promise.&lt;PipelineStepMetrics&gt;</code>](#PipelineStepMetrics)
Get the quality gate results for a pipeline step

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;PipelineStepMetrics&gt;</code>](#PipelineStepMetrics) - the execution  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| executionId | <code>string</code> | the execution id |
| action | <code>string</code> | the action name |

<a name="CloudManagerAPI+init"></a>

### cloudManagerAPI.init(orgId, apiKey, accessToken, baseUrl) ⇒ [<code>Promise.&lt;CloudManagerAPI&gt;</code>](#CloudManagerAPI)
Initializes a CloudManagerAPI object and returns it.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;CloudManagerAPI&gt;</code>](#CloudManagerAPI) - a CloudManagerAPI object  

| Param | Type | Description |
| --- | --- | --- |
| orgId | <code>string</code> | the organization id |
| apiKey | <code>string</code> | the API key for your integration |
| accessToken | <code>string</code> | the access token for your integration |
| baseUrl | <code>string</code> | the base URL to access the API (defaults to https://cloudmanager.adobe.io) |

<a name="CloudManagerAPI+invalidatePipelineCache"></a>

### cloudManagerAPI.invalidatePipelineCache(programId, pipelineId) ⇒ <code>Promise.&lt;object&gt;</code>
Invalidate the cache for a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy object  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |

<a name="CloudManagerAPI+listAvailableLogOptions"></a>

### cloudManagerAPI.listAvailableLogOptions(programId, environmentId) ⇒ <code>Promise.&lt;Array.&lt;LogOptionRepresentation&gt;&gt;</code>
List the log options available for an environment

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;LogOptionRepresentation&gt;&gt;</code> - the log options for the environment  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| environmentId | <code>string</code> | the environment id |

<a name="CloudManagerAPI+listContentFlows"></a>

### cloudManagerAPI.listContentFlows(programId) ⇒ <code>Promise.&lt;Array.&lt;ContentFlow&gt;&gt;</code>
List content flows for program

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;ContentFlow&gt;&gt;</code> - an array of content flows  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | The program id |

<a name="CloudManagerAPI+listContentSets"></a>

### cloudManagerAPI.listContentSets(programId) ⇒ <code>Promise.&lt;Array.&lt;ContentSet&gt;&gt;</code>
List Content Sets for program

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;ContentSet&gt;&gt;</code> - list of the content sets for the program  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |

<a name="CloudManagerAPI+listEnvironments"></a>

### cloudManagerAPI.listEnvironments(programId) ⇒ <code>Promise.&lt;Array.&lt;Environment&gt;&gt;</code>
List environments for a program

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;Environment&gt;&gt;</code> - a list of environments  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |

<a name="CloudManagerAPI+listExecutions"></a>

### cloudManagerAPI.listExecutions(programId, pipelineId, limit) ⇒ <code>Promise.&lt;Array.&lt;PipelineExecution&gt;&gt;</code>
List the most recent executions for a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;PipelineExecution&gt;&gt;</code> - the list of executions  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| programId | <code>string</code> |  | the program id |
| pipelineId | <code>string</code> |  | the pipeline id |
| limit | <code>number</code> | <code>20</code> | the maximum number of executions to return (defaults to 20) |

<a name="CloudManagerAPI+listIpAllowlists"></a>

### cloudManagerAPI.listIpAllowlists(programId) ⇒ [<code>Promise.&lt;IPAllowedList&gt;</code>](#IPAllowedList)
List the program's defined IP Allow Lists

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;IPAllowedList&gt;</code>](#IPAllowedList) - - the IP Allow Lists  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |

<a name="CloudManagerAPI+listPipelines"></a>

### cloudManagerAPI.listPipelines(programId, options) ⇒ <code>Promise.&lt;Array.&lt;Pipeline&gt;&gt;</code>
Obtain a list of pipelines for the target program.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;Pipeline&gt;&gt;</code> - an array of Pipelines  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| options | [<code>ListPipelineOptions</code>](#ListPipelineOptions) | options |

<a name="CloudManagerAPI+listPrograms"></a>

### cloudManagerAPI.listPrograms() ⇒ <code>Promise.&lt;Array.&lt;EmbeddedProgram&gt;&gt;</code>
Obtain a list of programs for the target organization.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;Array.&lt;EmbeddedProgram&gt;&gt;</code> - an array of Programs  
<a name="CloudManagerAPI+removeIpAllowlistBinding"></a>

### cloudManagerAPI.removeIpAllowlistBinding(programId, ipAllowlistId, environmentId, service) ⇒ <code>Promise.&lt;object&gt;</code>
Unbind an IP Allow List from an environment

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| ipAllowlistId | <code>string</code> | the allow list id |
| environmentId | <code>string</code> | the environment id |
| service | <code>string</code> | the service name |

<a name="CloudManagerAPI+setEnvironmentVariables"></a>

### cloudManagerAPI.setEnvironmentVariables(programId, environmentId, variables) ⇒ <code>Promise.&lt;object&gt;</code>
Set the variables for an environment

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| environmentId | <code>string</code> | the environment id |
| variables | [<code>Array.&lt;Variable&gt;</code>](#Variable) | the variables |

<a name="CloudManagerAPI+setPipelineVariables"></a>

### cloudManagerAPI.setPipelineVariables(programId, pipelineId, variables) ⇒ <code>Promise.&lt;object&gt;</code>
Set the variables for a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| variables | [<code>Array.&lt;Variable&gt;</code>](#Variable) | the variables |

<a name="CloudManagerAPI+startExecution"></a>

### ~~cloudManagerAPI.startExecution(programId, pipelineId, mode) ⇒ <code>Promise.&lt;string&gt;</code>~~
***Deprecated***

Start an execution for a pipeline, returning the url of the new execution

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;string&gt;</code> - the execution url  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| mode | <code>string</code> | the pipeline execution mode |

<a name="CloudManagerAPI+tailExecutionStepLog"></a>

### cloudManagerAPI.tailExecutionStepLog(programId, pipelineId, action, logFile, outputStream) ⇒ [<code>Promise.&lt;PipelineExecutionStepState&gt;</code>](#PipelineExecutionStepState)
Tail step log to an output stream.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;PipelineExecutionStepState&gt;</code>](#PipelineExecutionStepState) - the completed step state  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| action | <code>string</code> | the action |
| logFile | <code>string</code> | the log file to select a non-default value |
| outputStream | <code>object</code> | the output stream to write to |

<a name="CloudManagerAPI+updateContentSet"></a>

### cloudManagerAPI.updateContentSet(programId, contentSetId, updatedContentSet) ⇒ [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet)
Update the content set definition.

The operation is a PUT, so the entire body has to be provided.

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;ContentSet&gt;</code>](#ContentSet) - the updated content set  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | The program id |
| contentSetId | <code>string</code> | The content set id |
| updatedContentSet | <code>string</code> | the body (JSON format) |

<a name="CloudManagerAPI+updateIpAllowlist"></a>

### cloudManagerAPI.updateIpAllowlist(programId, ipAllowlistId, cidrBlocks) ⇒ <code>Promise.&lt;object&gt;</code>
Update the CIDR blocks of an IP Allow List

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: <code>Promise.&lt;object&gt;</code> - a truthy value  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| ipAllowlistId | <code>string</code> | the allow list id |
| cidrBlocks | <code>Array.&lt;string&gt;</code> | the replacement CIDR blocks |

<a name="CloudManagerAPI+updatePipeline"></a>

### cloudManagerAPI.updatePipeline(programId, pipelineId, changes) ⇒ [<code>Promise.&lt;Pipeline&gt;</code>](#Pipeline)
Update a pipeline

**Kind**: instance method of [<code>CloudManagerAPI</code>](#CloudManagerAPI)  
**Returns**: [<code>Promise.&lt;Pipeline&gt;</code>](#Pipeline) - the new pipeline definition  

| Param | Type | Description |
| --- | --- | --- |
| programId | <code>string</code> | the program id |
| pipelineId | <code>string</code> | the pipeline id |
| changes | [<code>PipelineUpdate</code>](#PipelineUpdate) | the changes |

<a name="getCurrentStep"></a>

## getCurrentStep(execution) ⇒ [<code>PipelineExecutionStepState</code>](#PipelineExecutionStepState)
Find the first non-finished step in a pipeline execution

**Kind**: global function  
**Returns**: [<code>PipelineExecutionStepState</code>](#PipelineExecutionStepState) - the step state or a falsy object if all steps are finished  

| Param | Type | Description |
| --- | --- | --- |
| execution | [<code>PipelineExecution</code>](#PipelineExecution) | the execution |

<a name="getWaitingStep"></a>

## getWaitingStep(execution) ⇒ [<code>PipelineExecutionStepState</code>](#PipelineExecutionStepState)
Find the first waiting step in a pipeline execution

**Kind**: global function  
**Returns**: [<code>PipelineExecutionStepState</code>](#PipelineExecutionStepState) - the step state or a falsy object if no step is waiting  

| Param | Type | Description |
| --- | --- | --- |
| execution | [<code>PipelineExecution</code>](#PipelineExecution) | the execution |

<a name="init"></a>

## init(orgId, apiKey, accessToken, baseUrl) ⇒ [<code>Promise.&lt;CloudManagerAPI&gt;</code>](#CloudManagerAPI)
Returns a Promise that resolves with a new CloudManagerAPI object.

**Kind**: global function  
**Returns**: [<code>Promise.&lt;CloudManagerAPI&gt;</code>](#CloudManagerAPI) - a Promise with a CloudManagerAPI object  

| Param | Type | Description |
| --- | --- | --- |
| orgId | <code>string</code> | the organization id |
| apiKey | <code>string</code> | the API key for your integration |
| accessToken | <code>string</code> | the access token for your integration |
| baseUrl | <code>string</code> | the base URL to access the API (defaults to https://cloudmanager.adobe.io) |

<a name="EmbeddedProgram"></a>

## EmbeddedProgram : <code>object</code>
A lightweight representation of a Program

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | Identifier of the program. Unique within the space. |
| name | <code>string</code> | Name of the program |
| enabled | <code>boolean</code> | Whether this Program has been enabled for Cloud Manager usage |
| tenantId | <code>string</code> | Tenant Id |
| status | <code>string</code> | Status of the program |
| createdAt | <code>string</code> | Created time |
| updatedAt | <code>string</code> | Date of last change |

<a name="Pipeline"></a>

## Pipeline : <code>object</code>
A representation of a CI/CD Pipeline

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | Identifier of the pipeline. Unique within the program. |
| programId | <code>string</code> | Identifier of the program. Unique within the space. |
| name | <code>string</code> | Name of the pipeline |
| trigger | <code>string</code> | How should the execution be triggered. ON_COMMIT: each time one or more commits are pushed and the Pipeline is idle then a execution is triggered. MANUAL: triggerd through UI or API. |
| status | <code>string</code> | Pipeline status |
| createdAt | <code>string</code> | Create date |
| updatedAt | <code>string</code> | Update date |
| lastStartedAt | <code>string</code> | Last pipeline execution start |
| lastFinishedAt | <code>string</code> | Last pipeline execution end |
| phases | [<code>Array.&lt;PipelinePhase&gt;</code>](#PipelinePhase) | Pipeline phases in execution order |
| type | <code>string</code> | Pipeline type |

<a name="PipelinePhase"></a>

## PipelinePhase : <code>object</code>
Describes a phase of a pipeline

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | Name of the phase |
| type | <code>string</code> | Type of the phase |
| repositoryId | <code>string</code> | Identifier of the source repository. The code from this repository will be build at the start of this phase.  Mandatory if type=BUILD |
| branch | <code>string</code> | Name of the tracked branch or a fully qualified git tag (e.g. refs/tags/v1).   Assumed to be `master` if missing. |
| environmentId | <code>string</code> | Identifier of the target environment. Mandatory if type=DEPLOY |
| environmentType | <code>string</code> | Type of environment (for example stage or prod, readOnly = true) |
| steps | <code>Array.&lt;PipelineStep&gt;</code> | Steps to be included in the phase in execution order. Might be added or not, depending on permissions or configuration |

<a name="PipelineExecution"></a>

## PipelineExecution : <code>object</code>
A representation of an execution of a CI/CD Pipeline.

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | Pipeline execution identifier |
| programId | <code>string</code> | Identifier of the program. Unique within the space. |
| pipelineId | <code>string</code> | Identifier of the pipeline. Unique within the space. |
| artifactsVersion | <code>string</code> | Version of the artifacts generated during this execution |
| user | <code>string</code> | AdobeID who started the pipeline. Empty for auto triggered builds |
| status | <code>string</code> | Status of the execution |
| trigger | <code>string</code> | How the execution was triggered. |
| pipelineExecutionMode | <code>string</code> | The mode in which the execution occurred. EMERGENCY mode will skip certain steps and is only available to select AMS customers |
| createdAt | <code>string</code> | Timestamp at which the execution was created |
| updatedAt | <code>string</code> | Timestamp at which the status of the execution last changed |
| finishedAt | <code>string</code> | Timestamp at which the execution completed |
| pipelineType | <code>string</code> | Pipeline type |

<a name="PipelineExecutionStepState"></a>

## PipelineExecutionStepState : <code>object</code>
Describes the status of a particular pipeline execution step for display purposes

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> |  |
| stepId | <code>string</code> |  |
| phaseId | <code>string</code> |  |
| action | <code>string</code> | Name of the action |
| repository | <code>string</code> | Target repository |
| branch | <code>string</code> | Target branch |
| environment | <code>string</code> | Target environment |
| environmentId | <code>string</code> | Target environment id |
| environmentType | <code>string</code> | Target environment type |
| startedAt | <code>string</code> | Timestamp at which the step state started running |
| finishedAt | <code>string</code> | Timestamp at which the step completed |
| commitId | <code>string</code> | Target commit id |
| details | <code>object</code> | Additional details of the step |
| status | <code>string</code> | Action status |

<a name="PipelineStepMetrics"></a>

## PipelineStepMetrics : <code>object</code>
**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| metrics | [<code>Array.&lt;Metric&gt;</code>](#Metric) | metrics |

<a name="Metric"></a>

## Metric : <code>object</code>
A representation of a specific metric generated by a CI/CD Pipeline step.

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | KPI result identifier |
| severity | <code>string</code> | Severity of the metric |
| passed | <code>boolean</code> | Whether metric is considered passed |
| override | <code>boolean</code> | Whether user override the failed metric |
| actualValue | <code>string</code> | Expected value for the metric |
| expectedValue | <code>string</code> | Expected value for the metric |
| comparator | <code>string</code> | Comparator used for the metric |
| kpi | <code>string</code> | KPI identifier |

<a name="Environment"></a>

## Environment : <code>object</code>
A representation of an Environment known to Cloud Manager.

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | id |
| programId | <code>string</code> | Identifier of the program. Unique within the space. |
| name | <code>string</code> | Name of the environment |
| description | <code>string</code> | Description of the environment |
| type | <code>string</code> | Type of the environment |
| status | <code>string</code> | Status of the environment |
| region | <code>string</code> | Region of the environment |
| availableLogOptions | [<code>Array.&lt;LogOptionRepresentation&gt;</code>](#LogOptionRepresentation) | List of logs available in the environment |

<a name="Variable"></a>

## Variable : <code>object</code>
A named value than can be set on an Environment or Pipeline

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | Name of the variable. Can only consist of a-z, A-Z, _ and 0-9 and cannot begin with a number. |
| value | <code>string</code> | Value of the variable. Read-Write for non-secrets, write-only for secrets. The length of `secretString` values must be less than 500 characters. An empty value causes a variable to be deleted. |
| type | <code>string</code> | Type of the variable. Default `string` if missing. `secretString` variables are encrypted at rest. The type of a variable be changed after creation; the variable must be deleted and recreated. |
| service | <code>string</code> | Service of the variable. When not provided, the variable applies to all services. Currently the values 'author', 'publish', and 'preview' are supported. Note - this value is case-sensitive. |
| status | <code>string</code> | Status of the variable |

<a name="ContentSet"></a>

## ContentSet : <code>object</code>
A representation of a ContentSet custom

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | Identifier of the Content Set |
| name | <code>string</code> | The name of the content set |
| paths | <code>Array.&lt;ContentSetPath&gt;</code> | Included asset paths |
| programId | <code>string</code> | Identifier of the program. Unique within the space. |
| createdAt | <code>string</code> | Create date |
| updatedAt | <code>string</code> | Update date |

<a name="ContentFlow"></a>

## ContentFlow : <code>object</code>
The Content Flow Execution

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| contentSetId | <code>string</code> | The content set id |
| contentSetName | <code>string</code> | The content set name |
| srcEnvironmentId | <code>string</code> | Source environment id |
| srcEnvironmentName | <code>string</code> | Source environment name |
| destEnvironmentId | <code>string</code> | Destination environment id |
| destEnvironmentName | <code>string</code> | Destination environment name |
| tier | <code>string</code> | The tier, for example author |
| status | <code>string</code> | Status of the flows |
| destProgramId | <code>string</code> | Destination program id |
| resultDetails | <code>undefined</code> | Details of this content flow result |

<a name="LogOptionRepresentation"></a>

## LogOptionRepresentation : <code>object</code>
**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| service | <code>string</code> | Name of the service in environment. Example: author |
| name | <code>string</code> | Name of the log for service in environment. Example: aemerror |

<a name="IPAllowedListBinding"></a>

## IPAllowedListBinding : <code>object</code>
Describes an __IP Allowed List Binding__

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>integer</code> | Identifier of the IP Allowed List Binding to an Environment |
| tier | <code>string</code> | Tier of the environment. |
| status | <code>string</code> | Status of the binding. |
| programId | <code>integer</code> | Identifier of the program. |
| ipAllowListId | <code>integer</code> | Identifier of the IP allow list. |
| environmentId | <code>integer</code> | Identifier of the environment. |

<a name="IPAllowedList"></a>

## IPAllowedList : <code>object</code>
Describes an __IP Allowed List__

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>integer</code> | Identifier of the IP Allowed List |
| name | <code>string</code> | Name of the IP Allowed List |
| programId | <code>integer</code> | Identifier of the program. |
| ipCidrSet | <code>Array.&lt;string&gt;</code> | IP CIDR Set |
| bindings | [<code>Array.&lt;IPAllowedListBinding&gt;</code>](#IPAllowedListBinding) | IP Allowlist bindings |

<a name="ListPipelineOptions"></a>

## ListPipelineOptions : <code>object</code>
Options to the listPipeline function

**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| busy | <code>boolean</code> | if true, only busy pipelines will be returned |

<a name="DownloadedLog"></a>

## DownloadedLog : <code>object</code>
**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| path | <code>string</code> | the path where the log was stored |
| url | <code>string</code> | the url of the log that was downloaded |

<a name="PipelineUpdate"></a>

## PipelineUpdate : <code>object</code>
**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| branch | <code>string</code> | the new branch |
| repositoryId | <code>string</code> | the new repository id |
| devEnvironmentId | <code>string</code> | the new dev environment id |
| stageEnvironmentId | <code>string</code> | the new stage environment id |
| prodEnvironmentId | <code>string</code> | the new prod environment id |

### Debug Logs

```bash
LOG_LEVEL=debug <your_call_here>
```

Prepend the `LOG_LEVEL` environment variable and `debug` value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls.

### Contributing

Contributions are welcome! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information.

### Licensing

This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.

