'Lists the deployments under a deployment group for an
application registered within the AWS user account.
:type application_name: string
:param application_name: The name of an existing AWS CodeDeploy
application within the AWS user account.
:type deployment_group_name: string
:param deployment_group_name: The name of an existing deployment group
for the specified application.
:type include_only_statuses: list
:param include_only_statuses: A subset of deployments to list, by
status:
+ Created: Include in the resulting list created deployments.
+ Queued: Include in the resulting list queued deployments.
+ In Progress: Include in the resulting list in-progress deployments.
+ Succeeded: Include in the resulting list succeeded deployments.
+ Failed: Include in the resulting list failed deployments.
+ Aborted: Include in the resulting list aborted deployments.
:type create_time_range: dict
:param create_time_range: A deployment creation start- and end-time
range for returning a subset of the list of deployments.
:type next_token: string
:param next_token: An identifier that was returned from the previous
list deployments call, which can be used to return the next set of
deployments in the list.'

def list_deployments(self, application_name=None, deployment_group_name=None, include_only_statuses=None, create_time_range=None, next_token=None):

    params = {}
    if (application_name is not None):
        params['applicationName'] = application_name
    if (deployment_group_name is not None):
        params['deploymentGroupName'] = deployment_group_name
    if (include_only_statuses is not None):
        params['includeOnlyStatuses'] = include_only_statuses
    if (create_time_range is not None):
        params['createTimeRange'] = create_time_range
    if (next_token is not None):
        params['nextToken'] = next_token
    return self.make_request(action='ListDeployments', body=json.dumps(params))
