swagger: '2.0'
info: # TODO: https://github.com/cycloidio/youdeploy-http-api/issues/7 Fill all the fields of this section before opening the API outside Cycloid
  title: Welcome!
  description: This is the Cycloid's API Reference. It provides descriptions, syntax, and usage examples for each of the actions and data types available within our console.
  termsOfService: 'https://console.cycloid.io/terms'
  contact:
    name: The Great Owl
    url: 'https://www.cycloid.io'
    email: contact@cycloid.io
  license:
    name: 'Cycloid @copyrights'
    url: 'https://cycloid.io'
  version: '0'
host: 'http-api.cycloid.io'
schemes:
  - https
consumes:
  - application/vnd.cycloid.io.v1+json
  - application/x-www-form-urlencoded
produces:
  - application/json
securityDefinitions:
  api_key:
    type: apiKey
    description: The API authorization is done with JWT tokens
    in: header
    name: Authorization
  api_key_query:
   type: apiKey
   description: The API authorization is done with JWT tokens in the query string
   in: query
   name: api_key
security:
  - api_key: []
  - api_key_query: []
tags:
  - name: Cycloid
    description: Operation related to Cycloid's application.
  - name: Organizations
    description: Operations for organizations.
  - name: Organization teams
    description: Operations for teams which belong to an organization.
  - name: Organization projects
    description: Operations for projects which belong to an organization.
  - name: Organization members
    description: Operations for members of an organization.
  - name: User
    description: Operations for the authenticated user.
  - name: Organization pipelines
    description: Operations regarding pipelines in an organization.
  - name: Organization pipelines jobs
    description: Operations on jobs belonging to a pipeline.
  - name: Organization pipelines jobs build
    description: Operations on build of a job from a pipeline.
  - name: Organization Infrastructure
    description: Operations on the infrastructure of an organization
  - name: Organization Environments
    description: >-
      Operations to perform on an environment associated to a project of an
      organization.
  - name: Organization Logs
    description: Operations on the logs of a project
  - name: Organization Children
    description: Operations on the children of an organization
  - name: Organization Infrastructure Policies
    description: Operations on the infrastructure policies of an organization
  - name: Organization Subscriptions
    description: Operations on the subscriptions
  - name: Cost Estimation
    description: Operations related to estimating cost of infrastructure.
  - name: Organization kpis
    description: Operations on KPIs of an organization
parameters:
  page_index:
    name: page_index
    description: The page number to request. The first page is 1.
    in: query
    type: integer
    format: uint32
    default: 1
  page_size:
    name: page_size
    description: The number of items at most which the response can have.
    in: query
    type: integer
    format: uint32
    default: 1000
  default:
    name: default
    description: Value describing whether to return default
    in: query
    type: boolean
    default: false
  organization_canonical_query:
    name: organization_canonical
    description: A canonical of a organization used for filtering.
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  child_canonical_query:
    name: child_canonical
    description: A canonical of a child organization used for filtering.
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  project_name_query:
    name: project_name
    description: Search by project's name
    in: query
    type: string
  project_created_at_query:
    name: project_created_at
    description: Search by project's creation date
    in: query
    type: integer
    format: uint64
  project_description_query:
    name: project_description
    description: Search by project's description
    in: query
    type: string
  project_config_repository_canonical_query:
    name: project_config_repository_canonical
    description: Search by project's config repository's canonical
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  team_name_query:
    name: team_name
    description: Search by team's name
    in: query
    type: string
  team_created_at_query:
    name: team_created_at
    description: Search by team's creation date
    in: query
    type: integer
    format: uint64
  team_description_query:
    name: team_description
    description: Search by team's description
    in: query
    type: string
  service_catalog_own_query:
    name: service_catalog_own
    description: >
      Filters the Service Catalogs to only show the ones owned
      by the User Organization
    in: query
    type: boolean
  service_catalog_template_query:
    name: service_catalog_template
    description: >
      Filters the Service Catalogs to only show the ones that are templates
    in: query
    type: boolean
    default: false
  owner_query:
    name: member_id
    description: Search by entity's owner
    in: query
    type: integer
    format: uint32
  order_by_query:
    in: query
    name: order_by
    type: string
    description: >
      Allows to order the list of items. Example usage: field_name:asc
  concourse_page_since:
    name: concourse_page_since
    description: The time after which we should look for entities to return.
    in: query
    type: integer
    format: uint64
    default: 0
  concourse_page_until:
    name: concourse_page_until
    description: The time before which we should look for entities to return.
    in: query
    type: integer
    format: uint64
    default: 0
  concourse_page_limit:
    name: concourse_page_limit
    description: The number of items at most which the response can have.
    in: query
    type: integer
    format: uint64
    default: 10
  cost_tag_key:
    name: key
    description: The key of a tag
    in: query
    required: false
    type: string
    minLength: 3
    maxLength: 127
    pattern: '^[\w\-+=.:/@ ]+$'
  cost_tag_key_value_filter:
    name: tags
    description: The key and value of a tag concatenated by a ;.
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
      minLength: 4
      maxLength: 127
      pattern: '^[^;]+;[^;]+$'
  cost_granularity_filter:
    name: granularity
    description: >-
      Sets the cost granularity, it can be month, week, day.
    in: query
    required: true
    allowEmptyValue: false
    type: string
    enum:
      - month
      - week
      - day
  cost_metrics_filter:
    name: metrics
    description: >-
      Which metrics are returned in the query. For more information about blended
      and unblended rates, see https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/.

      Valid values are BlendedCost, UnblendedCost, and UsageQuantity.

      If you return the UsageQuantity metric, the service aggregates all usage
      numbers without taking into account the units. For example, if you aggregate
      usageQuantity across all of EC2, the results aren't meaningful because EC2
      compute hours and data transfer are measured in different units (for example,
      hours vs. GB). To get more meaningful UsageQuantity metrics, filter by UsageType
      or UsageTypeGroups.
    in: query
    type: array
    required: true
    collectionFormat: multi
    allowEmptyValue: false
    uniqueItems: true
    items:
      type: string
      enum:
        - BlendedCost
        - UnblendedCost
        - UsageQuantity
  cost_begin_filter:
    name: begin
    description: >-
      Sets the start date for retrieving AWS costs. The start date is inclusive.
    in: query
    type: string
    required: true
    format: date
  cost_end_filter:
    name: end
    description: >-
      Sets the end dates for retrieving AWS costs. The end date is exclusive.
    in: query
    type: string
    required: true
    format: date
  cost_currency_filter:
    name: currency
    description: >-
      The currency required for the results.
    in: query
    required: true
    type: string
    enum:
      - USD
      - EUR
      - CNY
      - GBP
  cost_projects_filter:
    name: projects
    description: >-
      The names of the projects that you can use to filter your results
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_environments_filter:
    name: environments
    description: >-
      The names of the environments that you can use to filter your results
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_services_filter:
    name: services
    description: >-
      The names of the services that you can use to filter and group your results.
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_categories_filter:
    name: categories
    description: >-
      The names of the categories that you can use to filter and group your results.
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
      enum:
        - other
        - compute
        - storage
        - database
        - dev_tools
        - networking
        - analytics
        - containers
        - machine_learning
        - multimedia
        - security
  cost_dashboard_filter_values:
    name: dashboard
    description: >-
      Specifies if the filter values are for the dashboard
    in: query
    required: false
    type: boolean
    default: false
  cloud_provider_account_id:
    name: cloud_provider_account_id
    description: The id of an account in the Cloud Provider.
    in: path
    required: true
    type: string
  cost_linked_accounts_filter:
    name: linked_accounts
    description: >-
      The ids of the linked accounts that you can use to filter your results
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_master_accounts_filter:
    name: master_accounts
    description: >-
      The ids of the master accounts that you can use to filter your results
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_providers_filter:
    name: providers
    description: >-
      The names of the providers that you can use to filter your results
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_regions_filter:
    name: regions
    description: >-
      The names of the regions that you can use to filter your results
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_resources_filter:
    name: resources
    description: >-
      The names of the resources that you can use to filter your results
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  cost_resource_tagging_filter:
    name: resource_tagging
    description: >-
      Filter results by only tagged or not tagged resources
    in: query
    required: false
    type: string
    enum:
      - tagged_resources
      - untagged_resources
  cost_group_by_filter:
    name: group_by
    description: >-
      Represents a group when you specify a group by criteria, or in the response to a
      query with a specific grouping.
    in: query
    type: array
    allowEmptyValue: false
    collectionFormat: multi
    uniqueItems: true
    items:
      type: string
      enum:
        - environment
        - service
        - instance_type
        - category
        - location
        - linked_account
        - project
        - record_type
  cost_record_type_filter:
    name: record_types
    description: >-
      The type of records that you can use to filter your results.
      For example usage or credit.
    in: query
    required: false
    collectionFormat: multi
    allowEmptyValue: false
    type: array
    items:
      type: string
  organization_canonical:
    name: organization_canonical
    description: A canonical of an organization.
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  environment_canonical:
    name: environment_canonical
    description: The environment canonical to use as part of a path
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 100
    pattern: '^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$'
  kpi_canonical:
    name: kpi_canonical
    description: A canonical of a kpi.
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  cache_path_query:
    name: cache_path
    description: The cache path to use as part of a clearTaskCache request
    in: query
    required: false
    type: string
    default: ""
  team_canonical:
    name: team_canonical
    description: A canonical of a team.
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  project_canonical:
    name: project_canonical
    description: A canonical of a project.
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 100
    pattern: '^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$'
  api_key_canonical:
    name: api_key_canonical
    description: A canonical of an API key.
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  pipeline_name:
    name: inpath_pipeline_name
    description: A pipeline name
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_.]+[a-z0-9]+$'
  pipeline_name_query:
    name: pipeline_name
    description: A pipeline name
    in: query
    required: true
    type: string
    minLength: 1
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_.]+[a-z0-9]+$'
  concourse_pipeline_name_query:
    name: concourse_pipeline_name
    description: A pipeline name
    in: query
    required: false
    type: string
    minLength: 1
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_.]+[a-z0-9]+$'
  project_canonical_query:
    name: project_canonical
    description: A list of projects' canonical to filter from
    in: query
    type: string
    required: false
    pattern: '^[\da-z]+(?:(?:[\da-z\-._]+)?[\da-z])?$'
  environment_canonical_query:
    name: environment_canonical
    description: A list of environments' canonical to filter from
    in: query
    type: string
    minLength: 1
    maxLength: 100
    required: false
    pattern: '^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$'
  statuses_query:
    name: statuses
    description: >-
      List of statuses that you want to filter a pipeline/job with. Pipeline can
      be either paused or unpaused, but jobs can be started, pending, succeeded,
      failed, errored, aborted. So if any of a pipeline's job has one of the given
      status, the associated pipeline will be included in the response.
    in: query
    type: array
    required: false
    collectionFormat: multi
    allowEmptyValue: true
    uniqueItems: true
    items:
      type: string
      enum:
        - aborted
        - errored
        - failed
        - paused
        - pending
        - started
        - succeeded
  build_id:
    name: build_id
    description: A build id
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 20
    pattern: '^[0-9]+$'
  job_name:
    name: job_name
    description: A job name
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 150
  step_name:
    name: step_name
    description: A step name from a job task
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 150
  resource_name:
    name: resource_name
    description: A resource name
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 150
  filter_version:
    name: filter_version
    description: A version of a resource
    in: query
    type: array
    items:
      type: string
    required: false
    minLength: 1
  resource_version_id:
    name: resource_version_id
    description: A resource's version id
    in: path
    required: true
    type: integer
    format: uint64
  service_catalog_ref:
    name: service_catalog_ref
    description: A Service Catalog name
    in: path
    required: true
    type: string
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  use_case_canonical:
    name: use_case_canonical
    description: A use case canonical
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  credential_canonical:
    name: credential_canonical
    description: A Credential canonical
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  credential_canonical_query:
    name: credential_canonical
    description: A Credential canonical
    in: query
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  credential_canonical_not_required_query:
    name: credential_canonical
    description: A Credential canonical
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  credential_type_query:
    name: credential_type
    description: |
      Deprecated. Please use credential_types.
      A Credential type
    in: query
    type: string
    enum:
      - ssh
      - aws
      - custom
      - azure
      - azure_storage
      - gcp
      - basic_auth
      - elasticsearch
      - swift
  credential_types_query:
    name: credential_types
    description: Multiple Credential types
    in: query
    type: array
    allowEmptyValue: true
    collectionFormat: multi
    uniqueItems: true
    items:
      type: string
      enum:
        - ssh
        - aws
        - custom
        - azure
        - azure_storage
        - gcp
        - basic_auth
        - elasticsearch
        - swift
  credential_options_service_query:
    name: service
    in: query
    type: string
    enum:
      - "gcp_bigquery"
    required: true
  git_url_query:
    name: git_url
    description: Git URL to repository
    in: query
    required: true
    type: string
    pattern: '^((/|~)[^/]*)+.(\.git)|(([\w\]+@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(/)?'
  external_backend_id:
    name: external_backend_id
    description: External Backend ID
    in: path
    required: true
    type: integer
    format: uint32
  external_backend_default_query:
    name: external_backend_default
    description: Filter for default Terraform External Backend
    in: query
    type: boolean
  service_catalog_source_canonical:
    name: service_catalog_source_canonical
    description: Organization Service Catalog Sources canonical
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  service_catalog_service_catalog_source_query:
    name: service_catalog_service_catalog_source
    description: The canonical of a Service Catalog Source the Service Catalog belongs to
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  service_catalog_source_canonical_query:
    name: service_catalog_source_canonical
    description: Organization Service Catalog Sources canonical
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  config_repository_canonical:
    name: config_repository_canonical
    description: Organization Config Repositories canonical
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  aws_next_token:
    name: next
    description: The token to retrieve the next page of results
    in: query
    type: string
    minLength: 1
  aws_infrastructure_resource_query:
    name: resource
    description: >-
      Supported AWS type of resource to query.
      The parameter can be specified several times in order to request for different kind of resources.
    in: query
    type: array
    allowEmptyValue: false
    collectionFormat: multi
    uniqueItems: true
    items:
      type: string
      enum:
        - instances
        - vpcs
        - images
        - security_groups
        - subnets
        - volumes
        - snapshots
        - cache_clusters
        - load_balancers_v1
        - load_balancers_v2
        - db_instances
        - buckets
  aws_tags:
    name: tag
    description: >-
      An amazon tag, represented as `key|value` and where `key` or `value`
      could be omitted but not both, in order to select resources which has
      a `key` or a `value` whatever is its counterpart.
      `key` nor `value` can contains the `|` character.
      The parameter can be specified several times in order to request resources
      which match with at least one of the `tag|value` pairs
    in: query
    type: array
    allowEmptyValue: false
    collectionFormat: multi
    uniqueItems: true
    items:
      type: string
      minLength: 2
      maxLength: 383
      pattern: '^(?:(?:[\w\-+=.:/@ ]+\|)|(?:\|[\w\-+=.:/@ ]+)|(?:[\w\-+=.:/@ ]+\|[\w\-+=.:/@ ]+))$'
  timestamp_range_begin_query:
    name: begin
    description: >-
      The unix timestamp in seconds, which indicate the start of the time range.
    in: query
    type: integer
    format: uint64
    required: false
  timestamp_range_end_query:
    name: end
    description: >-
      The unix timestamp in seconds, which indicate the end of the time range.
    in: query
    type: integer
    format: uint64
    required: false
  timestamp_range_begin_query_ms:
    name: begin
    description: >-
      The unix timestamp in milliseconds, which indicate the start of the time
      range.
    in: query
    type: integer
    format: uint64
    required: false
  timestamp_range_end_query_ms:
    name: end
    description: >-
      The unix timestamp in milliseconds, which indicate the end of the time
      range.
    in: query
    type: integer
    format: uint64
    required: false
  raw_query:
    name: query
    description: >-
      A free text which the content depends of the context of the API endpoint.
      Can be a free text value or a complete query expressed of supported query
      language.
    in: query
    type: string
    required: false
    minLength: 1
  log_source_id:
    name: log_source_id
    description: >-
      A unique identifier, which group log's entries under under a context,
      established by the source.
    in: path
    required: true
    type: string
    minLength: 1
  event_type:
    name: type
    description: >-
      Specify the types of the events to be requested.
      The returned events must have one of the specified types.
    in: query
    type: array
    required: false
    allowEmptyValue: false
    collectionFormat: multi
    items:
      type: string
      enum:
        - Cycloid
        - AWS
        - Monitoring
        - Custom
  event_severity:
    name: severity
    description: >-
      Specify the severities of the events to be requested.
      The returned events must have one of the specified severities.
    in: query
    type: array
    required: false
    allowEmptyValue: false
    collectionFormat: multi
    items:
      type: string
      enum:
        - info
        - warn
        - err
        - crit
  provider_canonical:
    name: provider_canonical
    description: A canonical of a Provider
    in: path
    required: true
    type: string
    minLength: 3
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  resource_canonical:
    name: resource_canonical
    description: A canonical of a Resource
    in: path
    required: true
    type: string
    minLength: 3
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  role_canonical:
    name: role_canonical
    description: Organization Role canonical
    type: string
    in: path
    required: true
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  verification_token:
    name: verification_token
    description: A token for verifying emails, invitations, etc.
    in: path
    required: true
    type: string
    minLength: 5
  authentication_token:
    name: authentication_token
    description: A token for authenticating login vie email
    in: path
    required: true
    type: string
    minLength: 5
  social_type:
    name: social_type
    description: The OAuth Social type
    in: path
    required: true
    type: string
    enum:
      - azuread
      - saml2
      - google
      - github
  oauth_code:
    name: oauth_code
    description: The OAuth code returned form the Social Provider
    required: true
    in: query
    type: string
  infra_policy_canonical:
    name: infra_policy_canonical
    description: The canonical of an InfraPolicy.
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  infra_policy_canonical_query:
    name: infra_policy_canonical
    description: Search by infra policy canonical
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  infra_policy_name_query:
    name: infra_policy_name
    description: Search by InfraPolicy's name
    in: query
    type: string
  infra_policy_created_at_query:
    name: infra_policy_created_at
    description: Search by InfraPolicy's creation date
    in: query
    type: integer
    format: uint64
  infra_policy_severity_query:
    name: infra_policy_severity
    description: Search by InfraPolicy's severity
    in: query
    type: string
    enum:
      - critical
      - warning
      - advisory
  infra_policy_enabled_query:
    name: infra_policy_enabled
    description: Search by InfraPolicy's enabled
    in: query
    type: boolean
  invitation_created_at_query:
    name: invitation_created_at
    description: Search by Invitation's creation date
    in: query
    type: integer
    format: uint64
  invitation_state_query:
    name: invitation_state
    description: Search by Invitation's state
    in: query
    type: string
    enum:
      - accepted
      - pending
      - declined
  kpi_retrieve_data:
    name: fetch_data
    description: >
      Flag to retrieve KPIs' data upon retrieving KPIs themselves
    in: query
    type: boolean
    required: false
  favorite:
    name: favorite
    description: >
      Flag to retrieve favorite data from the members favorite list.
    in: query
    type: boolean
    required: false
  cloud_cost_management_account_canonical:
      name: cloud_cost_management_account_canonical
      description: The canonical of an CloudCostManagementAccount.
      in: path
      required: true
      type: string
      minLength: 3
      maxLength: 100
      pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  cloud_cost_management_account_created_at_query:
    name: cloud_cost_management_account_created_at_query
    description: Search by Cloud Cost Management account's creation date
    in: query
    type: integer
    format: uint64
  jwt:
    name: jwt
    description: Token with the information about state and credentials.
    in: query
    required: true
    type: string
  inventory_resource_id:
    name: inventory_resource_id
    description: Inventory Resource ID
    in: path
    required: true
    type: integer
    format: uint32
  inventory_resource_provider_query:
    name: resources_provider
    description: Provider of Inventory Resource
    in: query
    required: true
    type: string
  resource_pool_canonical:
    name: resource_pool_canonical
    description: Organization Resource Pool canonical
    type: string
    in: path
    required: true
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  quota_id:
    name: quota_id
    description: Quota ID
    in: path
    required: true
    type: integer
    format: uint32
  appearance_canonical:
    name: appearance_canonical
    description: A canonical of an appearance.
    in: path
    required: true
    type: string
    minLength: 1
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  service_status_canonical:
    name: service_status_canonical
    description: The canonical of the service you want to get the status from
    in: path
    required: true
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  use_case_query:
    name: use_case
    description: A use case of a stack to be selectd from the stack config
    in: query
    type: string
    minLength: 3
    maxLength: 100
    pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  member_id:
    name: member_id
    description: A member id
    in: path
    required: true
    type: integer
    format: uint32
responses:
  not_found_entity_in_path:
    description: >-
      The response sent when any of the entities present in the path is not
      found.
    schema:
      $ref: '#/definitions/ErrorPayload'
    headers:
      Content-Length:
        description: The length of the response body in octets (8-bit bytes).
        type: integer
        format: uint64
    examples:
      application/json:
        errors:
          - message: Entity not found
            code: NotFoundEntity
  not_enough_permissions:
    description: >-
      The authenticated user cannot perform the operation because, it doesn't
      have permissions for such operation.
    schema:
      $ref: '#/definitions/ErrorPayload'
    headers:
      Content-Length:
        description: The length of the response body in octets (8-bit bytes).
        type: integer
        format: uint64
    examples:
      application/json:
        errors:
          - message: Not enough permissions to perform the operation
            code: Unauthorized
  unexpected_error:
    description: >-
      The response sent when an unexpected error happened, as known as an
      internal server error.
    schema:
      $ref: '#/definitions/ErrorPayload'
    headers:
      Content-Length:
        description: The length of the response body in octets (8-bit bytes).
        type: integer
        format: uint64
    examples:
      application/json:
        errors:
          - message: Server Internal error
            code: Unexpected
  unprocessable_entity:
    description: >-
      All the custom errors that are generated from the Cycloid API
    schema:
      $ref: '#/definitions/ErrorPayload'
    headers:
      Content-Length:
        description: The length of the response body in octets (8-bit bytes).
        type: integer
        format: uint64
    examples:
      application/json:
        errors:
          - message: some error
            code: SomeCode
  unauthenticated:
    description: >-
      The user cannot be authenticated with the credentials which she/he
      has used.
    headers:
      Content-Length:
        description: The length of the response body in octets (8-bit bytes).
        type: integer
        format: uint64
    schema:
      $ref: '#/definitions/ErrorPayload'
    examples:
      application/json:
        errors:
          - code: Unauthenticated
            message: invalid credentials
  required_content_length_header:
    description: The request has a body but it doesn't have a Content-Length header.
  retry_operation:
    description: >-
      The operation couldn't be executed or completed and it should retried.
    headers:
      Retry-After:
        description: The number of seconds to wait until retry the request
        type: integer
        format: uint16
    schema:
      $ref: '#/definitions/ErrorPayload'
    examples:
      application/json:
        errors:
          - code: RetryOperation
            message: Operation must be retried.
  locked_state:
    description: >-
      The operation couldn't be executed or completed because the state is locked.
    schema:
      $ref: '#/definitions/ErrorPayload'
    headers:
      Content-Length:
        description: The length of the response body in octets (8-bit bytes).
        type: integer
        format: uint64
    examples:
      application/json:
        errors:
          - message: some error
            code: SomeCode
definitions:
  AppVersion:
    title: AppVersion
    type: object
    required:
      - version
      - branch
      - revision
    properties:
      version:
        description: The version of the application.
        type: string
        minLength: 5
      branch:
        description: The Git branch used to build the application.
        type: string
        minLength: 1
      revision:
        description: The Git revision used to build the application.
        type: string
        minLength: 8
        maxLength: 40
  GeneralStatus:
    title: GeneralStatus
    type: object
    required:
      - status
      - message
      - checks
    properties:
      status:
        description: The overall status for the application.
        type: string
        enum:
          - Unknown
          - Success
          - Error
      message:
        description: Message providing information regarding the status.
        type: string
        minLength: 1
      checks:
        description: List of all checks report type/name/status.
        type: array
        items:
          $ref: '#/definitions/CheckReport'
  CheckReport:
    title: CheckReport
    type: object
    required:
      - canonical
      - category
      - status
      - message
    properties:
      canonical:
        description: The name of the service checked.
        type: string
        minLength: 1
      category:
        description: The category of the service checked.
        type: string
        minLength: 1
      status:
        description: The status of the service checked.
        type: string
        enum:
          - Unknown
          - Success
          - Error
      message:
        description: The message providing information regarding the state of the service.
        type: string
        minLength: 1
  AppConfig:
    title: AppConfig
    type: object
    description: >-
      Global app configuration that includes all the settings and capabilities of the Cycloid instance.
      It is intended to be used by clients to modify the UI accordingly.
    required:
      - authentication
    properties:
      authentication:
        description: Configuration of available authentication methods.
        $ref: '#/definitions/AuthConfig'
  AuthConfig:
    title: AuthConfig
    type: object
    required:
      - local
      - oauth
      - saml2
    properties:
      local:
        description: Local authentication method configuration.
        $ref: '#/definitions/AuthConfigLocalAuth'
      oauth:
        description: List of OAuth providers.
        type: array
        items:
          $ref: '#/definitions/AuthConfigOAuth'
      saml2:
        description: List of SAML2 providers.
        type: array
        items:
          $ref: '#/definitions/AuthConfigSAML'
  AuthConfigLocalAuth:
    title: AppConfigLocalAuth
    type: object
    required:
      - enabled
    properties:
      enabled:
        description: Whether local authentication is enabled
        type: boolean
  AuthConfigOAuth:
    title: AppConfigAuthOAuth
    type: object
    discriminator: type
    required:
      - type
      - provider
      - client_id
    properties:
      provider:
        description: Name of the OAuth identity provider.
        type: string
      client_id:
        description: ID of the OAuth client.
        type: string
      type:
        description: Type is used as discriminator for different OAuth identity provider definitions.
        type: string
  AzureADAuthConfig:
    title: AppConfigAzureADOAuth
    description: AzureAD OAuth configuration
    allOf:
      - $ref: '#/definitions/AuthConfigOAuth'
      - type: object
        required:
          - tenant_id
        properties:
          tenant_id:
            description: ID of the OAuth tenant.
            type: string
  GoogleOAuthConfig:
    title: AppConfigGoogleOAuth
    description: Google OAuth configuration
    allOf:
      - $ref: '#/definitions/AuthConfigOAuth'
  GitHubOAuthConfig:
    title: AppConfigGitHubOAuth
    description: GitHub OAuth configuration.
    allOf:
      - $ref: '#/definitions/AuthConfigOAuth'
      - type: object
        required:
          - host_address
        properties:
          host_address:
            description: |
              GitHub host address is used to determine where the request for the token should be sent.
              In most cases this address will be https://api.github.com`, but it could be different
              for onprem clients that use GitHub Enterprise.
            type: string
  AuthConfigSAML:
    title: AppConfigSAML
    type: object
    required:
      - provider
      - sso_url
    properties:
      provider:
        description: Entity ID of the SAML2 identity provider.
        type: string
      sso_url:
        description: SSO URL to which the user should be redirected in order to authenticate with the Identity Provider.
        type: string
        format: uri
  Pagination:
    title: Pagination
    type: object
    required:
      - total
      - index
      - size
    properties:
      total:
        description: The total number of items.
        type: integer
        format: uint64
        minimum: 0
      index:
        description: The index of the page sent (the first page is 1).
        type: integer
        format: uint64
        minimum: 1
      size:
        description: The size of the page (the number of entities per page)
        type: integer
        format: uint64
        minimum: 0
  PaginationConcourse:
    title: PaginationConcourse
    type: object
    required:
      - next
      - previous
    properties:
      next:
        $ref: '#/definitions/PageConcourse'
        x-nullable: true
      previous:
        $ref: '#/definitions/PageConcourse'
        x-nullable: true
  PageConcourse:
    title: PageConcourse
    type: object
    required:
      - since
      - until
      - limit
    properties:
      since:
        description: Entities returned should have a higher timestamp than this one
        type: integer
        format: uint64
      until:
        description: Entities returned should have a lower timestamp than this one
        type: integer
        format: uint64
      limit:
        description: The maximum number of entities to return
        type: integer
        format: uint64
  PaginationAWS:
    title: AWS Pagination
    type: object
    required:
      - next
    properties:
      next:
        description: >-
          The token to retrieve the next page of results.
          Empty string when there isn't a next page.
        type: string
  Filters:
    title: Filters
    description: Filters is the possible values the filters can have on list requests
    type: object
  Organization:
    title: Organization
    description: >-
      The entity which holds all the direct information attached to an
      organization.
    type: object
    required:
      - id
      - canonical
      - ci_team_name
      - ci_url
      - ci_port
      - name
      - quotas
      - can_create_appearance
      - can_children_create_appearance
      - mfa_enabled
      - blocked
      - has_children
      - created_at
      - updated_at
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      ci_team_name:
        type: string
      ci_url:
        type: string
      ci_port:
        type: string
      name:
        type: string
        minLength: 3
      blocked:
        type: array
        items:
          type: string
      has_children:
        type: boolean
      quotas:
        type: boolean
      can_create_appearance:
        type: boolean
      can_children_create_appearance:
        type: boolean
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      admins:
        type: array
        items:
          $ref: '#/definitions/MemberOrg'
      subscription:
        $ref: '#/definitions/Subscription'
      appearance:
        $ref: '#/definitions/Appearance'
      mfa_enabled:
        type: boolean
  NewOrganization:
    title: Create Organization
    description: >-
      The entity which represents a new organization to create in the
      application.
    type: object
    required:
      - name
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 3
  UpdateOrganization:
    title: Update Organization
    description: >-
      The entity which represents the information of an organization to be
      updated.
    type: object
    required:
      - name
    properties:
      name:
        type: string
        minLength: 3
      quotas:
        type: boolean
      can_children_create_appearance:
        type: boolean
      mfa_enabled:
        type: boolean
  Team:
    title: Team
    description: The entity which represents the information of a team.
    type: object
    required:
      - id
      - canonical
      - name
      - created_at
      - updated_at
      - roles
      - member_count
      - members_preview
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 3
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this team. When a user is the owner of a
          team it has all the permissions on it.
          In the event where the user has been deleted this field might be empty.
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      roles:
        type: array
        items:
          $ref: '#/definitions/Role'
        minItems: 1
      member_count:
        description: The total count of members of the team.
        type: integer
        format: uint32
      members_preview:
        description: Preview of the list of team members, limited to 6 members.
        type: array
        items:
          $ref: '#/definitions/MemberTeam'
        maxItems: 6
  SimpleTeam:
    title: SimpleTeam
    description: The entity which represents the information of a team a bit simplified.
    type: object
    required:
      - id
      - canonical
      - name
      - created_at
      - updated_at
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 3
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this team. When a user is the owner of a
          team it has all the permissions on it.
          In the event where the user has been deleted this field might be empty.
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  NewTeam:
    title: Create Team
    description: The entity which represents the information of a new team.
    type: object
    required:
      - name
      - roles_canonical
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 3
      owner:
        type: string
        description: |
          User canonical that owns this team. If omitted then the person
          creating this team will be assigned as owner. When a user is the
          owner of a team it has all the permissions on it.
      roles_canonical:
        description: The roles to be assigned to a team.
        type: array
        items:
          type: string
          minLength: 3
          maxLength: 100
          pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  UpdateTeam:
    title: Update Team
    description: The entity which represents the information of the team to be updated.
    type: object
    required:
      - canonical
      - name
      - roles_canonical
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 3
      owner:
        type: string
        description: |
          User canonical that owns this team. Only the owner or an
          organization admin can update this field. When a user is the owner
          of a team it has all the permission on it.
      roles_canonical:
        description: The roles to be re-assigned to a team.
        type: array
        items:
          type: string
          minLength: 3
          maxLength: 100
          pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  Project:
    title: Project
    description: The entity which represents the information of a project.
    type: object
    required:
      - id
      - canonical
      - name
      - created_at
      - updated_at
      - environments
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      name:
        type: string
        minLength: 1
      description:
        type: string
      environments:
        type: array
        items:
          $ref: '#/definitions/Environment'
      service_catalog:
        $ref: '#/definitions/ServiceCatalog'
        description: >-
          The Service Catalog that was used to create project.
      team:
        $ref: '#/definitions/SimpleTeam'
        description: >-
          The Team that was used to create project.
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this project. When a user is the owner of a
          project it has all the permissions on it.
          In the event where the user has been deleted that field might be empty.
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      config_repository_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      import_status:
        description: The import process status.
        type: string
        enum:
          - succeeded
          - failed
          - importing
      favorite:
        type: boolean
  NewProject:
    title: Create Project
    description: The entity which represents the information of a new project.
    type: object
    required:
      - name
      - config_repository_canonical
      - service_catalog_ref
    properties:
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      name:
        type: string
        minLength: 1
      service_catalog_ref:
        description: >-
          It's the ref of the Service Catalog, like 'cycloidio:stack-magento'
        type: string
      description:
        type: string
        description: |
          A description regarding the project to help identify/remember details,
          implementation, purpose, etc.
      owner:
        type: string
        description: |
          User canonical that owns this project. If omitted then the person
          creating this project will be assigned as owner. When a user is the
          owner of a project it has all the permissions on it.
      config_repository_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      team_canonical:
        description: |
          Is only required when the using Quotas, it'll link the Project
          to the Team
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
    additionalProperties: false
  UpdateProject:
    title: Update Project
    description: >-
      The entity which represents the information of the project to be updated.
    type: object
    required:
      - name
      - service_catalog_ref
      - updated_at
    properties:
      name:
        type: string
        minLength: 1
      description:
        type: string
      service_catalog_ref:
        description: >-
          It's the ref of the Service Catalog, like 'cycloidio:stack-magento'
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+:[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        type: string
      owner:
        type: string
        description: |
          User canonical that owns this project. Only the owner or an
          organization admin can update such a field. When a user is the owner
          of a project it has all the permission on it.
      cloud_provider:
        type: string
        description: |
          The cloud provider canonical that this project is using - between the
          supported ones.
        enum:
          - aws
          - google
          - azurerm
          - flexibleengine
          - openstack
      config_repository_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        description: |
          The config_repository_canonical points to new Config Repository the project
          will be using. If this value is filled and it's different from the
          current one, the whole project will be migrated to new CR, meaning
          configuration files will also be moved.
          If the project didn't have config_repository_canonical set, this action will
          only attach the project to the CR, it won't create/move any files.
          In order to be sure everything works, make sure the
          config_repository_canonical is pointing at the CR with the same git
          repository that was used during project creation.
          Although the config_repository_canonical is not marked as required,
          it's actually required for projects that are already using CR. This
          field not being required is only for compatibility with older projects,
          which are not having CR yet.
      updated_at:
        type: integer
        description: |
          This will be used to assert that the Project is in it's last updated form
          because if not we could have inconsistencies with the environments. The 
          format is in seconds, basically UNIX format.
        format: uint64
        minimum: 0
    additionalProperties: false
  ProjectEnvironmentConfig:
    title: Project Environment Config
    description: |
      Representation of project's environment configuration done via the forms.
      The full forms file is returned, but the use case picked has the
      Set variables matching the current configuration - if any.
    type: object
    required:
      - use_case
      - forms
    properties:
      use_case:
        description: The use case picked for that environment
        type: string
      resource_pool_canonical:
        type: string
        description: The resource pool canonical, only require when using Quotas
      forms:
        type: object
        $ref: '#/definitions/FormsFileV3'
  FormsValidation:
    title: Forms validation
    description: >-
      Validates a given Form's file
    type: object
    required:
      - form_file
    properties:
      form_file:
        type: object
        description: A form's file to any given version
  FormsValidationResult:
    title: FormsValidationResult
    description: The result of the validation, if errors is empty means that is correct
    required:
      - forms
      - errors
    properties:
      forms:
        type: object
        $ref: '#/definitions/FormsFileV3'
      errors:
        type: array
        items:
          type: string
  FormsFileV3:
    title: Forms File V3
    description: >-
    type: object
    required:
      - use_cases
      - version
    properties:
      version:
        type: string
      use_cases:
        type: array
        items:
          $ref: '#/definitions/FormUseCase'
  FormUseCase:
    title: Forms File Use case
    description: >-
    type: object
    required:
      - name
      - sections
    properties:
      name:
        type: string
      sections:
        type: array
        items:
          $ref: '#/definitions/FormSection'
  FormSection:
    title: Forms File Section
    description: >-
    type: object
    required:
      - name
      - groups
    properties:
      name:
        type: string
      groups:
        type: array
        items:
          $ref: '#/definitions/FormGroup'
  FormGroup:
    title: Forms File Group
    description: >-
    type: object
    required:
      - name
      - technologies
      - vars
    properties:
      name:
        type: string
      technologies:
        type: array
        items:
          type: string
      condition:
        type: string
        description: Condition required to be respected to be able to configure that group.
      folded:
        type: boolean
        description: >-
          Whether or not the group should be displayed to the user. Variables within this group must be usable as such (not required, or with a default if required)
      vars:
        type: array
        items:
          $ref: '#/definitions/FormEntity'
  FormEntity:
    title: Forms file's Entity
    description: >-
      This describes all the attributes possible to configure a form's variable
    type: object
    required:
      - key
      - name
      - type
      - widget
    properties:
      key:
        type: string
        description: >-
          The key is the name of variables for the ansible/pipeline/terraform technologies.
          If this is a first level variable then: keyX. If you have multiple terraform modules
          then use: module.Y.keyX to help identify the unique variable.
      name:
        type: string
        description: >-
          The name of the variable displayed to the user
      widget:
        type: string
        description: >-
          The widget used to display the data in the most suitable way
        enum:
          - auto_complete
          - dropdown
          - radios
          - slider_list
          - slider_range
          - number
          - simple_text
          - switch
          - text_area
          - cy_cred
          - cy_scs
          - cy_crs
          - cy_branch
          - cy_inventory_resource
          - hidden
      widget_config:
        type: object
        description: >-
          Some specific configuration that could be applied to that widget.
          Currently only a few widgets can be configured:
            * cy_cred
              * 'cred_types' (list): reduce the types of credentials retrieved to that list. See supported types of credentials
              * 'display_keys' (bool): to specify if the path + key have to be written or only the path
            * radio
              * 'orientation' (string): whether you want to display it in an 'horizontal' or 'vertical' way
            * cy_inventory_resource
              * 'provider' (string): The provider like '"provider[\"registry.terraform.io/hashicorp/aws\"]"'
              * 'type'  (string): The type of the resource like 'aws_vpc'
              * 'name' (string): The name of the resource like 'front'
              * 'module' (string): The module name like 'module.lemp'
              * 'label' (string): The label of the resource, this only applies for resources created directly from the API/FE
              * 'attributes' (string): The query string to filter the attributes like 'ingress[0].protocol[eq]=tcp'
              * 'custom_attributes' (string): The query string to filter the custom_attributes like 'ingress[0].protocol[eq]=tcp'
              * 'attribute' (string): The path to the attribute to actually use as value
      type:
        type: string
        description: >-
          The type of data handled - used to manipulate/validate the input, and also validate default/values
        enum:
          - integer
          - float
          - string
          - array
          - boolean
          - map
      required:
        type: boolean
        description: >-
          Whether or not the field is required - that helps distinguish "optional" variables
          and allows to set default if necessary and present
      folded:
        type: boolean
        description: >-
          Whether or not the entity should be displayed to the user. This entity must be usable as such (not required, or with a default if required)
      default:
        type: object
        description: >-
          Default can take 2 kinds of definition.

          The first one is simply the variable to assign if nothing is
          given by the user and that the variable is required.

          The second one is dynamic default, meaning default that can vary
          based on conditions.
          The format is as follows:
            options:
              - name: "Name of set (can be omitted)"
                condition: "$env == 'dev'"
                default: t2.micro
              - condition: "$env == 'prod'"
                default: t2.large
      current:
        type: object
        description: >-
          The current value that was previously configured for this variable upon
          creation or update. In case of shared variables having different values,
          it will be empty, and 'mismatch_values' will be filled instead.
      mismatch_values:
        type: array
        items:
          type: object
        description: >-
          This is filled only when a shared variable does not have the same values anymore.
          e.g. a variable 'foo' was shared between 'ansible' and 'pipeline', was set to 'bar',
          but now the value found for 'ansible' is 'bus', while it's still 'bar' for the pipeline.
          In such situation, the Forms don't know anymore which is the correct data and will return
          both, while unsetting the 'Current' field.
      unit:
        type: string
        description: >-
          The unit to be displayed for the variable, helping to know what's
          being manipulated: amount of servers, Go, users, etc.
      description:
        type: string
        description: >-
          The description helping users understand the interest/impact of such variable/change
      values:
        type: object
        description: >-
          Values can take 2 kinds of definition.

          First one is a list of object, such as list of integer, maps, etc.
          Values allowed, e.g. [1, 10, 20, 50]. Note: In case of SliderRange
          only 2 values should be provided: [min, max], in case of providing
          them the other way around some validation test will fail.

          Second one is dynamic values, meaning values that can vary based on
          conditions.
          The format is as follows:
            options:
              - name: "Name of set (can be omitted)"
                condition: "$env == 'dev'"
                values: [dev-ami1, dev-ami2, dev-ami3]
              - condition: "$env == 'prod'"
                values: [prod-ami1, prod-ami2, prod-ami3]
      source:
        type: string
        description: >-
          The source is only used for the branch widget to reference the key of the
          SCS or CR that the branches have to be read from. Because a branch in itself
          cannot exist, the user has to indicate from which SCS or CR he wants to retrieve
          branches. The source has to reference the key of an entity of a widget: 'CyCRS' or 'CySCS'
      validations:
        description: >-
          An array of validations and relative errors for this entitiy. 
          For example:
            validations: 
              - regexp: "^proj_.*$" 
                error_message: "the value must have 'proj_' as prefix"
              - regexp: "^.*_awesome$" 
                error_message: "the value must have '_awesome' as suffix"
          At the moment only regexp validations are implemented but 
          we can expect objects with a 'type', and 'error_message' field.
          The type field can hold the constraint, as in the case of regexp or 
          hipotetically a moe complex object.
        type: array
        items:
          type: object
      depends_on:
        description: >-
          List of keys that are required to use this entity
        type: array
        items:
          type: string
      values_ref:
        description: >-
          It's a URL in which the values have to be fetched from
        type: string
  FormInputs:
    title: Forms inputs
    description: |
      The array of variables set by the user via the forms with the associated environment
      canonical and use case upon project creation.
    required:
      - service_catalog_ref
      - inputs
    properties:
      service_catalog_ref:
        description: |
          It's the ref of the Service Catalog, like 'cycloidio:stack-magento'
        type: string
      inputs:
        type: array
        description: |
          The variables set within a form with the corresponding environment
          canonical and use case
        items:
          $ref: '#/definitions/FormInput'
  FormInput:
    title: Forms input
    description: |
      The variables set within a form with the corresponding
      environment canonical and use case
    required:
      - use_case
      - environment_canonical
      - vars
    properties:
      use_case:
        type: string
        description: The use case to load
      environment_canonical:
        type: string
        description: The environment canonical
      resource_pool_canonical:
        type: string
        description: The resource pool canonical, only require when using Quotas
      vars:
        type: object
        description: |
          Forms variables filled, the format to respect is as follows
          {
            "sectionX": {
              "group1": {
                "key1": "value1",
                "key2": "value2",
                "key3": "value3"
              },
            },
            "sectionY": {
              "group2": {
                "key1": "value1",
                "key2": "value2",
                "key3": "value3"
              },
            },
            "sectionZ": {
              "group3": {
                "key1": "value2"
              },
            }
          }
          Keys being the variable name that you want to see substituted/defined,
          while the section and group are the one from the form's file.
  UserAccountEmail:
    title: User's email
    description: The email address of a user.
    required:
      - email
      - verified
      - purpose
    properties:
      email:
        type: string
        format: email
      verified:
        type: boolean
      purpose:
        description: >-
          This values are set by the application to indicate the purpose of the
          email address. At least there is always one which is the primary.
        type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
  UpdateUserAccountEmail:
    title: User's email
    description: The email address of a user to be updated.
    required:
      - email
      - purpose
    properties:
      email:
        type: string
        format: email
      purpose:
        description: >-
          This values are set by the application to indicate the purpose of the
          email address. At least there is always one which is the primary.
        type: string
  UserAccount:
    title: User's account
    description: >-
      The user's account contains information related with the authenticated
      user.
    required:
      - created_at
      - updated_at
      - last_login
      - emails
      - username
      - given_name
      - family_name
      - locale
      - mfa_enabled
    properties:
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      last_login:
        type: integer
        format: uint64
        minimum: 0
      emails:
        type: array
        items:
          $ref: '#/definitions/UserAccountEmail'
        minItems: 1
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      given_name:
        type: string
        minLength: 2
      family_name:
        type: string
        minLength: 2
      picture_url:
        type: string
        format: uri
      locale:
        description: User's preferred language
        type: string
        enum: ["en", "fr", "es"]
      country:
        $ref: '#/definitions/Country'
      guide:
        $ref: '#/definitions/UserGuide'
      mfa_enabled:
        type: boolean
  NewUserAccount:
    title: Sign up
    description: >-
      Create a new user account.
    required:
      - username
      - email
      - password
      - given_name
      - family_name
    properties:
      invitation_token:
        type: string
        minLength: 5
        description: >-
          The field is used when a user signup from an invitation to an organization.
          Giving the token, the created user will be automatically added to the organization.
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      email:
        type: string
        format: email
      password:
        type: string
        format: password
        minLength: 8
      given_name:
        type: string
        minLength: 2
      family_name:
        type: string
        minLength: 2
      country_code:
        description: Code of a country the user is from
        type: string
        pattern: '^[A-Z]{2}$'
      locale:
        description: User's preferred language
        type: string
        enum: ["en", "fr", "es"]
  NewAWSMarketplaceUserAccount:
    title: Sign up from AWS Marketplace
    description: >-
      Create a new AWS Marketplace user account.
    required:
      - username
      - email
      - password
      - given_name
      - family_name
      - aws_marketplace_token
    properties:
      aws_marketplace_token:
        type: string
        minLength: 1
        description: >-
          The AWS marketplace token
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      email:
        type: string
        format: email
      password:
        type: string
        format: password
        minLength: 8
      given_name:
        type: string
        minLength: 2
      family_name:
        type: string
        minLength: 2
      country_code:
        description: Code of a country the user is from
        type: string
        pattern: '^[A-Z]{2}$'
      locale:
        description: User's preferred language
        type: string
        enum: ["en", "fr", "es"]
  UpdateUserAccount:
    title: Update user's account
    description: >-
      The user's account information of the authenticated user to be updated.
      Emails and password can be omitted if they don't have to be updated,
      because we can now if they have been sent or not although go-swagger
      doesn't currently support `PATCH` updates (see
      [comment](https://github.com/cycloidio/youdeploy-http-api/pull/71#issuecomment-321894076)),
      we do for this one with this 2 properties because they are good for the
      user, specially for the `password_update` one. In order to detect if they
      have been sent or not, we check if the length of array of emails is 0 (if
      it's sent, then the length MUST be greater than 0 as specified with
      minItems) and in case of the `password_update` field if it's `nil` or not.
      If the 'picture_url' is not send then it's removed from the user as it implies that
      it has deleted it, and also because we do not support partial updates
    required:
      - username
      - given_name
      - family_name
      - locale
      - mfa_enabled
    properties:
      emails:
        type: array
        items:
          $ref: '#/definitions/UpdateUserAccountEmail'
        minItems: 1
      password_update:
        description: The update password requires to confirm the old password.
        required:
          - current
          - new
        properties:
          current:
            type: string
            format: password
            minLength: 8
          new:
            type: string
            format: password
            minLength: 8
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      given_name:
        type: string
        minLength: 2
      family_name:
        type: string
        minLength: 2
      picture_url:
        type: string
        format: uri
      country_code:
        description: Code of a country the user is from
        type: string
        pattern: '^[A-Z]{2}$'
      locale:
        description: User's preferred language
        type: string
        enum: ["en", "fr", "es"]
      mfa_enabled:
        type: boolean
  UserPasswordResetReq:
    title: User password reset request
    description: >-
      Request to send a token for allowing the user to reset its current
      password.
    required:
      - email
    properties:
      email:
        description: the email address must be the primary email of the user.
        type: string
        format: email
  UserPasswordResetUpdate:
    title: User password reset update
    description: >-
      Reset the current user password to the one provided.
      The user must have a valid token for the resetting password action.
    required:
      - password
      - token
    properties:
      password:
        type: string
        format: password
        minLength: 8
      token:
        type: string
        minLength: 1
  UserLogin:
    title: Log in
    description: >-
      Validate the user to access to the application. The user can login with
      the primary email address or with username.
    required:
      - password
    maxProperties: 3
    minProperties: 2
    properties:
      email:
        type: string
        format: email
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      password:
        type: string
        format: password
        minLength: 8
      organization_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  UserOAuth:
    title: User's OAuth information
    description: The User OAuth information, if it's on the platform it'll return the 'token' to login, if not the 'user' to show to the user
    properties:
      user:
        type: object
        $ref: '#/definitions/NewOAuthUser'
      token:
        description: Is the JWT of the platform user
        type: string
  NewOAuthUser:
    title: User's OAuth information
    description: The User OAuth information
    required:
      - email
      - given_name
      - username
      - social_id
    properties:
      given_name:
        type: string
      family_name:
        type: string
      email:
        type: string
        format: email
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      picture_url:
        type: string
        format: uri
      social_id:
        type: string
      invitation_token:
        type: string
        minLength: 5
        description: >-
          The field is used when a user signup from an invitation to an organization.
          Giving the token, the created user will be automatically added to the organization.
      country_code:
        description: Code of a country the user is from
        type: string
        pattern: '^[A-Z]{2}$'
      locale:
        description: User's preferred language
        type: string
        enum: ["en", "fr", "es"]
  UserSession:
    title: User's session
    description: The JWT which allows the user to access to the application.
    required:
      - token
      - permissions
      - owns
    properties:
      token:
        type: string
      permissions:
        type: object
        additionalProperties:
          $ref: '#/definitions/Rule'
      owns:
        type: array
        items:
          type: string
  User:
    title: Basic info of a user
    description: >-
      A summary of a user to be used in places where only the basic information
      are need or are enough.
    type: object
    required:
      - id
      - username
      - given_name
      - family_name
      - email
      - locale
      - created_at
      - mfa_enabled
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      username:
        type: string
        minLength: 3
        maxLength: 30
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      given_name:
        type: string
        minLength: 2
      family_name:
        type: string
        minLength: 2
      email:
        description: User's primary email.
        type: string
        format: email
      picture_url:
        type: string
        format: uri
      country_code:
        description: Code of a country the user is from
        type: string
        pattern: '^[A-Z]{2}$'
      locale:
        description: The local that the user prefer.
        type: string
        pattern: '^[a-z]{2}(?:-[a-z][a-z])?$'
      created_at:
        description: When the user became a member.
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        description: When the user had the role modified.
        type: integer
        format: uint64
        minimum: 0
      last_login_at:
        description: When the user logged in last time.
        type: integer
        format: uint64
        minimum: 0
      mfa_enabled:
        type: boolean
  MemberOrg:
    title: Member of an organization
    description: Member is a user who is associated to an organization.
    type: object
    required:
      - id
      - created_at
      - role
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      given_name:
        type: string
        minLength: 2
      family_name:
        type: string
        minLength: 2
      email:
        description: user email
        type: string
        format: email
      picture_url:
        type: string
        format: uri
      created_at:
        description: When the user became a member.
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        description: When the user had the role modified.
        type: integer
        format: uint64
        minimum: 0
      last_login_at:
        description: When the user logged in last time.
        type: integer
        format: uint64
        minimum: 0
      invited_at:
        description: >-
          When the user had been invited to join as a member.
          When not present, the user is already a member, so she/he has
          verified her/his invitation.
        type: integer
        format: uint64
        minimum: 0
      invited_by:
        $ref: '#/definitions/MemberOrg'
        description: Organization member who invited the current user.
      role:
        $ref: '#/definitions/Role'
      locale:
        description: User's preferred language
        type: string
        enum: ["en", "fr", "es"]
      mfa_enabled:
        type: boolean
      invitation_email:
        description: >-
          The email address to which the invitation was sent. It's used to
          resend the invitation.
        type: string
        format: email
      invitation_resent_at:
        type: integer
        format: uint64
        minimum: 0
      invitation_state:
        type: string
        enum:
          - pending
          - accepted
          - declined
  MemberTeam:
    title: Member of a team
    description: Member is a user who is associated to a team.
    type: object
    required:
      - id
      - username
      - given_name
      - family_name
      - email
      - created_at
      - mfa_enabled
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      username:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      given_name:
        type: string
        minLength: 2
      family_name:
        type: string
        minLength: 2
      email:
        description: user email
        type: string
        format: email
      picture_url:
        type: string
        format: uri
      created_at:
        description: When the user became a member.
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        description: When the user had the role modified.
        type: integer
        format: uint64
        minimum: 0
      last_login_at:
        description: When the user logged in last time.
        type: integer
        format: uint64
        minimum: 0
      invited_by:
        $ref: '#/definitions/MemberOrg'
        description: Team member who invited the current user to the team.
      mfa_enabled:
        type: boolean
  MemberAssignation:
    title: Member assignation
    description: >-
      Member is a user who is associated to an entity of the system. The user is
      newly assigned or reassigned for updating is data.
    required:
      - role_canonical
    properties:
      role_canonical:
        description: The role of the member.
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  NewTeamMemberAssignation:
    title: Assign user
    description: Member is a user assigned to a Team
    required:
      - username
    properties:
      username:
        description: Assign user by username
        type: string
        format: string
  NewMemberInvitation:
    title: Invite user
    description: >-
      Send an invitation to a user to something. Something can be to create an
      account, to join to an organization, to join to a team, etc. API operation
      determines the operation to perform.
    required:
      - email
      - role_canonical
    properties:
      email:
        description: Invite user by email
        type: string
        format: email
      role_canonical:
        description: The role of the member.
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  Pipeline:
    title: Pipeline
    description: |
      The entity which represents a pipeline in the application.
    type: object
    required:
      - id
      - name
      - paused
      - public
      - team_name
      - environment
      - project
      - use_case
      - jobs
      - created_at
      - updated_at
    properties:
      id:
        type: integer
        format: uint64
      name:
        type: string
      paused:
        type: boolean
      public:
        type: boolean
      archived:
        type: boolean
      groups:
        type: array
        items:
          $ref: '#/definitions/GroupConfig'
      team_name:
        type: string
      environment:
        $ref: '#/definitions/Environment'
      project:
        $ref: '#/definitions/Project'
      use_case:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      created_at:
        type: integer
        format: uint64
        minimum: 0
      jobs:
        type: array
        items:
          $ref: '#/definitions/Job'
      status:
        type: string
      started:
        type: boolean
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  NewPipeline:
    title: Create Pipeline
    description: The entity which represents a new pipeline to create in the
      application.
    type: object
    required:
      - pipeline_name
      - environment
    properties:
      pipeline_name:
        type: string
        minLength: 3
        maxLength: 50
        pattern: ^[a-z0-9]+[a-z0-9\-._]+[a-z0-9]+$
      passed_config:
        type: string
      yaml_vars:
        type: string
      check_credentials:
        description: Validate credentials manager variables in the pipeline config.
        type: boolean
      environment:
        $ref: '#/definitions/NewEnvironment'
      use_case:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  UpdatePipeline:
    title: Update Pipeline
    description:
      The entity which represents a new pipeline config to update in the
      application.
    type: object
    required:
      - passed_config
    properties:
      passed_config:
        type: string
      yaml_vars:
        type: string
      check_credentials:
        type: boolean
  GroupConfig:
    title: GroupConfig
    description: The entity which represents pipeline group config
    type: object
    required:
      - name
    properties:
      name:
        type: string
      jobs:
        type: array
        items:
          type: string
      resources:
        type: array
        items:
          type: string
  PipelineVariables:
    title: Pipeline variables
    description: The entity which contains pipeline's variables.
    type: object
    required:
      - yaml_vars
      - has_saved_yaml_vars
    properties:
      yaml_vars:
        type: string
      has_saved_yaml_vars:
        description: |
          The has_saved_yaml_vars specifies whether the returned vars are from
          the saved ones or the sample ones. If the has_saved_yaml_vars is true,
          it means that the saved have been returned.
        type: boolean
  PipelineDiffRecord:
    title: PipelineDiffRecord
    description: Represents a diff record of a pipeline diff
    type: object
    required:
      - line
      - delta_type
    properties:
      line:
        type: string
        description: Represents a text line in a pipeline configuration
      delta_type:
        type: string
        description: Represents the type of delta (added, removed, changed, equals) for the text line
  PipelineDiff:
    title: PipelineDiff
    description: Represents a diff element of a PipelineDiffs.
    type: object
    required:
      - name
      - status
      - diff
    properties:
      name:
        type: string
        description: Represents the name of the element in a pipeline. For example the job name for jobs section
      status:
        description: Represents the status of the element (added, removed, changed)
        type: string
        enum:
          - added
          - removed
          - changed
      diff:
        description: Represents the diff of all configuration line for an element
        type: array
        items:
          $ref: '#/definitions/PipelineDiffRecord'
  PipelineDiffs:
    title: PipelineDiffs
    description: Represents the diffs between two pipelines
    type: object
    properties:
      jobs:
        type: array
        items:
          $ref: '#/definitions/PipelineDiff'
      groups:
        type: array
        items:
          $ref: '#/definitions/PipelineDiff'
      resources:
        type: array
        items:
          $ref: '#/definitions/PipelineDiff'
      resource_types:
        type: array
        items:
          $ref: '#/definitions/PipelineDiff'
  PipelineStatus:
    title: PipelineStatus
    description: >-
      Pipeline status returned upon pipelines comparison
      between the one locally stored in the database and its
      counter part on git.
    type: object
    required:
      - synced
    properties:
      synced:
        type: string
        description: >-
          The state can vary depending on how far the comparison process went.
          There are 4 possible states which are:
            - unknown: one of the pipeline (database/git) couldn't be retrieved
            - sycned: both database & git pipelines are identical
            - out_of_sync: database & git pipelines have some differences
            - errored: both pipelines got retrieved but the comparison triggered an error
        enum:
          - unknown
          - synced
          - out_of_sync
          - errored
      error:
        type: string
      diffs:
        type: object
        $ref: '#/definitions/PipelineDiffs'
  TaskConfig:
    title: TaskConfig
    description: The configuration of a concourse task.
    type: object
    properties:
      platform:
        type: string
      tags:
        type: array
        items:
          type: string
      image:
        type: string
      params:
        type: object
        additionalProperties:
          type: string
      run:
        type: object
        $ref: '#/definitions/TaskRunConfig'
      inputs:
        type: array
        items:
          $ref: '#/definitions/TaskInputConfig'
  TaskRunConfig:
    title: TaskRunConfig
    description: The configuration of a concourse task-run.
    type: object
    properties:
      path:
        type: string
        minLength: 3
      args:
        type: array
        items:
          type: string
  TaskInputConfig:
    title: TaskInputConfig
    description: The configuration of inputs for concourse tasks.
    type: object
    required:
      - name
    properties:
      name:
        type: string
      path:
        type: string
  Plan:
    title: Plan
    description: The plan is what represent a concourse build.
    type: object
    required:
      - id
    properties:
      id:
        type: string
      attempts:
        type: array
        items:
          type: integer
          format: uint32
      aggregate:
        type: string
      do:
        type: array
        items:
          $ref: '#/definitions/Plan'
      get:
        $ref: '#/definitions/GetPlan'
      put:
        $ref: '#/definitions/PutPlan'
      task:
        $ref: '#/definitions/TaskPlan'
      ensure:
        $ref: '#/definitions/EnsurePlan'
      on_success:
        $ref: '#/definitions/OnSuccessPlan'
      on_failure:
        $ref: '#/definitions/OnFailurePlan'
      try:
        $ref: '#/definitions/TryPlan'
      timeout:
        $ref: '#/definitions/TimeoutPlan'
      retry:
        type: array
        items:
          $ref: '#/definitions/Plan'
  GetPlan:
    title: GetPlan
    description: The plan to get before running another one.
    type: object
    required:
      - type
      - resource
      - source
    properties:
      type:
        type: string
      name:
        type: string
      resource:
        type: string
      source:
        type: object
        additionalProperties:
          type: object
      params:
        type: object
        additionalProperties:
          type: object
      version:
        type: object
        additionalProperties:
          type: string
      version_from:
        type: string
      tags:
        type: array
        items:
          type: string
      versioned_resource_types:
        type: array
        items:
          $ref: '#/definitions/VersionedResourceType'
  PutPlan:
    title: PutPlan
    description: The put plan following a plan.
    type: object
    required:
      - type
      - resource
      - source
    properties:
      type:
        type: string
      name:
        type: string
      resource:
        type: string
      source:
        type: object
        additionalProperties:
          type: object
      params:
        type: object
        additionalProperties:
          type: object
      tags:
        type: array
        items:
          type: string
      versioned_resource_types:
        type: array
        items:
          $ref: '#/definitions/VersionedResourceType'
  TaskPlan:
    title: TaskPlan
    description: The task plan.
    type: object
    required:
      - privileged
    properties:
      name:
        type: string
      privileged:
        type: boolean
      tags:
        type: array
        items:
          type: string
      config_path:
        type: string
      config:
        $ref: '#/definitions/TaskConfig'
      params:
        type: object
        additionalProperties:
          type: object
      input_mapping:
        type: object
        additionalProperties:
          type: string
      output_mapping:
        type: object
        additionalProperties:
          type: string
      image_artifact_name:
        type: string
      versioned_resource_types:
        type: array
        items:
          $ref: '#/definitions/VersionedResourceType'
  EnsurePlan:
    title: EnsurePlan
    description: The plan to ensure to be run.
    type: object
    required:
      - step
      - next
    properties:
      step:
        $ref: '#/definitions/Plan'
      next:
        $ref: '#/definitions/Plan'
  OnSuccessPlan:
    title: OnSuccessPlan
    description: The plan definition when the action has been successful.
    type: object
    required:
      - step
      - next
    properties:
      step:
        $ref: '#/definitions/Plan'
      next:
        $ref: '#/definitions/Plan'
  OnFailurePlan:
    title: OnFailurePlan
    description: The plan definition when the action has failed.
    type: object
    required:
      - step
      - next
    properties:
      step:
        $ref: '#/definitions/Plan'
      next:
        $ref: '#/definitions/Plan'
  TryPlan:
    title: EnsurePlan
    description: The plan to ensure to be run.
    type: object
    required:
      - step
      - next
    properties:
      step:
        $ref: '#/definitions/Plan'
      next:
        $ref: '#/definitions/Plan'
  TimeoutPlan:
    title: EnsurePlan
    description: The plan to ensure to be run.
    type: object
    required:
      - step
      - next
    properties:
      step:
        $ref: '#/definitions/Plan'
      next:
        $ref: '#/definitions/Plan'
  PublicPlan:
    title: PublicPlan
    description: The public plan returned requesting a build plan.
    type: object
    required:
      - schema
      - plan
    properties:
      schema:
        type: string
      plan:
        type: object
  PlanConfig:
    title: PlanConfig
    description: The plan configuration when creating new build.
    type: object
    properties:
      conditions:
        type: array
        items:
          type: string
      raw_name:
        type: string
      do:
        type: array
        items:
          $ref: '#/definitions/PlanConfig'
      aggregate:
        type: array
        items:
          $ref: '#/definitions/PlanConfig'
      get:
        type: string
      passed:
        type: array
        items:
          type: string
      raw_trigger:
        type: boolean
      put:
        type: string
      resource:
        type: string
      task:
        type: string
      privileged:
        type: boolean
      taskConfigPath:
        type: string
      taskConfig:
        $ref: '#/definitions/TaskConfig'
      params:
        type: object
        additionalProperties:
          type: object
  VersionedResourceType:
    title: VersionedResourceType
    description: The versioned resources type.
    type: object
    required:
      - id
      - name
      - type
      - source
      - privileged
      - tags
      - version
    properties:
      id:
        type: integer
        format: uint32
      name:
        type: string
      type:
        type: string
      source:
        type: object
        additionalProperties:
          type: object
      privileged:
        type: boolean
      tags:
        type: object
        additionalProperties:
          type: string
      version:
        type: object
        additionalProperties:
          type: string
  Job:
    title: Job
    description: The entity which represents a job output in the application.
    type: object
    required:
      - id
      - name
    properties:
      id:
        type: integer
        format: uint64
      name:
        type: string
      paused:
        type: boolean
      first_logged_build_id:
        type: integer
        format: uint64
      disable_manual_trigger:
        type: boolean
      has_new_inputs:
        type: boolean
      next_build:
        $ref: '#/definitions/Build'
        x-nullable: true
      finished_build:
        $ref: '#/definitions/Build'
      transition_build:
        $ref: '#/definitions/Build'
      inputs:
        type: array
        items:
          $ref: '#/definitions/JobInput'
      outputs:
        type: array
        items:
          $ref: '#/definitions/JobOutput'
      groups:
        type: array
        items:
          type: string
      team_name:
        type: string
      pipeline_id:
        type: integer
        format: uint64
      pipeline_name:
        type: string
  JobInput:
    title: JobInput
    description: The entity which represents a job input in the application.
    type: object
    required:
      - name
      - resource
      - trigger
    properties:
      name:
        type: string
      resource:
        type: string
      passed:
        type: array
        items:
          type: string
      trigger:
        type: boolean
      version:
        $ref: '#/definitions/VersionConfig'
  JobOutput:
    title: JobOutput
    description: The entity which represents a job output in the application.
    type: object
    required:
      - name
      - resource
    properties:
      name:
        type: string
      resource:
        type: string
  ClearTaskCache:
    title: ClearTaskCache
    description: The entity which represents number of cache cleared for a task.
    type: object
    required:
      - caches_removed
    properties:
      caches_removed:
        type: integer
  VersionConfig:
    title: VersionConfig
    description: The entity which represents a version configuration in the application.
    type: object
    properties:
      every:
        type: boolean
      latest:
        type: boolean
      pinned:
        type: object
        additionalProperties:
          type: string
  Worker:
    title: Worker
    description: The entity which represents a worker in the application.
    type: object
    required:
      - name
      - state
      - version
      - platform
      - ephemeral
      - active_containers
      - active_volumes
      - start_time
    properties:
      name:
        type: string
      state:
        type: string
      version:
        type: string
      platform:
        type: string
      team:
        type: string
      ephemeral:
        type: boolean
      active_containers:
        type: integer
        format: uint64
      active_volumes:
        type: integer
        format: uint64
      start_time:
        type: integer
        format: uint64
      tags:
        type: array
        items:
          type: string
  Resource:
    title: Resource
    description: The entity which represents a resource in the application.
    type: object
    required:
      - name
      - type
    properties:
      name:
        type: string
      type:
        type: string
      icon:
        type: string
      last_checked:
        type: integer
        format: uint64
      pin_comment:
        type: string
      pinned_in_config:
        type: boolean
      pinned_version:
        type: object
        additionalProperties:
          type: string
      pipeline_id:
        type: integer
        format: uint64
      pipeline_name:
        type: string
      team_name:
        type: string
      build:
        $ref: '#/definitions/BuildSummary'
  BuildInputsOutputs:
    title: BuildInputsOutputs
    description: Represent the resources input/output related to a build
    type: object
    required:
      - inputs
      - outputs
    properties:
      inputs:
        type: array
        items:
          $ref: '#/definitions/PublicBuildInput'
      outputs:
        type: array
        items:
          $ref: '#/definitions/PublicBuildOutput'
  PublicBuildOutput:
    title: PublicBuildOutput
    description: Represents the information of a build output
    type: object
    required:
      - name
      - version
    properties:
      name:
        type: string
      version:
        type: object
        additionalProperties:
          type: string
  PublicBuildInput:
    title: PublicBuildInput
    description: Represent the information of a build input
    type: object
    required:
      - name
      - version
      - pipeline_id
      - first_occurrence
    properties:
      name:
        type: string
      version:
        type: object
        additionalProperties:
          type: string
      pipeline_id:
        type: integer
        format: uint64
      first_occurrence:
        type: boolean
  MetadataField:
    title: MetadataField
    description: Represent the metadata of a build input
    type: object
    required:
      - name
      - value
    properties:
      name:
        type: string
      value:
        type: string
  CIVersion:
    title: CIVersion
    description: Represent a version of a resource
    type: object
    additionalProperties:
      type: string
  PinComment:
    title: PinComment
    description: Represents a pin comment of a resource
    type: object
    required:
      - pin_comment
    properties:
      pin_comment:
        type: string
  ResourceVersion:
    title: ResourceVersion
    description: Represent the outputs of a job
    type: object
    required:
      - id
      - version
      - enabled
    properties:
      id:
        type: integer
        format: uint64
      metadata:
        type: array
        items:
          $ref: '#/definitions/MetadataField'
      version:
        type: object
        additionalProperties:
          type: string
      enabled:
        type: boolean
  BuildSummary:
    title: BuildSummary
    description: The information relative to a build summary.
    type: object
    required:
      - id
      - team_name
      - name
      - status
    properties:
      id:
        type: integer
        format: uint64
      team_name:
        type: string
      name:
        type: string
      status:
        type: string
      job_name:
        type: string
      plan:
        type: object
      pipeline_name:
        type: string
      start_time:
        type: integer
        format: uint64
      end_time:
        type: integer
        format: uint64
      pipeline_id:
        type: integer
        format: uint64
  Build:
    title: Build
    description: The information relative to a build.
    type: object
    required:
      - id
      - team_name
      - name
      - status
      - api_url
    properties:
      id:
        type: integer
        format: uint64
      team_name:
        type: string
      name:
        type: string
      status:
        type: string
      job_name:
        type: string
      api_url:
        type: string
      pipeline_name:
        type: string
      pipeline_id:
        type: integer
        format: uint64
      start_time:
        type: integer
        format: uint64
      end_time:
        type: integer
        format: uint64
      reap_time:
        type: integer
        format: uint64
  Preparation:
    title: Preparation
    required:
      - build_id
      - paused_pipeline
      - paused_job
      - max_running_builds
      - inputs
      - inputs_satisfied
      - missing_input_reasons
    properties:
      build_id:
        type: string
      paused_pipeline:
        type: string
      paused_job:
        type: string
      max_running_builds:
        type: string
      inputs:
        type: object
      inputs_satisfied:
        type: object
      missing_input_reasons:
        type: object
  Role:
    title: Role access control
    description: >-
      Role represents the authorization level that an user has to access to a
      specific entity of the system. A role contains a list of rules to
      define the access control. Note not all the entities supports roles access
      control; see the API endpoints to know which entities support them.
    required:
      - id
      - name
      - canonical
      - description
      - rules
      - default
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
        minLength: 3
        maxLength: 100
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      description:
        type: string
      default:
        type: boolean
      rules:
        type: array
        items:
          $ref: '#/definitions/Rule'
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  NewRole:
    title: New role access control
    description: >-
      New role represents the authorization level that a user has access to.
      A role contains a list of rules to define the access control. Note
      not all the entities supports roles access control; see the API endpoints
      to know which entities support them.
    required:
      - name
      - rules
    properties:
      name:
        type: string
        minLength: 3
        maxLength: 100
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      description:
        type: string
      rules:
        type: array
        items:
          $ref: '#/definitions/NewRule'
  Rule:
    title: Rule
    description: >-
      Rules define the specific access to the platform
    required:
      - id
      - effect
      - action
    properties:
      id:
        type: integer
        format: uint32
        minimum: 0
        description: >-
          This is the id of the row from the database, but for blocking organizations
          we generate rules that are not in the database. When this happens the id is allowed to be 0.
      effect:
        type: string
        enum:
          - allow
      action:
        type: string
        description: It can be the normal Policy.Code or contain globs like `*` or `**`
      resources:
        type: array
        description: >-
          It is the list of resources in which this Rule applies to, the format
          of it is the one on the Policy.Code but with the `canonical` of the entities
          like `organization:org-can:team:team-can` for an action of `organization:team:read`
        items:
          type: string
  NewRule:
    title: NewRule
    description: >-
      NewRule represents an existing or new permission or constraint to
      access to an entity of the system. A Rule is aggregated into roles in
      order to be applied.
    required:
      - action
      - effect
    properties:
      action:
        type: string
        description: It can be the normal Policy.Code or contain globs like `*` or `**`
      effect:
        type: string
        enum:
          - allow
      resources:
        type: array
        description: >-
          It is the list of resources in which this Rule applies to, the format
          of it is the one on the Policy.Code but with the `canonical` of the entities
          like `organization:org-can:team:team-can` for an action of `organization:team:read`
        items:
          type: string
  Policy:
    title: Policy
    description: >-
      Policy represents a permission or constraint to access to an entity of the
      system. A policy is aggregated into roles in order to be applied.
    required:
      - id
      - code
      - description
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      code:
        type: string
        minLength: 5
        maxLength: 60
        pattern: '(?:[a-z]+_)*[a-z]+(?::(?:[a-z]+_)*[a-z]+)*$'
      entities:
        type: array
        items:
          type: string
      description:
        type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  CloudProvider:
    title: Cloud Provider
    description: >-
      CloudProvider represents a cloud provider. Those cloud providers are
      used to identify the scope of projects and/or stacks.
    required:
      - canonical
      - name
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        enum:
          - aws
          - google
          - azurerm
          - flexibleengine
          - openstack
          - scaleway
          - vmware
          - ovh
          - alibaba
          - oracle
          - vsphere
          - kubernetes
      abbreviation:
        type: string
        minLength: 2
        maxLength: 60
      name:
        type: string
        minLength: 2
        maxLength: 60
      regions:
        type: array
        items:
          type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  ErrorPayload:
    title: Error Payload
    description: >
      The payload used by the server to response to the client with an Error,
      those errors could be any of the ones listed [here](https://github.com/cycloidio/youdeploy-http-api/blob/develop/errors/code.go#L10), only
      the CODE of the error is the one that is guaranteed to not change between
      the same major version, the MESSAGE could change.
    required:
      - errors
    properties:
      errors:
        type: array
        items:
          $ref: '#/definitions/ErrorDetailsItem'
  ErrorDetailsItem:
    title: Error details item
    description: Represents an item of the list of details of an error.
    required:
      - message
      - code
    properties:
      message:
        type: string
      code:
        type: string
      details:
        type: array
        items:
          type: string
  ServiceCatalog:
    title: Service Catalog
    description: Represents the Service Catalog item
    required:
      - id
      - name
      - canonical
      - author
      - description
      - keywords
      - ref
      - form_enabled
      - quota_enabled
      - trusted
      - directory
      - visibility
      - organization_canonical
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      author:
        type: string
      description:
        type: string
      keywords:
        type: array
        items:
          type: string
      image:
        type: string
        format: uri
      visibility:
        type: string
      service_catalog_source_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      form_enabled:
        description: >-
          Indicates if this stack can be configured with form's or not. Based on the presence or not
          of a valid .forms.yaml file since it's creation or last refresh.
        type: boolean
      quota_enabled:
        description: >-
          Indicates if this stack can be configured with form's and has a Quota configuration.
        type: boolean
      ref:
        type: string
      trusted:
        description: If 'true' the ServiceCatalog is from the main organization and can be trusted.
        type: boolean
      directory:
        description: Directory where the ServiceCatalog configuration is found.
        type: string
      technologies:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalogTechnology'
      dependencies:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalogDependency'
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      import_status:
        description: The import process status.
        type: string
        enum:
          - succeeded
          - failed
          - importing
      readme:
        description: Readme of the stack
        type: string
      team:
        description: Team that maintains the stack
        $ref: '#/definitions/SimpleTeam'
      cloud_providers:
        description: Cloud providers supported by the stack
        type: array
        items:
          $ref: '#/definitions/CloudProvider'
      blueprint:
        description: Determines if given stack is a blueprint
        type: boolean
      organization_canonical:
        description: Organization that the stack belongs to
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  ServiceCatalogConfig:
    title: Service Catalog Configuration
    description: Represents a Service Catalog's Config item
    type: object
    additionalProperties:
      $ref: '#/definitions/SCConfigUseCaseConfig'
  SCConfigUseCaseConfig:
    title: Use Case Configuration
    description: Represents the Service Catalog Configuration for a given Use Case
    required:
      - name
      - description
      - cloud_provider
      - pipeline
    properties:
      name:
        type: string
      description:
        type: string
      cloud_provider:
        type: string
      pipeline:
        $ref: '#/definitions/SCConfigPipelineConfig'
      ansible:
        $ref: '#/definitions/SCConfigTechConfig'
      terraform:
        $ref: '#/definitions/SCConfigTechConfig'
      forms:
        $ref: '#/definitions/FormUseCase'
  SCConfigPipelineConfig:
    title: Pipeline Configuration
    description: Represents the Service Catalog Configuration for a Pipeline of a given Use Case
    required:
      - pipeline
      - variables
    properties:
      pipeline:
        $ref: '#/definitions/SCConfigPathConfig'
      variables:
        $ref: '#/definitions/SCConfigPathDestConfig'
  SCConfigTechConfig:
    title: Tech Configuration
    description: Represents the Service Catalog Configuration for a Technology of a given Use Case
    type: object
    additionalProperties:
      $ref: '#/definitions/SCConfigPathDestConfig'
  SCConfigPathConfig:
    title: Path Configuration
    description: Represents a Configuration which holds Path and Content
    required:
      - path
      - content
    properties:
      path:
        type: string
      content:
        type: string
  SCConfigPathDestConfig:
    title: Path and Destination Configuration
    description: Represents a Configuration which holds Path, Destination and Content
    required:
      - path
      - destination
      - content
    properties:
      path:
        type: string
      destination:
        type: string
      content:
        type: string
  SCConfigFormData:
    title: Form Data
    description: Represents the Data related to Forms that is stored in a SC Configuration for a given Use Case
    type: object
    additionalProperties:
      type: object
      additionalProperties:
        type: array
        items:
          $ref: '#/definitions/FormEntity'
  NewServiceCatalog:
    title: NewServiceCatalog
    description: Represents the Service Catalog item
    required:
      - name
      - author
      - description
      - keywords
      - service_catalog_source_canonical
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      author:
        type: string
      description:
        type: string
      keywords:
        type: array
        items:
          type: string
      image:
        type: string
        format: uri
      visibility:
        type: string
      service_catalog_source_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      technologies:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalogTechnology'
      dependencies:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalogDependency'
      team_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        description: |
          Team responsible for the maintenance of the underlying service catalogs
  NewServiceCatalogFromTemplate:
    title: NewServiceCatalogFromTemplate
    description: Represents the Service Catalog item
    required:
      - name
      - canonical
      - service_catalog_source_canonical
      - use_case
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      author:
        type: string
      service_catalog_source_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      use_case:
        type: string
      visibility:
        type: string
      team_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        description: |
          Team responsible for the maintenance of the underlying service catalogs
  UpdateServiceCatalog:
    title: UpdateServiceCatalog
    description: Represents the Service Catalog item
    required:
      - name
      - author
      - description
      - keywords
      - service_catalog_source_canonical
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      author:
        type: string
      description:
        type: string
      keywords:
        type: array
        items:
          type: string
      image:
        type: string
        format: uri
      visibility:
        type: string
      service_catalog_source_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      technologies:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalogTechnology'
      dependencies:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalogDependency'
      team_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        description: |
          Team responsible for the maintenance of the underlying service catalogs
  ServiceCatalogTechnology:
    title: ServiceCatalogTechnology
    description: ServiceCatalogTechnology is a Technology of the Service Catalog
    properties:
      technology:
        type: string
      version:
        type: string
  ServiceCatalogDependency:
    title: ServiceCatalogDependency
    description: Service Catalog Dependency identifies ServiceCatalog being dependency of other
    properties:
      ref:
        type: string
      required:
        type: boolean
  ServiceCatalogDependenciesValidationResult:
    title: ServiceCatalogValidationResult
    description: The result of the Service Catalog dependencies validation. If errors and warnings are empty then it means that the dependencies are respected.
    required:
      - errors
      - warnings
    properties:
      errors:
        type: array
        items:
          type: string
      warnings:
        type: array
        items:
          type: string
  SCConfig:
    title: SC Config
    description: >-
      This entity is being used for automatic creation of SC config
    type: object
    required:
      - configs
    properties:
      configs:
        type: array
        description: Config files that will be created
        items:
          $ref: '#/definitions/ConfigFile'
  ConfigFile:
    title: SC config file
    description: >-
      This object contains SC config file name and its content
    type: object
    required:
      - path
      - content
    properties:
      path:
        type: string
      content:
        type: string
        format: byte
  ServiceCatalogSource:
    title: ServiceCatalogSource
    required:
      - id
      - name
      - canonical
      - url
      - owner
      - stack_count
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      url:
        type: string
        pattern: '^((/|~)[^/]*)+.(\.git)|(([\w\]+@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(/)?'
      branch:
        type: string
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this service catalog source. When a user is the owner of a
          service catalog source they has all the permissions on it.
          In the event where the user has been deleted this field might be empty.
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      refreshed_at:
        description: The last time the Service Catalog Source was (successfully) refreshed.
        type: integer
        format: uint64
        minimum: 0
      stack_count:
        type: integer
        format: uint32
        minimum: 0
      changes:
        description: >-
          Represents map of service catalogs changes during the update of a service
          catalog source. Used only for update action on a service catalog source.
        $ref: '#/definitions/ServiceCatalogChanges'
      service_catalogs:
        description: >-
          Represents list of service catalogs in the service catalog source. Not used during
          update action on a service catalog source.
        type: array
        items:
          $ref: '#/definitions/ServiceCatalog'
  NewServiceCatalogSource:
    title: NewServiceCatalogSource
    required:
      - name
      - url
      - branch
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      url:
        type: string
        pattern: '^((/|~)[^/]*)+.(\.git)|(([\w\]+@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(/)?'
      branch:
        type: string
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      owner:
        type: string
        description: |
          User canonical that owns this service catalog source. If omitted then the person
          creating this service catalog source will be assigned as owner. When a user is the
          owner of a service catalog source they has all the permissions on it.
      visibility:
        type: string
        description: |
          The visibility setting allows to specify which visibility will be applied to stacks in this catalog repository.
          This option is only applied during initial catalog repository creation, not for subsequent updates.
      team_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        description: |
          Team responsible for the maintenance of the underlying service catalogs
  UpdateServiceCatalogSource:
    title: UpdateServiceCatalogSource
    required:
      - name
      - url
    properties:
      name:
        type: string
      url:
        type: string
        pattern: '^((/|~)[^/]*)+.(\.git)|(([\w\]+@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(/)?'
      branch:
        type: string
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      owner:
        type: string
        description: |
          User canonical that owns this service catalog source. If omitted then the person
          creating this service catalog source will be assigned as owner. When a user is the
          owner of a service catalog source they has all the permissions on it.
  ServiceCatalogChanges:
    title: ServiceCatalogChanges
    description: >-
      Represents list of service catalogs changes during the refresh of a service
      catalog source.
    required:
      - created
      - updated
      - deleted
    properties:
      created:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalog'
      updated:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalog'
      deleted:
        type: array
        items:
          $ref: '#/definitions/ServiceCatalog'
  Credential:
    title: Credential
    description: Represents the Credential
    required:
      - id
      - canonical
      - name
      - type
      - raw
      - path
      - keys
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      type:
        type: string
        enum:
          - ssh
          - aws
          - custom
          - azure
          - azure_storage
          - gcp
          - basic_auth
          - elasticsearch
          - swift
          - vmware
      path:
        type: string
      raw:
        $ref: '#/definitions/CredentialRaw'
      description:
        type: string
      keys:
        description: List of all the keys available for the Credential
        type: array
        items:
          type: string
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this credential. When a user is the owner of a
          credential he has all the permissions on it.
          In the event where the user has been deleted that field might be empty.
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      in_use:
        $ref: '#/definitions/CredentialInUse'
  NewCredential:
    title: Credential
    description: Represents the Credential
    required:
      - name
      - type
      - raw
      - path
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      type:
        type: string
        enum:
          - ssh
          - aws
          - custom
          - azure
          - azure_storage
          - gcp
          - basic_auth
          - elasticsearch
          - swift
          - vmware
      path:
        type: string
        pattern: '[a-zA-z0-9_\-./]'
      raw:
        $ref: '#/definitions/CredentialRaw'
      description:
        type: string
      owner:
        type: string
        description: |
          User canonical that owns this credential. If omitted then the person creating this
          credential will be assigned as owner. When a user is the owner of a credential he has
          all the permissions on it.
  UpdateCredential:
    title: Credential
    description: Represents the Credential
    required:
      - name
      - canonical
      - type
      - raw
      - path
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      type:
        type: string
        enum:
          - ssh
          - aws
          - custom
          - azure
          - azure_storage
          - gcp
          - basic_auth
          - elasticsearch
          - vmware
      path:
        type: string
        pattern: '[a-zA-z0-9_\-./]'
      raw:
        $ref: '#/definitions/CredentialRaw'
      description:
        type: string
      owner:
        type: string
        description: |
          User canonical that owns this credential. When a user is the owner of a credential he has
          all the permissions on it.
  CredentialSimple:
    title: Credential Simple
    description: Represents the Credential without the raw and owner
    required:
      - id
      - name
      - canonical
      - type
      - path
      - keys
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      type:
        type: string
        enum:
          - ssh
          - aws
          - custom
          - azure
          - azure_storage
          - gcp
          - basic_auth
          - elasticsearch
          - swift
          - vmware
      path:
        type: string
      description:
        type: string
      keys:
        description: List of all the keys available for the Credential
        type: array
        items:
          type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      in_use:
        $ref: '#/definitions/CredentialInUse'
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this credential. When a user is the owner of a
          credential he has all the permissions on it.
          In the event where the user has been deleted that field might be empty.
  CredentialRaw:
    title: Credential Raw
    description: All the possible fields inside it
    properties:
      raw:
        type: object
      ssh_key:
        type: string
      access_key:
        type: string
      secret_key:
        type: string
      environment:
        type: string
        enum: ["public", "usgovernment", "china", "german"]
      account_name:
        type: string
      json_key:
        type: string
      username:
        type: string
      password:
        type: string
      client_id:
        type: string
      client_secret:
        type: string
      subscription_id:
        type: string
      tenant_id:
        type: string
      ca_cert:
        type: string
      domain_id:
        type: string
      auth_url:
        type: string
  CredentialInUse:
    title: Credential in use
    description: |
      InUse represents the resources that are using provided credential.
    type: object
    properties:
      service_catalog_sources:
        type: array
        items:
          $ref: '#/definitions/InUseServiceCatalogSource'
      config_repositories:
        type: array
        items:
          $ref: '#/definitions/InUseConfigRepository'
      external_backends:
        type: array
        items:
          $ref: '#/definitions/InUseExternalBackend'
  InUseServiceCatalogSource:
    title: InUseServiceCatalogSource
    description: Represents a Service catalog source that's using credential
    required:
      - name
      - canonical
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  InUseConfigRepository:
    title: InUseConfigRepository
    description: Represents a Config repository that's using credential
    required:
      - name
      - canonical
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  InUseProject:
    title: InUseProject
    description: Represents a project that's using credential
    required:
      - name
      - canonical
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
  InUseEnvironment:
    title: InUseEnvironment
    description: Represents an environment that's using credential
    required:
      - canonical
    properties:
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
  InUseExternalBackend:
    title: InUseExternalBackend
    description: Represents a external backend that's using credential
    required:
      - engine
      - purpose
    properties:
      purpose:
        type: string
      engine:
        type: string
      project:
        $ref: '#/definitions/InUseProject'
      environment:
        $ref: '#/definitions/InUseEnvironment'
  ConfigRepository:
    title: ConfigRepository
    required:
      - id
      - name
      - canonical
      - url
      - default
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      url:
        type: string
        pattern: '^((/|~)[^/]*)+.(\.git)|(([\w\]+@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(/)?'
      branch:
        type: string
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      default:
        type: boolean
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  NewConfigRepository:
    title: NewConfigRepository
    required:
      - name
      - url
      - credential_canonical
      - default
      - branch
    properties:
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      url:
        type: string
        pattern: '^((/|~)[^/]*)+.(\.git)|(([\w\]+@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(/)?'
      branch:
        type: string
      default:
        type: boolean
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  UpdateConfigRepository:
    title: UpdateConfigRepository
    required:
      - name
      - url
      - credential_canonical
      - default
      - branch
    properties:
      name:
        type: string
      url:
        type: string
        pattern: '^((/|~)[^/]*)+.(\.git)|(([\w\]+@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(/)?'
      branch:
        type: string
      default:
        type: boolean
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  AWSInfrastructureResourcesAggregation:
    title: AWS Infrastructure Resources Aggregation
    minProperties: 1
    maxProperties: 12
    properties:
      instances:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      vpcs:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      images:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      security_groups:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      subnets:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      volumes:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      snapshots:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      cache_clusters:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      load_balancers_v1:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      load_balancers_v2:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      db_instances:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
      buckets:
        $ref: '#/definitions/InfrastructureResourcesAggregationItem'
  InfrastructureResourcesAggregationItem:
    title: Infrastructure Resource Aggregation Item
    description: >-
      Contains aggregated data of a single type of an infrastructure resource.
    required:
      - total_amount
    properties:
      total_amount:
        description: The number of items of the specific type of resource.
        type: integer
        format: uint32
  AWSInfrastructureResourceInstance:
    title: AWS Infrastructure Instance Resource
    description: >-
      This object contains the items described in the instance data type
      described in https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html
      Tags property is set, for guaranteeing that the respond will always have
      the property of the type array, not allowing null in case that the resource
      doesn't have any, hence an empty array is used in such case.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceVPC:
    title: AWS Infrastructure VPC Resource
    description: >-
      This object contains the items described in the VPC data type
      described in https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Vpc.html
      Tags property is set, for guaranteeing that the respond will always have
      the property of the type array, not allowing null in case that the resource
      doesn't have any, hence an empty array is used in such case.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceSubnet:
    title: AWS Infrastructure subnet Resource
    description: >-
      This object contains the items described in the subnet data type
      described in https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Subnet.html
      Tags property is set, for guaranteeing that the respond will always have
      the property of the type array, not allowing null in case that the resource
      doesn't have any, hence an empty array is used in such case.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceSecurityGroup:
    title: AWS Infrastructure security group Resource
    description: >-
      This object contains the items described in the security group data type
      described in https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SecurityGroup.html
      Tags property is set, for guaranteeing that the respond will always have
      the property of the type array, not allowing null in case that the resource
      doesn't have any, hence an empty array is used in such case.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceImage:
    title: AWS Infrastructure image Resource
    description: >-
      This object contains the items described in the image data type described
      in https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Image.html
      Tags property is set, for guaranteeing that the respond will always have
      the property of the type array, not allowing null in case that the resource
      doesn't have any, hence an empty array is used in such case.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceVolume:
    title: AWS Infrastructure volume Resource
    description: >-
      This object contains the items described in the volume data type described
      in https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Volume.html
      Tags property is set, for guaranteeing that the respond will always have
      the property of the type array, not allowing null in case that the resource
      doesn't have any, hence an empty array is used in such case.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceSnapshot:
    title: AWS Infrastructure snapshot Resource
    description: >-
      This object contains the items described in the snapshot data type
      described in https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Snapshot.html
      Tags property is set, for guaranteeing that the respond will always have
      the property of the type array, not allowing null in case that the resource
      doesn't have any, hence an empty array is used in such case.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceElasticacheCluster:
    title: AWS Infrastructure Elasticache cluster Resource
    description: >-
      This object contains the items described in the ElastiCache cluster data
      type described in
      https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CacheCluster.html
      but it also contains its associated tags which are documented in the
      properties of this object definition.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceLoadBalancerV1:
    title: AWS Infrastructure load balancer (ELB) Resource
    description: >-
      This object contains the items described in the load balancer (ELB)
      data type described in
      https://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_LoadBalancerDescription.html
      but it also contains its associated tags which are documented in the
      properties of this object definition.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceLoadBalancerV2:
    title: AWS Infrastructure load balancer (ELB v2 or a.k.a ALB) Resource
    description: >-
      This object contains the items described in the load balancer (ELB v2 or
      a.k.a ALB) data type described in
      https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_LoadBalancer.html
      but it also contains its associated tags which are documented in the
      properties of this object definition.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceDBInstance:
    title: AWS Infrastructure RDS DB instance Resource
    description: >-
      This object contains the items described in the RDS DB instance data type
      described in
      https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBInstance.html
      but it also contains its associated tags which are documented in the
      properties of this object definition.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  AWSInfrastructureResourceBucket:
    title: AWS Infrastructure S3 bucket Resource
    description: >-
      This object contains the items described in the S3 bucket data type
      described in
      but it also contains its associated tags which are documented in the
      properties of this object definition.
      This object will contain a property named 'Tags' which is of the type
      defined by the schema definition '#/definitions/AWSTags'
  CostGroupDefinitions:
    title: CostGroupDefinitions
    description: >-
      This object contains the items describe in
      https://docs.aws.amazon.com/sdk-for-go/api/service/costexplorer/#GroupDefinition
      It also grouping the costs based on different elements: az, services, tags, etc
    required:
      - group
      - key
    properties:
      group:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[a-zA-Z]+$'
      key:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[a-zA-Z]+$'
  CostResultByTime:
    title: CostResultByTime
    description: >-
      This object contains the items described in
      https://docs.aws.amazon.com/sdk-for-go/api/service/costexplorer/#ResultByTime
      It is basically containing information about the cost per group(s) and per
      granularity (daily/monthly) over the period of time selected.
      The total and unit fields have bee modified to fit our requirements, while the
      groups hold the information about each iteration over the time range.
    required:
      - estimated
      - groups
      - period
      - total
      - unit
    properties:
      estimated:
        type: boolean
      groups:
        type: array
        items:
          $ref: '#/definitions/CostGroup'
      period:
        $ref: '#/definitions/CostTimePeriod'
      total:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[0-9]+.[0-9]+$'
      unit:
        type: string
        minLength: 2
        maxLength: 3
        pattern: '^[a-zA-Z]+$'
  CostTimePeriod:
    title: CostTimePeriod
    description: >-
      This object contains the items described in
      https://docs.aws.amazon.com/sdk-for-go/api/service/costexplorer/#DateInterval
      It defines the beginning and the end of the time frame for which, the API should
      gather costs.
    required:
      - begin
      - end
    properties:
      begin:
        type: string
        minLength: 10
        maxLength: 10
        pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
      end:
        type: string
        minLength: 10
        maxLength: 10
        pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  CostGroup:
    title: CostGroup
    description: >-
      This object contains the items described in
      https://docs.aws.amazon.com/sdk-for-go/api/service/costexplorer/#Group
      The groups hold the information about the price per key(s) for each iteration over
      the time range requested.
    required:
      - keys
      - amount
      - unit
    properties:
      keys:
        type: array
        items:
          type: string
      amount:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[0-9]+.[0-9]+$'
      unit:
        type: string
        minLength: 3
        maxLength: 3
        pattern: '^[A-Z]+$'
  Environment:
    title: Environment
    description: >-
      Represent an environment with may be related to a Project and Pipeline
    required:
      - id
      - canonical
      - created_at
      - updated_at
      - color
      - icon
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[\da-zA-Z]+(?:[\da-zA-Z\-._]+[\da-zA-Z]|[\da-zA-Z])$'
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      cloud_provider:
        $ref: '#/definitions/CloudProvider'
        description: |
          The cloud provider object that this environment is using.
          In the event where the cloud provider is not yet defined/supported
          that field might be empty.
      use_case:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      color:
        type: string
        maxLength: 64
      icon:
        type: string
        maxLength: 64
  NewEnvironment:
    title: NewEnvironment
    description: >-
      Represent an entity necessary for environment creation
    required:
      - canonical
    properties:
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[\da-zA-Z]+(?:[\da-zA-Z\-._]+[\da-zA-Z]|[\da-zA-Z])$'
      use_case:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      cloud_provider_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      inputs:
        type: array
        description: |
          The variables set within a form with the corresponding environment
          canonical and use case
        items:
          $ref: '#/definitions/FormInput'
      color:
        type: string
        maxLength: 64
      icon:
        type: string
        maxLength: 64
  UpdateEnvironment:
    title: Update Environment
    description: >-
      Represent an entity necessary for environment update
    properties:
      use_case:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      cloud_provider_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      inputs:
        type: array
        description: |
          The variables set within a form with the corresponding environment
          canonical and use case
        items:
          $ref: '#/definitions/FormInput'
      color:
        type: string
        maxLength: 64
      icon:
        type: string
        maxLength: 64
  LogSource:
    title: A log source
    description: >-
      The data associated to a log's source. Each log source is the context of
      a list of entries which are registered through the time.
    required:
      - id
    properties:
      id:
        type: string
        minLength: 1
  LogSourceEntry:
    title: Log entry
    description: A log's entry which pertains to a specific log's source.
    required:
      - timestamp
      - host
      - message
    properties:
      timestamp:
        type: string
        description: >-
          The timestamp extracted from the original log entry in order to be
          homogeneous to all the different supported underlying log systems.
        format: uint64
      host:
        type: string
        description: The host registered with the log's entry.
        minLength: 1
      message:
        type: string
        description: The original (i.e. raw) log's entry.
        minLength: 1
  ExternalBackend:
    title: External backend
    description: >-
      An external backend contains the configuration needed in order to be
      plugged into the Cycloid system.
      A backend is a general purpose concept, but Cycloid specifies which ones
      are supported and the list of those which are supported for every
      concrete feature.
    required:
      - configuration
      - purpose
      - default
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      purpose:
        type: string
      default:
        description: Will mark this EB as default for the specific purpose
        type: boolean
      jwt:
        description: >-
          JWT is a credential identifying this EB for a public interaction
          right now it's only filled when the Purpose == RemoteTFState
          as we'll use it for the Inventory.
        type: string
      project_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      environment_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$'
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      configuration:
        $ref: '#/definitions/ExternalBackendConfiguration'
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  NewExternalBackend:
    title: New External backend
    description: >-
      An external backend contains the configuration needed in order to be
      plugged into the Cycloid system.
      A backend is a general purpose concept, but Cycloid specifies which ones
      are supported and the list of those which are supported for every
      concrete feature.
    required:
      - purpose
      - configuration
    properties:
      purpose:
        type: string
        enum: ["events", "logs", "remote_tfstate", "cost_explorer"]
      default:
        description: Will mark this EB as default for the specific purpose
        type: boolean
      credential_canonical:
        type: string
        description: |
          The type of the credential must be one of: ["aws", "azure_storage", "elasticsearch", "gcp", "swift", "vmware"]
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      project_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      environment_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$'
      configuration:
        $ref: '#/definitions/ExternalBackendConfiguration'
  UpdateExternalBackend:
    title: Update External backend
    description: >-
      An external backend contains the configuration needed in order to be
      plugged into the Cycloid system.
      A backend is a general purpose concept, but Cycloid specifies which ones
      are supported and the list of those which are supported for every
      concrete feature.
    required:
      - purpose
      - configuration
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      purpose:
        type: string
        enum: ["events", "logs", "remote_tfstate", "cost_explorer"]
      default:
        description: Will mark this EB as default for the specific purpose
        type: boolean
      credential_canonical:
        type: string
        description: |
          The type of the credential must be one of: ["aws", "azure_storage", "elasticsearch", "gcp", "swift", "vmware"]
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      project_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      environment_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$'
      configuration:
        $ref: '#/definitions/ExternalBackendConfiguration'
  ExternalBackendConfiguration:
    type: object
    discriminator: engine
    properties:
      engine:
        type: string
    required:
      - engine
  AWSCloudWatchLogs:
    description: |
      Representation of AWS cloud watch logs for external backend.
      Must be matched with a credential of the "aws" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          region:
            type: string
            description: |
              The AWS region where the resource exists
        required:
          - region
  AWSRemoteTFState:
    description: |
      Deprecated. Please use AWSStorage.
      Representation of AWS remote tf state for external backend.
      Must be matched with a credential of the "aws" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          region:
            type: string
            description: |
              The AWS region where the resource exists
          bucket:
            type: string
            description: |
              The AWS bucket containing objects
          key:
            type: string
            description: |
              The S3 Key uniquely identifies an object in a bucket, will
              be required if the EB is not the default one.
          endpoint:
            type: string
            description: |
              A custom endpoint for the S3 API (default: s3.amazonaws.com)
          s3_force_path_style:
            type: boolean
            description: |
              Always use path-style S3 URLs (https://<HOST>/<BUCKET> instead of https://<BUCKET>.<HOST>)
          skip_verify_ssl:
            type: boolean
            description: |
              Set this to `true` to not verify SSL certificates
        required:
          - region
          - bucket
  AWSStorage:
    description: |
      Representation of AWS storage for external backend.
      Must be matched with a credential of the "aws" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          region:
            type: string
            description: |
              The AWS region where the resource exists
          bucket:
            type: string
            description: |
              The AWS bucket containing objects
          key:
            type: string
            description: |
              The S3 Key uniquely identifies an object in a bucket
          endpoint:
            type: string
            description: |
              A custom endpoint for the S3 API (default: s3.amazonaws.com)
          s3_force_path_style:
            type: boolean
            description: |
              Always use path-style S3 URLs (https://<HOST>/<BUCKET> instead of https://<BUCKET>.<HOST>)
          skip_verify_ssl:
            type: boolean
            description: |
              Set this to `true` to not verify SSL certificates
        required:
          - region
          - bucket
  AzureRemoteTFState:
    description: |
      Deprecated. Please use AzureStorage.
      Representation of azure remote tf state for external backend.
      Must be matched with a credential of the "azure_storage" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          container:
            type: string
            description: |
              The Azure container where the resource exists
          blob:
            type: string
            description: |
              The Azure blob contained in the container, will be
              required if the EB is not default
          endpoint:
            type: string
            description: |
              A custom endpoint for the Azure API
              (default: "https://{account_name}.blob.core.windows.net/", where
              the "account_name" is the one from the credential)
        required:
          - container
  AzureStorage:
    description: |
      Representation of azure remote tf state for external backend.
      Must be matched with a credential of the "azure_storage" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          container:
            type: string
            description: |
              The Azure container where the resource exists
          blob:
            type: string
            description: |
              The Azure blob contained in the container, will be
              required if the EB is not default
          endpoint:
            type: string
            description: |
              A custom endpoint for the Azure API
              (default: "https://{account_name}.blob.core.windows.net/", where
              the "account_name" is the one from the credential)
        required:
          - container
  GCPRemoteTFState:
    description: |
      Deprecated. Please use GCPStorage.
      Representation of GCP remote tf state for external backend.
      Must be matched with a credential of the "gcp" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          bucket:
            type: string
            description: |
              The GCP bucket containing objects
          object:
            type: string
            description: |
              The GCP object uniquely identifying an object in a bucket
        required:
          - bucket
  GCPStorage:
    description: |
      Representation of GCP remote tf state for external backend.
      Must be matched with a credential of the "gcp" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          bucket:
            type: string
            description: |
              The GCP bucket containing objects
          object:
            type: string
            description: |
              The GCP object uniquely identifying an object in a bucket,
              will be required if the EB is not default
        required:
          - bucket
  SwiftRemoteTFState:
    description: |
      Deprecated. Please use SwiftStorage.
      Representation of Swift remote tf state for external backend.
      Must be matched with a credential of the "swift" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          container:
            type: string
            description: |
              The Swift container containing objects
          object:
            type: string
            description: |
              The swift object uniquely identifying an object in a container
          skip_verify_ssl:
            type: boolean
            description: |
              Set this to `true` to not verify SSL certificates
          region:
            type: string
            description: |
              The Swift region where the resource exists
        required:
          - container
          - region
  SwiftStorage:
    description: |
      Representation of Swift remote tf state for external backend.
      Must be matched with a credential of the "swift" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          container:
            type: string
            description: |
              The Swift container containing objects
          object:
            type: string
            description: |
              The swift object uniquely identifying an object in a container,
              will be required if the EB is not default
          skip_verify_ssl:
            type: boolean
            description: |
              Set this to `true` to not verify SSL certificates
          region:
            type: string
            description: |
              The Swift region where the resource exists
        required:
          - container
          - region
  HTTPStorage:
    description: |
      Representation of HTTP storage for external backend.
      Must be matched with a credential of the "basic_auth" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          url:
            type: string
            description: |
              The URL endpoint to use
        required:
          - url
  GitLabHTTPStorage:
    description: |
      Representation of GitLab HTTP storage for external backend.
      Must be matched with a credential of the "basic_auth" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          url:
            type: string
            description: |
              The URL endpoint to use
        required:
          - url
  ElasticsearchLogs:
    description: |
      Representation of Elasticsearch logs for external backend.
      Must be matched with a credential of the "elasticsearch" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        required:
          - urls
          - version
          - sources
        properties:
          urls:
            type: array
            description: |
              List of the URLs
            items:
              type: string
          version:
            type: string
            description: |
              Only 7 is supported
          sources:
            type: object
            description: |
              It's an object where the key is the 'environment' and the value
              another object where the key is the 'source-name' and value a Source.
            additionalProperties:
              type: object
              additionalProperties:
                type: object
                properties:
                  index:
                    type: string
                    description: |
                      Index to use
                  urls:
                    type: array
                    description: |
                      List of URLs to override the main URL defined
                    items:
                      type: string
                  prefilters:
                    type: object
                    description: |
                      JSON representing the prefilters to apply to the index to get
                      the specific values.
                  mapping:
                    type: object
                    description: |
                      Object with the mapping to know which attributes are the ones
                      we have to map to the ones we want
                    required:
                      - host
                      - timestamp
                      - message
                    properties:
                      host:
                        type: string
                        description: |
                          The Host of the log
                      timestamp:
                        type: string
                        description: |
                          The Timestamp of the log
                      message:
                        type: string
                        description: |
                          The Message the user wants to show
  GCPCostStorage:
    description: |
      Representation of BigQuery external backend.
      Must be matched with a credential of the "gcp" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          project_id:
            type: string
            description: |
              The project that contains the BigQuery dataset.
          dataset:
            type: string
            description: |
              The GCP BigQuery dataset containing tables
          table:
            type: string
            description: |
              The GCP BigQuery table containing data
  VMwareVsphere:
    description: |
      Representation of VMwareVsphere external backend.
      Must be matched with a credential of the "vmware" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          server:
            type: string
            description: |
              FQDN or IP address of the vCenter server.
          allow_unverified_ssl:
            type: boolean
            description: |
              Whether verification of SSL certificate should be disabled.
  AzureCostExport:
    description: |
      Representation of AzureCostExport external backend.
      Must be matched with a credential of the "azure" type.
    allOf:
      - $ref: '#/definitions/ExternalBackendConfiguration'
      - type: object
        properties:
          name:
            type: string
            description: Name of the export
          scope:
            type: string
            description: Scope of the export
          blob_service_url:
            type: string
            description: Endpoint of blob storage service containing the export files.
  Event:
    title: An event
    description: >-
      A event which has registered an activity in the Cycloid platform.
    required:
      - id
      - timestamp
      - type
      - title
      - message
      - severity
      - tags
    properties:
      id:
        type: integer
        description: The unique ID of the event from the database.
        format: uint32
      timestamp:
        type: integer
        description: The timestamp when the event was created in milliseconds.
        format: uint64
      type:
        type: string
        description: The type of the event
        enum:
          - Cycloid
          - AWS
          - Monitoring
          - Custom
      title:
        type: string
        description: The title of the event.
        minLength: 1
      message:
        type: string
        description: The message associated to the event.
        minLength: 1
      icon:
        type: string
        description: >-
          [A Font Awesome class name](https://fontawesome.com/icons)
        minLength: 3
      severity:
        type: string
        description: The severity associated to the event.
        enum:
          - info
          - warn
          - err
          - crit
      tags:
        type: array
        description: The list of tags associated to the event.
        items:
          $ref: '#/definitions/Tag'
      color:
        type: string
        description: >-
          The HTML color associated to the event. The valid colors are the ones listed in the  CSS 2 specification: https://www.w3.org/TR/CSS2/syndata.html#value-def-color. Only the keyword are accepted, the hexadecimal values are not valid.
        minLength: 3
        maxLength: 20
        pattern: '[a-z]+'
  NewEvent:
    title: A new event
    description: A new event to register in the Cycloid platform.
    required:
      - type
      - title
      - message
      - severity
      - tags
    properties:
      type:
        type: string
        description: The type of the event
        enum:
          - Cycloid
          - AWS
          - Monitoring
          - Custom
      title:
        type: string
        description: The title of the event.
        minLength: 1
      message:
        type: string
        description: The message associated to the event.
        minLength: 1
      icon:
        type: string
        description: >-
          [A Font Awesome class name](https://fontawesome.com/icons)
        minLength: 3
      severity:
        type: string
        description: tThe severity associated to the event.
        enum:
          - info
          - warn
          - err
          - crit
      tags:
        type: array
        description: The list of tags associated to the event.
        items:
          $ref: '#/definitions/Tag'
      color:
        type: string
        description: >-
          The HTML color associated to the event. The valid colors are the ones listed in the  CSS 2 specification: https://www.w3.org/TR/CSS2/syndata.html#value-def-color. Only the keyword are accepted, the hexadecimal values are not valid.
        minLength: 3
        maxLength: 20
        pattern: '[a-z]+'
  Tag:
    title: Key and value pair
    description: >-
      Key and value pair defined with the widely adopted name, tag.
    type: object
    required:
      - key
      - value
    properties:
      key:
        type: string
        minLength: 1
        maxLength: 254
      value:
        type: string
        maxLength: 254
        pattern: '^(?:[\w\-+=.:/@ ]*)$'
  TerraformProvider:
    title: Provider
    description: Provider of infrastructure
    required:
      - name
      - canonical
      - abbreviation
      - schema
      - cloud
    properties:
      name:
        type: string
      canonical:
        type: string
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        minLength: 3
      abbreviation:
        type: string
      cloud:
        type: boolean
      schema:
        type: object
  TerraformProviderSimple:
    title: TerraformProviderSimple
    description: Provider of infrastructure without the config
    required:
      - name
      - canonical
      - abbreviation
      - cloud
    properties:
      name:
        type: string
      canonical:
        type: string
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        minLength: 3
      abbreviation:
        type: string
      cloud:
        type: boolean
  TerraformProviderResource:
    title: Resource
    description: A Resource of a Provider
    required:
      - canonical
      - description
      - short_description
      - schema
      - is_node
      - is_edge
      - keywords
      - category
      - attributes
    properties:
      canonical:
        type: string
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        minLength: 3
      schema:
        type: object
      is_node:
        type: boolean
      is_edge:
        type: boolean
      image:
        type: string
        format: uri
      category:
        type: string
      short_description:
        type: string
      description:
        type: string
      keywords:
        type: array
        items:
          type: string
      attributes:
        $ref: '#/definitions/TerraformProviderResourceAttributes'
  TerraformProviderResourceAttributes:
    title: ResourceAttributes
    description: Holds specific logic of some attributes
    properties:
      important:
        type: array
        items:
          type: string
      status:
        type: string
      normalized_status:
        description: >-
          Is a KV where the K is the resource possible value and the Value is the normalized value of it.
          The current possible values are "unknown", "pending", "running", "stopping"
        type: object
  TerraformProviderResourceSimple:
    title: ResourceSimple
    description: A Resource of a Provider without the config
    required:
      - canonical
      - description
      - short_description
      - is_node
      - is_edge
      - keywords
      - category
      - attributes
    properties:
      canonical:
        type: string
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
        minLength: 3
      is_node:
        type: boolean
      is_edge:
        type: boolean
      image:
        type: string
        format: uri
      short_description:
        type: string
      description:
        type: string
      category:
        type: string
      keywords:
        type: array
        items:
          type: string
      attributes:
        $ref: '#/definitions/TerraformProviderResourceAttributes'
  TerraformJSONConfig:
    title: TerraformJSONConfig
    description: The JSON config for Terraform
    required:
      - config
    properties:
      config:
        type: object
  TerraformHCLConfig:
    title: TerraformHCLConfig
    description: The HCL config for Terraform
    required:
      - config
    properties:
      config:
        type: string
  TerraformValidationResult:
    title: TerraformValidationResult
    description: The result of the validation, if errors is empty means that is correct
    required:
      - errors
    properties:
      errors:
        type: array
        items:
          type: string
  TerraformJSONDiagram:
    title: TerraformDiagram
    description: The JSON Diagram structure
  TerraformImage:
    title: TerraformImage
    description: The Image from the TF structure
    required:
      - image
    properties:
      image:
        type: string
        format: byte
  UserEmail:
    title: User email address
    description: The user's email address
    required:
      - email
    properties:
      email:
        type: string
        format: email
  UserGuide:
    type: object
    title: User guide JSON schema
    description: The user's guide progress JSON schema
  Infrastructure:
    type: object
    title: Infrastructure
    description: Holds all the Infrastructure of the project in an environment
    required:
      - graph
      - config
    properties:
      graph:
        $ref: '#/definitions/InfrastructureGraph'
      config:
        $ref: '#/definitions/InfrastructureConfig'
  InfrastructureConfig:
    type: object
    title: InfrastructureConfig
    description: Holds all the Infrastructure config of the TFState
  InfrastructureGraph:
    type: object
    title: InfrastructureGraph
    description: Holds all the Infrastructure of the project in an environment in Graph format
    required:
      - nodes
      - edges
    properties:
      nodes:
        type: array
        items:
          $ref: '#/definitions/InfrastructureGraphNode'
      edges:
        type: array
        items:
          $ref: '#/definitions/InfrastructureGraphEdge'
  InfrastructureGraphNode:
    type: object
    title: Infrastructure
    description: Holds the information of a Node of the Graph
    required:
      - id
      - canonical
      - position
      - resource
    properties:
      id:
        type: string
      canonical:
        type: string
      position:
        type: array
        description: It holds [x,y]
        items:
          type: integer
          format: uint64
      resource:
        $ref: '#/definitions/TerraformProviderResourceSimple'
      name:
        type: string
  InfrastructureGraphEdge:
    type: object
    title: Infrastructure
    description: Holds the information of an Edge of the Graph
    required:
      - id
      - source
      - target
      - canonicals
    properties:
      id:
        type: string
      source:
        type: string
      target:
        type: string
      canonicals:
        type: array
        items:
          type: string
  Summary:
    type: object
    title: Summary of the organization
    required:
      - projects
      - pipelines
      - credentials
      - service_catalog_sources
      - config_repositories
      - teams
      - users
      - roles
      - service_catalogs
    properties:
      projects:
        type: integer
        format: uint64
      pipelines:
        type: integer
        format: uint64
      credentials:
        type: integer
        format: uint64
      service_catalog_sources:
        type: integer
        format: uint64
      config_repositories:
        type: integer
        format: uint64
      teams:
        type: integer
        format: uint64
      users:
        type: integer
        format: uint64
      roles:
        type: integer
        format: uint64
      service_catalogs:
        type: integer
        format: uint64
  APIKey:
    title: API key
    description: The entity which represents the information of an API key. The
      "token" field is only filled once, upon creation.
      It can only be used on an organization scope, for example user endpoints
      will not support it.
    type: object
    required:
      - id
      - canonical
      - name
      - rules
      - last_seven
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 3
      description:
        type: string
      rules:
        type: array
        items:
          $ref: '#/definitions/Rule'
      token:
        description: The actual API key in the format of JWT token, returned
          only upon creation.
        type: string
      last_seven:
        description: The last seven characters of API key.
          Allows user to differentiate between keys.
        type: string
      id:
        type: integer
        format: uint32
        minimum: 1
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this API key. When a user is the owner of an
          API key he has all the permissions on it.
          In the event where the user has been deleted that field might be empty.
      last_used:
        description: This field contains the date of the last usage of the API key
        type: integer
        format: uint64
  NewAPIKey:
    title: Create API key
    description: The entity which represents the information of a new API key.
    type: object
    required:
      - name
      - rules
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 3
      description:
        type: string
      rules:
        type: array
        items:
          $ref: '#/definitions/NewRule'
      owner:
        type: string
        description: |
          User canonical that owns this API key. If omitted then the person creating this
          credential will be assigned as owner. When a user is the owner of an API key he has
          all the permissions on it.
  UpdateAPIKey:
    title: Update API key
    description: |
      The entity which represents the information of the API key to be updated. 
      The API key rules are immutable and cannot be changed.
    type: object
    required:
      - name
    properties:
      name:
        type: string
        minLength: 3
      description:
        type: string
      owner:
        type: string
        description: |
          User canonical that owns this API key. Only the owner or an
          organization admin can update such a field. When a user is the owner
          of a API key it has all the permission on it.
  InfraPolicy:
    title: InfraPolicy
    description: The policy to control operations across infrastructure.
    required:
      - id
      - created_at
      - updated_at
      - name
      - canonical
      - description
      - body
      - severity
      - enabled
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      created_at:
        type: integer
        format: uint64
      updated_at:
        type: integer
        format: uint64
      name:
        type: string
        minLength: 3
      description:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this InfraPolicy. When a user is the owner of an
          InfraPolicy it has all the permissions on it.
          In the event where the user has been deleted then it will be null.
      body:
        type: string
        description: The body field is the code in plain text that defines the rules for the policy.
      severity:
        type: string
        enum:
          - critical
          - warning
          - advisory
        description: |
          It defines the enforcement level. It must be used from the caller of the InfraPolicy
          validation endpoint to apply the specific logic in case of not respected InfraPolicies.
          Uses critical to block the changes.
          Uses warning to block the changes but allow to override manually.
          Uses advisory to allow them but a notification must be send.
      enabled:
        type: boolean
  NewInfraPolicy:
    title: Create InfraPolicy
    description: Create a new policy to control operations across infrastructure.
    required:
      - name
      - owner
      - body
      - severity
    properties:
      name:
        type: string
        minLength: 3
      description:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      owner:
        type: string
        description: |
          User canonical that owns this InfraPolicy. When a user is the
          owner of an InfraPolicy it has all the permissions on it.
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      body:
        description: The body field is the code in plain text that defines the rules for the policy.
        type: string
      severity:
        type: string
        enum:
          - critical
          - warning
          - advisory
      enabled:
        type: boolean
  UpdateInfraPolicy:
    title: Update InfraPolicy
    description: Update a policy to control operations across infrastructure.
    required:
      - name
      - description
      - owner
      - body
      - severity
      - enabled
    properties:
      name:
        type: string
        minLength: 3
      description:
        type: string
      owner:
        type: string
        description: |
          User canonical that owns this InfraPolicy. When a user is the
          owner of an InfraPolicy it has all the permissions on it.
          In the event where the Owner has been deleted then a new one can be assigned
          or an empty canonical is allowed to not reset it.
        maxLength: 100
      body:
        description: The body field is the code in plain text that defines the rules for the policy.
        type: string
      severity:
        type: string
        enum:
          - critical
          - warning
          - advisory
      enabled:
        type: boolean
  InfraPoliciesValidationResult:
    title: Infra policies validation results.
    description: The set of not respected rules for the checked policies.
    properties:
      criticals:
        type: array
        items:
          $ref: '#/definitions/InfraPoliciesValidationResultItem'
      warnings:
        type: array
        items:
          $ref: '#/definitions/InfraPoliciesValidationResultItem'
      advisories:
        type: array
        items:
          $ref: '#/definitions/InfraPoliciesValidationResultItem'
  InfraPoliciesValidationResultItem:
    type: object
    description: |
      InfraPoliciesValidationResultItem represents a checked rule
      with a failed result generated from the validation process.
    required:
      - infra_policy
    properties:
      infra_policy:
        $ref: '#/definitions/InfraPolicy'
      reasons:
        description: |
          The messages about the reason of the validation failure
          that's written in the InfraPolicy's Body of the failed rule.
        type: array
        items:
          type: string
  Subscription:
    title: Subscription
    description: |
      It reflects the relation between an Organization and a Plan which
      could be the Free Trial or others, for more info check https://www.cycloid.io/pricing
    type: object
    required:
      - expires_at
      - plan
    properties:
      expires_at:
        type: integer
        format: uint64
        minimum: 0
      plan:
        $ref: '#/definitions/SubscriptionPlan'
      members_count:
        type: integer
        format: uint64
        minimum: 0
      current_members:
        type: integer
        format: uint64
        minimum: 0
  NewSubscription:
    title: New Subscription
    description: It reflects the creation of a Subscription
    type: object
    required:
      - plan_canonical
    properties:
      plan_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  SubscriptionPlan:
    title: SubscriptionPlan
    description: It reflects the Plan used for the subscription
    type: object
    required:
      - name
      - canonical
    properties:
      name:
        type: string
        minLength: 3
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  PendingMemberInvitation:
    title: PendingMemberInvitation
    description: Contains the email used for the member invitation
    type: object
    required:
      - email
    properties:
      email:
        type: string
        format: email
  CanDoInput:
    title: CanDoInput
    description: The input of the 'can_do' endpoint
    type: object
    required:
      - action
      - entity_canonicals
    properties:
      action:
        type: string
      entity_canonicals:
        description: List of the canonicals to the Resource excluding the Organization
        type: array
        items:
          type: string
  CanDoOutput:
    title: CanDoOutput
    description: The output of the 'can_do' endpoint
    type: object
    required:
      - ok
    properties:
      ok:
        type: boolean
      entity_canonicals:
        type: array
        items:
          type: string
  CostEstimationResult:
    title: CostEstimationResult
    description: The result of cost estimation.
    required:
      - resource_estimates
    properties:
      name:
        type: string
        description: Name of the current estimation
      info:
        type: string
        description: Extra details regarding estimation - usually related to no known resources, unknown providers, etc.
      resource_estimates:
        type: array
        items:
          $ref: '#/definitions/CostEstimationResourceEstimate'
      skipped_resource_addresses:
        description: |
          A list of addresses of resources that were skipped from the estimation process. A resource might be skipped
          due to being invalid or unsupported by Terracost.
        type: array
        items:
          type: string
      prior_cost:
        description: Prior monthly cost of the plan in decimal form.
        type: string
      planned_cost:
        description: Planned monthly cost of the plan in decimal form.
        type: string
      prior_hourly_cost:
        description: Prior hourly cost of the plan in decimal form.
        type: string
      planned_hourly_cost:
        description: Planned hourly cost of the plan in decimal form.
        type: string
  CostEstimationResourceEstimate:
    title: CostEstimationResourceEstimate
    description: Estimate for a single cloud resource.
    required:
      - provider
      - type
      - address
      - components
    properties:
      provider:
        description: The resource's cloud provider.
        type: string
      type:
        description: Type of the resource.
        type: string
      address:
        description: Unique identifier of the resource.
        type: string
      image:
        description: Path to the image of the resource
        type: string
        format: uri
      components:
        description: List of resource cost components.
        type: array
        items:
          $ref: '#/definitions/CostEstimationComponent'
      prior_cost:
        description: Prior monthly cost of the resource estimate in decimal form.
        type: string
      planned_cost:
        description: Planned monthly cost of the resource estimate in decimal form.
        type: string
      prior_hourly_cost:
        description: Prior hourly cost of the resource estimate in decimal form.
        type: string
      planned_hourly_cost:
        description: Planned hourly cost of the resource estimate in decimal form.
        type: string
  CostEstimationComponent:
    title: CostEstimationComponent
    description: Cost component of a cloud resource estimate.
    required:
      - label
      - rate
    properties:
      label:
        description: Human-readable label of the component.
        type: string
      rate:
        description: Monthly rate per unit.
        type: string
      unit:
        description: Unit of estimation.
        type: string
      usage:
        description: If the price is from usage or configuration
        type: boolean
      prior:
        $ref: '#/definitions/CostEstimationComponentState'
      planned:
        $ref: '#/definitions/CostEstimationComponentState'
  CostEstimationComponentState:
    title: CostEstimationComponentState
    description: Either a Prior or Planned cost component state.
    required:
      - quantity
      - details
      - cost
      - hourly_cost
    properties:
      quantity:
        description: Quantity of units.
        type: integer
        format: uint32
      details:
        description: List of items on which the cost is dependent.
        type: array
        items:
          type: string
      cost:
        description: Monthly cost of the component state in decimal form.
        type: string
      hourly_cost:
        description: Hourly cost of the component state in decimal form.
        type: string
  CloudCostManagementProjectResources:
    title: CloudCostManagementProjectResources
    description: |
      The new resources and associated cost for a project in a period of time.
    required:
      - cost
      - project
      - providers
    properties:
      cost:
        description: Cost for the project in the period
        type: number
      project:
        type: string
      providers:
        type: array
        items:
          $ref: '#/definitions/CloudCostManagementProjectProviderResources'
  CloudCostManagementProjectProviderResources:
    title: CloudCostManagementProjectProviderResources
    description: |
      Trend for a project
    required:
      - cost
      - kwh
      - co2e
      - provider
      - resources
      - new_resources
    properties:
      cost:
        description: Cost of the project for the provider
        type: number
      kwh:
        description: Energy consumption for the project and provider, in kwh
        type: number
      co2e:
        description: CO2e emissions for the project and provider, in metric tons
        type: number
      provider:
        type: string
      resources:
        type: integer
      new_resources:
        type: integer
  CloudCostManagementDashboard:
    title: CloudCostManagementDashboard
    description: |
      The dashboard of the Cloud Cost Management, it contains
      - a histogram of the cost in the period aggregated by provider and
        by time granularity
      - a histogram of the cost aggregated by the top projects and providers
        and filtered by the top projects
      - a list of resources and relative cost for each top projects
      - a map containing  properties that can be specified filtering the 
        returned results, with a set of valid values for each.
    required:
      - providers
      - projects
      - project_resources
      - filter_values
    properties:
      total_cost:
        type: number
      total_kwh:
        type: number
      total_co2e:
        type: number
      providers:
        $ref: '#/definitions/CloudCostManagementHistogram'
      projects:
        $ref: '#/definitions/CloudCostManagementHistogram'
      project_resources:
        type: array
        items:
          $ref: '#/definitions/CloudCostManagementProjectResources'
      filter_values:
        $ref: '#/definitions/CloudCostManagementFilterValues'
  CloudCostManagementProviderDetails:
    title: CloudCostManagementProviderDetails
    description: |
      Description of the costs of a specific provider
    type: object
    required:
      - cost_histogram
    properties:
      cost_histogram:
        $ref: '#/definitions/CloudCostManagementHistogram'
      filter_values:
        $ref: '#/definitions/CloudCostManagementFilterValues'
  CloudCostManagementProjectsDashboard:
    title: CloudCostManagementProjectsDashboard
    description: |
      The projects dashboard of the Cloud Cost Management, it contains
      - a histogram of the cost aggregated by date and project 
      - a histogram of cost aggregated by projects and providers
    required:
      - projects
      - project_providers
    properties:
      project_providers:
        $ref: '#/definitions/CloudCostManagementHistogram'
      projects:
        $ref: '#/definitions/CloudCostManagementHistogram'
  CloudCostManagementProviders:
    title: CloudCostManagementProviders
    description: |
      Date histogram of the cost of all the providers
    type: object
    required:
      - cost_histogram
    properties:
      cost_histogram:
        $ref: '#/definitions/CloudCostManagementHistogram'
  CloudCostManagementHistogram:
    title: CloudCostManagementHistogram
    description:
      The histogram of the costs for a period composed of buckets that aggregate
      the costs.
    required:
      - cost
      - kwh
      - co2e
      - buckets
    properties:
      cost:
        description: The total cost for the period.
        type: number
      kwh:
        description: The total energy consumption for the period, in kwh.
        type: number
      co2e:
        description: The total CO2e emissions for the period, in metric tons.
        type: number
      buckets:
        type: array
        items:
          $ref: '#/definitions/CloudCostManagementBucket'
  CloudCostManagementBucket:
    title: CloudCostManagementBucket
    description: |
      A sum of the cost generated in a period aggregated by one or more terms,
      for example if we aggregate costs by project here we have all the cost 
      generated by a specific project in the period of time defined by the 
      filters of the histogram.  In case the filter specifies more than one 
      aggregation term this type will recursively contain the other levels of 
      aggregation.
    required:
      - cost
      - value
      - kwh
      - co2e
    properties:
      cost:
        type: number
      value:
        description: | 
          The value of the aggregation term, for example if we aggregate cost 
          by region aggregate_value can be us-east-2, if we aggregate by project
          this can be cool_project_number_42, by service can be S3 or EC2, etc..
        type: string
      kwh:
        description: The total energy consumption for the aggregated usage, in kwh
        type: number
      co2e:
        description: The total CO2e emissions for the aggregated usage, in metric tons.
        type: number
      buckets:
        type: array
        items:
          $ref: '#/definitions/CloudCostManagementBucket'
  CloudCostManagementFilterValues:
    title: CloudCostManagementFilterValues
    description: |
      A collection of the values for which the cost can be filtered, i.e. all
      the providers, services, regions, etc... for one org.
    properties:
      providers:
        type: array
        items:
          type: string
      projects:
        type: array
        items:
          type: string
      environments:
        type: array
        items:
          type: string
      services:
        type: array
        items:
          type: string
      master_accounts:
        type: array
        items:
          type: string
      master_accounts_with_cp:
        type: object
      linked_accounts:
        type: array
        items:
          type: string
      linked_accounts_with_cp:
        type: object
      regions:
        type: array
        items:
          type: string
      resources:
        type: array
        items:
          type: string
      instance_types:
        type: array
        items:
          type: string
      categories:
        type: array
        items:
          type: string
      currencies:
        type: array
        items:
          type: string
      tags:
        type: object
        additionalProperties:
          type: array
          items:
            type: string
  TerraformPlanInput:
    title: TerraformPlanInput
    description: Input for endpoints that require a Terraform plan.
    required:
      - tfplan
    properties:
      tfplan:
        description: "Terraform plan file in escaped JSON format. See more: https://www.terraform.io/internals/json-format"
        type: string
  KPI:
    title: KPI
    description: >-
      A KPI
    required:
      - id
      - name
      - canonical
      - type
      - config
      - widget
      - description
      - created_at
      - updated_at
      - error
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
        minLength: 3
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      type:
        type: string
        enum:
          [
            "build_avg_time",
            "build_frequency",
            "build_history",
            "code_coverage",
            "time_to_release",
          ]
      widget:
        type: string
        enum:
          ["bars", "stackbars", "doughnut", "history", "line", "pie", "summary"]
      config:
        description: >
          The config represent some extra parameters which are required for the configuration of certain KPIs.
          Please refer to the documentation for more details.
        type: object
      description:
        type: string
      project_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      environment_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[\da-zA-Z]+(?:[\da-zA-Z\-._]+[\da-zA-Z]|[\da-zA-Z])$'
      pipeline_name:
        type: string
      job_name:
        type: string
      error:
        description: If an error occurred in the last import, that field will be filled with the message of the error
        type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      data_set:
        description: >-
          The data is represented in CSV format. Depending on the widget configured for the KPI, the format may vary.
          For more information please refer to our product documentation.
        type: array
        items:
          type: object
      favorite:
        type: boolean
  NewKPI:
    title: New KPI
    description: >-
      A KPI's configuration that needs to be saved
    required:
      - name
      - type
      - widget
    properties:
      name:
        type: string
        minLength: 3
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      type:
        type: string
        enum:
          [
            "build_avg_time",
            "build_frequency",
            "build_history",
            "code_coverage",
            "time_to_release",
          ]
      widget:
        type: string
        enum:
          ["bars", "stackbars", "doughnut", "history", "line", "pie", "summary"]
      config:
        description: >
          The config represent some extra parameters which are required for the configuration of certain KPIs.
          Please refer to the documentation for more details.
        type: object
      description:
        type: string
      project_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      environment_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[\da-zA-Z]+(?:[\da-zA-Z\-._]+[\da-zA-Z]|[\da-zA-Z])$'
      pipeline_name:
        type: string
      job_name:
        type: string
  Country:
    title: Country
    description: Single country Representation
    required:
      - code
      - name
    properties:
      code:
        type: string
        pattern: '^[A-Z]{2}$'
      name:
        type: string
  NewLicence:
    title: Licence
    description: Object containing licence parameters
    required:
      - key
    properties:
      key:
        description: Licence's key in the JWT format
        type: string
  Licence:
    title: Licence
    description: Object containing licence parameters
    required:
      - key
      - created_at
      - updated_at
      - company_name
      - email_address
      - members_count
      - expires_at
      - version
      - on_prem
      - current_members
    properties:
      key:
        description: Licence's key in the JWT format
        type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      company_name:
        type: string
      email_address:
        type: string
      members_count:
        type: integer
        format: uint64
        minimum: 0
      expires_at:
        type: integer
        format: uint64
        minimum: 0
      version:
        type: string
      on_prem:
        type: boolean
      current_members:
        type: integer
        format: uint64
        minimum: 0
  NewInfraImport:
    title: New Infra Import
    description: Entry that represents all the data needed to import a stack
    required:
      - credential_canonical
      - stack
      - configuration
    properties:
      module_variables:
        description: It's a KV where the key is the resource name and the value is the list (array) of attributes to include as part of the module
        type: object
        additionalProperties:
          type: array
          items:
            type: string
      tags:
        description: List of tags to filter with format NAME:VALUE
        type: array
        items:
          type: string
      include:
        description: "List of resources to import, these names are the ones on TF (ex: aws_instance). If not set then it means that all the resources will be imported"
        type: array
        items:
          type: string
      targets:
        description: List of resources to import via ID, those IDs are the ones documented on Terraform that are needed to Import. The format is 'aws_instance.ID'
        type: array
        items:
          type: string
      credential_canonical:
        description: Credential that will be used to import from the provider
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      stack:
        $ref: '#/definitions/NewServiceCatalog'
      project:
        $ref: '#/definitions/NewInfraImportProject'
      environment:
        $ref: '#/definitions/NewEnvironment'
      external_backend:
        $ref: '#/definitions/NewInfraImportExternalBackend'
      configuration:
        $ref: '#/definitions/CloudProviderConfiguration'
  InfraImportResourceBody:
    title: Provider Resources body
    description: Entry that represents all the data needed for fetching resource
    required:
      - credential_canonical
      - configuration
    properties:
      credential_canonical:
        description: Credential that will be used to import from the provider
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      configuration:
        $ref: '#/definitions/CloudProviderConfiguration'
      tags:
        type: array
        items:
          type: string
  InfraImportResourcesBody:
    title: Provider's Resources body
    description: Entry that represents all the data needed for fetching resources
    required:
      - credential_canonical
      - configuration
    properties:
      credential_canonical:
        description: Credential that will be used to import from the provider
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      configuration:
        $ref: '#/definitions/CloudProviderConfiguration'
  CloudProviderConfiguration:
    type: object
    discriminator: type
    properties:
      type:
        type: string
    required:
      - type
  CloudProviderAWSConfiguration:
    description: |
      Representation of AWS configuration
    allOf:
      - $ref: '#/definitions/CloudProviderConfiguration'
      - type: object
        properties:
          region:
            type: string
            description: |
              The AWS region where the resource exists
        required:
          - region
  CloudProviderGCPConfiguration:
    description: |
      Representation of Google configuration
    allOf:
      - $ref: '#/definitions/CloudProviderConfiguration'
      - type: object
        properties:
          region:
            type: string
            description: |
              The Google region where the resource exists
          project:
            type: string
            description: |
              The Google project where the resource exists
        required:
          - region
          - project
  CloudProviderAzureConfiguration:
    description: |
      Representation of Azure configuration
    allOf:
      - $ref: '#/definitions/CloudProviderConfiguration'
      - type: object
        properties:
          resource_group_names:
            type: array
            items:
              type: string
            minItems: 1
            description: |
              The Azure resource group name of the configuration
          environment:
            type: string
            description: |
              The Azure environment of the configuration
        required:
          - resource_group_names
          - environment
  CloudProviderVMWareVSphereConfiguration:
    description: |
      Representation of VMware vSphere configuration
    allOf:
      - $ref: '#/definitions/CloudProviderConfiguration'
      - type: object
        properties:
          server:
            type: string
            description: |
              This is the vCenter Server FQDN or IP Address for vSphere API operations
          allow_unverified_ssl:
            type: boolean
            description: |
               Used to disable verification of server's SSL certificate.
        required:
          - server
          - allow_unverified_ssl
  NewInfraImportProject:
    title: Create Project for the Infra Import
    description: The entity which represents the information of a new project.
    type: object
    required:
      - name
      - config_repository_canonical
    properties:
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      name:
        type: string
        minLength: 1
      description:
        type: string
        description: |
          A description regarding the project to help identify/remember details,
          implementation, purpose, etc.
      config_repository_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  NewInfraImportExternalBackend:
    title: New External backend
    description: >-
      An external backend contains the configuration needed in order to be
      plugged into the Cycloid system.
      A backend is a general purpose concept, but Cycloid specifies which ones
      are supported and the list of those which are supported for every
      concrete feature.
    required:
      - configuration
    properties:
      credential_canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      configuration:
        $ref: '#/definitions/ExternalBackendConfiguration'
  InfraImport:
    title: Infra Import
    description: |
      The entity which represents the information of for the import of a new Stack or Project.
    type: object
    required:
      - status
      - logs
      - service_catalog_ref
      - error
    properties:
      status:
        description: The import process status.
        type: string
        enum:
          - succeeded
          - failed
          - importing
      project_canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      service_catalog_ref:
        description: >-
          It's the ref of the Service Catalog, like 'cycloidio:stack-magento'
        type: string
      logs:
        type: string
      error:
        type: string
  InfraImportPreset:
    title: InfraImportPreset
    description: |
      Infra Import's pre-configured group with Resources commonly used together in a specific context.
    required:
      - name
      - resources
    properties:
      name:
        type: string
      resources:
        type: array
        items:
          type: string
  InfraImportResource:
    title: Infra Import Resource
    description: |
      The representation of the Infra Import's Resource of a Cloud Provider.
    required:
      - id
    properties:
      id:
        type: string
  CloudCostManagementAccount:
    title: CloudCostManagementAccount
    description: Object containing Cloud Cost Management account parameters
    required:
      - id
      - canonical
      - name
      - account_id
      - created_at
      - updated_at
      - enabled
      - cloud_provider
      - status
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        description: A user-defined name for the account
        type: string
      account_id:
        description: The ID of an account on the CP
        type: string
      parent_account_id:
        description: The ID of the parent account on the CP
        type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      last_ingestion_started_at:
        type: integer
        format: uint64
        minimum: 0
      last_ingestion_ended_at:
        type: integer
        format: uint64
        minimum: 0
      id:
        type: integer
        format: uint32
        minimum: 1
      external_backend:
        $ref: '#/definitions/ExternalBackend'
      credential:
        $ref: '#/definitions/CredentialSimple'
      status:
        type: string
        enum:
          ['idle', 'error', 'import']
      status_message:
        type: string
      cloud_provider:
        $ref: '#/definitions/CloudProvider'
      enabled:
        type: boolean
      phase:
        type: string
        enum:
          ['green', 'blue']
      unfinalized_period:
        type: string
  CloudCostManagementAccountParent:
    title: CloudCostManagementAccountParent
    description: |
        Object containing Cloud Cost Management parent account parameters. The difference
        between it and CloudCostManagementAccount is that parent has no EB/Credential
        displayed, as it's not necessary
    required:
      - id
      - canonical
      - name
      - account_id
      - created_at
      - updated_at
      - enabled
      - cloud_provider
      - status
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        description: A user-defined name for the account
        type: string
      account_id:
        description: The ID of an account on the CP
        type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      last_ingestion_started_at:
        type: integer
        format: uint64
        minimum: 0
      last_ingestion_ended_at:
        type: integer
        format: uint64
        minimum: 0
      id:
        type: integer
        format: uint32
        minimum: 1
      status:
        type: string
        enum:
          ['idle', 'error', 'import']
      status_message:
        type: string
      cloud_provider:
        $ref: '#/definitions/CloudProvider'
      enabled:
        type: boolean
  CloudCostManagementLinkedAccount:
    title: CloudCostManagementLinkedAccount
    description: |
      An account that is linked to a Cloud Cost Management account in the cloud
      provider. It is not managed by Cloud Cost Management, but appears in the cost records.
    type: object
    required:
      - id
      - name
      - account_id
      - cloud_provider
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      account_id:
        description: ID of the account in the cloud provider
        type: string
      name:
        description: A user-defined name for the account
        type: string
      cloud_provider:
        description: |
          The cloud provider canonical that this project is using - between the
          supported ones.
        type: string
  UpdateCloudCostManagementLinkedAccount:
    title: Update CloudCostManagementLinkedAccount
    description: |
      Attributes of a CCM linked accout that can be updated by a user.
    type: object
    required:
      - name
    properties:
      name:
        type: string
  NewCloudCostManagementAccount:
    title: Create CloudCostManagementAccount
    description: |
      Create a new Cloud Cost Management account to connect CP.
      If a canonical is missing, the one from credential will be applied
    required:
      - external_backend
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        description: A user-defined name for the account
        type: string
      external_backend:
        $ref: '#/definitions/NewExternalBackend'
  NewCloudCostManagementAccountChild:
    title: Create CloudCostManagementAccountChild
    description: |
      Create a new Cloud Cost Management Child account. This count has no 
      ExternalBackend since it is not ingesting data.
      If a canonical is missing, the one from credential will be applied
    required:
      - parent_account_id
      - credential_canonical
    properties:
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        description: A user-defined name for the account
        type: string
      parent_account_id:
        description: The ID of the parent account on the CP
        type: string
      credential_canonical:
        description: Canonical of  the credentials used
        type: string
  UpdateCloudCostManagementAccount:
    title: Update CloudCostManagementAccount
    description: Update a Cloud Cost Management account to connect CP.
    required:
      - enabled
      - external_backend
    properties:
      enabled:
        type: boolean
      name:
        description: A user-defined name for the account
        type: string
      external_backend:
        $ref: '#/definitions/UpdateExternalBackend'
  CloudCostManagementTagMapping:
    title: CloudCostManagementTagMapping
    description: |
      Object containing Cloud Cost Management tag mapping. The mapping is used to 
      identify resources belonging to projects and environments across cloud
      providers. The mapping can be a set of tag keys or a regexp to capture
      tag keys.
    required:
      - id
      - created_at
      - updated_at
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      project_tags:
        type: array
        items:
          type: string
      project_regex:
        type: string
      environment_tags:
        type: array
        items:
          type: string
      environment_regex:
        type: string
      all_tags:
        description: This is a list of all the tag keys in the DB for the Org
        type: array
        items:
          type: string
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  UpdateCloudCostManagementTagMapping:
    title: Create or Update CloudCostManagementTagMapping
    description: Create or Update a Cloud Cost Management tag mapping for projects and environments
    properties:
      project_tags:
        type: array
        items:
          type: string
      project_regex:
        type: string
      environment_tags:
        type: array
        items:
          type: string
      environment_regex:
        type: string
  State:
    title: State
    description: The State of an Inventory of the Project's environment
    properties:
      terraform_version:
        type: string
      version:
        type: integer
        format: uint32
      serial:
        type: integer
        format: uint32
      lineage:
        type: string
      resources:
        type: array
        items:
          $ref: '#/definitions/StateResource'
      outputs:
        type: object
  StateResource:
    title: State Resource
    description: The Resource of a State in the Inventory of the Project's environment
    properties:
      provider:
        type: string
      type:
        type: string
      name:
        type: string
      module:
        type: string
      mode:
        type: string
      instances:
        type: array
        items:
          $ref: '#/definitions/StateResourceInstances'
      image:
        description: Image of the resource type
        type: string
        format: uri
      category:
        description: Category of the resource type
        type: string
      short_description:
        description: Short description of the resource type documentation
        type: string
      description:
        description: Full description of the resource type documentation
        type: string
      keywords:
        description: Set of keywords to categorize the resource type
        type: array
        items:
          type: string
      project_canonical:
        description: Project canonical in which this resource is used
        type: string
  StateResourceInstances:
    title: State Resource Instances
    description: The Instances inside Resources of a State in the Inventory of the Project's environment
    properties:
      attributes:
        type: object
      custom_attributes:
        type: object
  StateLock:
    title: State Lock
    description: The Lock management of a State in the Inventory of the Project's environment
    properties:
      id:
        type: string
      operation:
        type: string
      info:
        type: string
      who:
        type: string
      version:
        type: string
      created:
        type: string
  NewInventoryResource:
    title: New Inventory Resource
    description: The Resource of the Inventory representing an element of your infrastructure
    required:
      - provider
      - type
      - label
      - name
    properties:
      provider:
        type: string
        description: The provider of the created Resource
      type:
        type: string
        description: The type of the resource
      name:
        type: string
        description: The name of the resource
      custom_attributes:
        type: object
        description: List of attributes (key value object) of the Resource, can be anything
        example:
          "custom": "attribute"
          "another": "one"
      label:
        type: string
        description: A way to distinguish and categorize resources
        example: "my-label"
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that it has in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of cpu cores that it has in units
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of storage that it has in MB
  InventoryResource:
    title: Inventory Resource
    description: The Resource of the Inventory representing an element of your infrastructure
    required:
      - provider
      - type
      - name
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      provider:
        type: string
        description: The provider of the created Resource
      type:
        type: string
        description: The type of the resource
      name:
        type: string
        description: The name of the resource
      mode:
        type: string
        description: The way this resource is handled
      module:
        type: string
        description: The module it belongs to
      custom_attributes:
        type: object
        description: List of attributes of the Resource, can be anything
      label:
        type: string
        description: A way to distinguish and categorize resources
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that it has in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of cpu that it has in units
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of storage that it has in MB
      attributes:
        type: object
      image:
        description: Image of the resource type
        type: string
        format: uri
      category:
        description: Category of the resource type
        type: string
      short_description:
        description: Short description of the resource type documentation
        type: string
      description:
        description: Full description of the resource type documentation
        type: string
      keywords:
        description: Set of keywords to categorize the resource type
        type: array
        items:
          type: string
      project_canonical:
        description: Project canonical in which this resource is used
        type: string
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      environment_canonical:
        description: Environment canonical in which this resource is used
        type: string
        pattern: '^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$'
  InventoryResourceLabel:
    title: Inventory Resource Label
    type: object
    description: Aggregated information of resources having a label
    required:
      - name
      - cpu
      - storage
      - memory
    properties:
      name:
        type: string
        description: Value of the resources' label
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The aggregated amount of memory of resources having the label in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The aggregated amount of cpu of resources having the label
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The aggregated amount of storage of resources having the label in MB
  NewResourcePool:
    title: New Resource Pool
    description: The Resource Pool defines the basic needs to create/update a resource pool
    required:
      - name
      - label
    properties:
      name:
        type: string
      label:
        type: string
  ResourcePool:
    title: Resource Pool
    description: A Resource Pool holds the information of all the Resources that have
      the same label. The Used is the amount used by Projects using Quotas and
      Allocated is the amount declared by Quotas
    required:
      - name
      - canonical
      - label
      - memory
      - cpu
      - storage
      - used_memory
      - used_cpu
      - used_storage
      - allocated_memory
      - allocated_cpu
      - allocated_storage
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      name:
        type: string
      canonical:
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      label:
        type: string
        description: The label to which match the resources
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that it has in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of cpu that it has in units
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of storage that it has in MB
      used_memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that is used in MB
      used_cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of CPU that is used in units
      used_storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of Storage that is used in MB
      allocated_memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that is allocated (quotas defined) in MB
      allocated_cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of CPU that is allocated (quotas defined) in units
      allocated_storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of Storage that is allocated (quotas defined) in MB
  NewQuota:
    title: New Quota
    description: The Quota defines the basic needs to create a quota
    required:
      - memory
      - cpu
      - storage
      - resource_pool_canonical
      - team_canonical
    properties:
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that it has in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of cpu that it has in units
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of storage that it has in MB
      resource_pool_canonical:
        description: The Resource Pool it'll be used
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      team_canonical:
        description: The Team it'll be limiting
        type: string
        minLength: 3
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
  UpdateQuota:
    title: Update Quota
    description: The Quota defines the basic needs to update a create
    required:
      - memory
      - cpu
      - storage
    properties:
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that it has in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of cpu that it has in units
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of storage that it has in MB
  Quota:
    title: Quota
    description: A Quota holds the information of the restrictions applied
      to a Team having as source a Resource Pool
    required:
      - id
      - memory
      - cpu
      - storage
      - used_memory
      - used_cpu
      - used_storage
      - team
      - resource_pool
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that it has in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of cpu that it has in units
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of storage that it has in MB
      used_memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that is used in MB
      used_cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of CPU that is used in units
      used_storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of Storage that is used in MB
      team:
        $ref: '#/definitions/SimpleTeam'
      resource_pool:
        $ref: '#/definitions/ResourcePool'
  ProjectEnvironmentConsumption:
    title: ProjectEnvironmentConsumption
    description: The Consumption of a Project in an Environment
    required:
      - id
      - memory
      - cpu
      - storage
      - project
      - environment
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      memory:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of memory that it has in MB
      cpu:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of cpu that it has in units
      storage:
        type: integer
        format: uint64
        minimum: 0
        description: The amount of storage that it has in MB
      project:
        $ref: "#/definitions/ProjectSimple"
      environment:
        $ref: "#/definitions/Environment"
  ProjectSimple:
    title: ProjectSimple
    description: The entity which represents minimal information of a project.
    type: object
    required:
      - id
      - canonical
      - name
      - created_at
      - updated_at
    properties:
      id:
        type: integer
        format: uint32
        minimum: 1
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)'
      name:
        type: string
        minLength: 1
      description:
        type: string
      owner:
        $ref: '#/definitions/User'
        description: |
          Organization member that owns this project. When a user is the owner of a
          project it has all the permissions on it.
          In the event where the user has been deleted that field might be empty.
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
      import_status:
        description: The import process status.
        type: string
        enum:
          - succeeded
          - failed
          - importing
      favorite:
        type: boolean
  Appearance:
    title: Appearance
    description: An Appearance holds the values of the branding configuration, 
      which are rendered across an organization
    required:
      - canonical
      - name
      - display_name
      - tab_title
      - color
      - logo
      - favicon
      - footer
    properties:
      canonical:
        type: string
        minLength: 1
        maxLength: 100
        pattern: '^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$'
      name:
        type: string
        minLength: 1
        maxLength: 50
      display_name:
        type: string
        minLength: 1
        maxLength: 50
      tab_title:
        type: string
        minLength: 1
        maxLength: 50
      color:
        type: object
        required:
          - r
          - g
          - b
        properties:
          r:
            description: Red color value of the RGB color
            type: integer
            format: uint32
            minimum: 0
            maximum: 255
          g:
            description: Green color value of the RGB color
            type: integer
            format: uint32
            minimum: 0
            maximum: 255
          b:
            description: Blue color value of the RGB color
            type: integer
            format: uint32
            minimum: 0
            maximum: 255
      logo:
        type: string
        format: uri
      favicon:
        type: string
        format: uri
      footer:
        type: string
        minLength: 0
        maxLength: 1000
      is_active:
        type: boolean
      created_at:
        type: integer
        format: uint64
        minimum: 0
      updated_at:
        type: integer
        format: uint64
        minimum: 0
  NewAppearance:
    title: Appearance
    description: An Appearance holds the values of the branding configuration, 
      which are rendered across an organization
    required:
      - name
      - display_name
      - tab_title
      - color
      - logo
      - favicon
      - footer
    properties:
      name:
        type: string
        minLength: 1
        maxLength: 50
      display_name:
        type: string
        minLength: 1
        maxLength: 50
      tab_title:
        type: string
        minLength: 1
        maxLength: 50
      color:
        type: object
        required:
          - r
          - g
          - b
        properties:
          r:
            description: Red color value of the RGB color
            type: integer
            format: uint32
            minimum: 0
            maximum: 255
          g:
            description: Green color value of the RGB color
            type: integer
            format: uint32
            minimum: 0
            maximum: 255
          b:
            description: Blue color value of the RGB color
            type: integer
            format: uint32
            minimum: 0
            maximum: 255
      logo:
        type: string
        format: uri
      favicon:
        type: string
        format: uri
      footer:
        type: string
        minLength: 0
        maxLength: 1000
  FormsValuesRef:
    title: Forms values ref
    description: >-
      It has the information to get the values of an entity of the Form
    type: object
    required:
      - url
    properties:
      url:
        type: string
        description: The url to which fetch the results
paths:
  '/appearance/{organization_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Appearance 
      description: Get the active appearance available in the organization
      operationId: getActiveAppearance
      security: []
      responses:
        '200':
          description: Default Appearance available in the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Appearance'
          examples:
            application/json:
              data:
                canonical: "default"
                name: "Default"
                display_name: "Cycloid"
                tab_title: "Cycloid"
                color: 
                  r: 28
                  g: 151
                  b: 151
                logo: "https://console.cycloid.io/static/images/app-logo-square.svg"
                favicon: "https://console.cycloid.io/static/favicons/favicon.ico"
                footer: ""
                is_active: true
                created_at: 1503225026
                updated_at: 1503335026
        default:
          $ref: '#/responses/unexpected_error'
  '/appearance':
    get:
      tags:
        - Appearance
      description: Get the default appearance available in the platform
      operationId: getDefaultAppearance
      security: []
      responses:
        '200':
          description: Default Appearance available in the platform.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Appearance'
          examples:
            application/json:
              data:
                canonical: "default"
                name: "Default"
                display_name: "Cycloid"
                tab_title: "Cycloid"
                color: 
                  r: 28
                  g: 151
                  b: 151
                logo: "/static/logos/logo.svg"
                favicon: "/static/favicons/favicon.ico"
                footer: ""
                is_active: true
                created_at: 1503225026
                updated_at: 1503335026
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/jsontohcl':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      tags:
        - Code Generation
      description: Transforms a JSON to a HCL
      operationId: terraformJSONToHCL
      parameters:
        - in: body
          name: body
          description: The Terraform JSON config
          required: true
          schema:
            $ref: '#/definitions/TerraformJSONConfig'
      responses:
        '200':
          description: The HCL translation of the config
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformHCLConfig'
          examples:
            application/json:
              data:
                config: '
                  "data" "aws_ami" "debian_jessie_latest" {
                    "most_recent" = true
                  }
                  "locals" = {
                    "codecommit_repository_name" = "something"
                  }
                  "output" "sensitive" {
                    "sensitive" = true
  
                    "value" = "VALUE"
                  }
                  "provider" "aws" {
                    "access_key" = "${var.access_key}"
                  }
                  "resource" "aws_elb" "front" {
                    "name" = "${var.project}-front-${var.env}"
                    "tags" = {
                      "name" = "some name"
                    }
                  }
                  "variable" "front_disk_size" {
                    "default" = 60
                  }
                '
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/infra_import/providers/{provider_canonical}/presets':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
    get:
      tags:
        - Code Generation
      description: List Infra Import Presets
      operationId: getInfraImportPresets
      responses:
        '200':
          description: The Infra Import Presets
          headers:
            Content-Length:
              description: The length of the response body in octets (8-bit bytes).
              type: integer
              format: uint64
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/InfraImportPreset'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - name: Preset1
                  resources: ['aws_route53_zone', 'aws_security_group']
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/infra_import/providers/{provider_canonical}/resources/{resource_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
      - $ref: '#/parameters/resource_canonical'
    post:
      tags:
        - Code Generation 
      description: List Provider's Resource
      operationId: getInfraImportResource
      parameters:
        - in: body
          name: body
          description: Information for filtering and access the Cloud Provider's Resources.
          required: true
          schema:
            $ref: '#/definitions/InfraImportResourceBody'
      responses:
        '200':
          description: The Infra Import's Resources
          headers:
            Content-Length:
              description: The length of the response body in octets (8-bit bytes).
              type: integer
              format: uint64
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/InfraImportResource'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 'i-1234567890abcdef0'
                - id: 'i-1234567890abcdef1'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/infra_import/providers/{provider_canonical}/resources':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
    post:
      tags:
        - Code Generation 
      description: List infrastructure import provider's resources 
      operationId: getInfraImportResources
      parameters:
        - in: body
          name: body
          description: Access information of the Cloud Provider's Resources.
          required: true
          schema:
            $ref: '#/definitions/InfraImportResourcesBody'
      responses:
        '200':
          description: The InfraImport's Resources Types
          headers:
            Content-Length:
              description: The length of the response body in octets (8-bit bytes).
              type: integer
              format: uint64
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/TerraformProviderResourceSimple'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: "aws_instance"
                  image: 'http://via.placeholder.com/150x150'
                  is_node: true
                  is_edge: false
                  category: "SomeCategory"
                  keywords: []
                  description: "detailed resource description"
                  short_description: "resource description"
                - canonical: "aws_elb"
                  image: 'http://via.placeholder.com/150x150'
                  is_node: true
                  is_edge: false
                  category: "SomeCategory"
                  keywords: []
                  description: "detailed resource description"
                  short_description: "resource description"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/providers':
    get:
      tags:
        - Code Generation
      parameters:
        - $ref: '#/parameters/organization_canonical'
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      description: Return all the Providers
      operationId: getTerraformProviders
      responses:
        '200':
          description: List of the Providers
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/TerraformProviderSimple'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - name: "Amazon Web Service"
                  canonical: "aws"
                  abbreviation: "AWS"
                  cloud: true
                  image: 'http://via.placeholder.com/150x150'
                - name: "Terraform Template"
                  canonical: "template"
                  abbreviation: "Template"
                  cloud: false
                  image: 'http://via.placeholder.com/150x150'
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/providers/{provider_canonical}/data_sources':
    get:
      tags:
        - Code Generation
      parameters:
        - $ref: '#/parameters/organization_canonical'
        - $ref: '#/parameters/provider_canonical'
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      description: Return all the DataSources for the Provider
      operationId: getTerraformProviderDataSources
      responses:
        '200':
          description: List of the DataSources
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/TerraformProviderResourceSimple'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: "aws_instance"
                  image: 'http://via.placeholder.com/150x150'
                  is_node: true
                  is_edge: false
                  category: "SomeCategory"
                  keywords: []
                  description: "detailed resource description"
                  short_description: "resource description"
                - canonical: "aws_elb"
                  image: 'http://via.placeholder.com/150x150'
                  is_node: true
                  is_edge: false
                  category: "SomeCategory"
                  keywords: []
                  description: "detailed resource description"
                  short_description: "resource description"
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/providers/{provider_canonical}/data_sources/{resource_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
      - $ref: '#/parameters/resource_canonical'
    get:
      tags:
        - Code Generation
      description: Get the information of the DataSource
      operationId: getTerraformProviderDataSource
      responses:
        '200':
          description: The information of the DataSource
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformProviderResource'
          examples:
            application/json:
              data:
                canonical: "aws_lb"
                is_node: true
                is_edge: false
                image: 'http://via.placeholder.com/150x150'
                schema:
                  dns_name:
                    required: false
                    optional: false
                    type: "TypeString"
                    default: ""
                  internal:
                    required: false
                    optional: true
                    type: "TypeBool"
                    default: "null"
                category: "SomeCategory"
                keywords: []
                description: "detailed resource description"
                short_description: "resource description"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/providers/{provider_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
    get:
      tags:
        - Code Generation
      description: Get the information of the Provider
      operationId: getTerraformProvider
      responses:
        '200':
          description: The information of the Provider
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformProvider'
          examples:
            application/json:
              data:
                name: "Amazon Web Service"
                canonical: "aws"
                abbreviation: "AWS"
                image: 'http://via.placeholder.com/150x150'
                cloud: true
                schema:
                  access_key:
                    required: false
                    optional: true
                    type: "TypeString"
                    default: ""
                  secret_key:
                    required: false
                    optional: true
                    type: "TypeString"
                    default: ""
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/providers/{provider_canonical}/resources':
    get:
      tags:
        - Code Generation
      parameters:
        - $ref: '#/parameters/organization_canonical'
        - $ref: '#/parameters/provider_canonical'
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      description: Return all the Resources for the Provider
      operationId: getTerraformProviderResources
      responses:
        '200':
          description: List of the Resources
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/TerraformProviderResourceSimple'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: "aws_instance"
                  image: 'http://via.placeholder.com/150x150'
                  is_node: true
                  is_edge: false
                  category: "SomeCategory"
                  keywords: []
                  description: "detailed resource description"
                  short_description: "resource description"
                - canonical: "aws_elb"
                  image: 'http://via.placeholder.com/150x150'
                  is_node: true
                  is_edge: false
                  category: "SomeCategory"
                  keywords: []
                  description: "detailed resource description"
                  short_description: "resource description"
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/providers/{provider_canonical}/resources/{resource_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
      - $ref: '#/parameters/resource_canonical'
    get:
      tags:
        - Code Generation
      description: Get the information of the Resource
      operationId: getTerraformProviderResource
      responses:
        '200':
          description: The information of the Resource
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformProviderResource'
          examples:
            application/json:
              data:
                canonical: "aws_lb"
                is_node: true
                is_edge: false
                image: 'http://via.placeholder.com/150x150'
                attributes:
                  important: ["count"]
                  status: "status"
                  normalized_status:
                    "on": "running"
                schema:
                  dns_name:
                    required: false
                    optional: false
                    type: "TypeString"
                    default: ""
                  internal:
                    required: false
                    optional: true
                    type: "TypeBool"
                    default: "null"
                category: "SomeCategory"
                keywords: []
                description: "detailed resource description"
                short_description: "resource description"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/code_generation/terraform/validate':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      tags:
        - Code Generation
      description: Validates a TF configuration
      operationId: terraformValidate
      parameters:
        - in: body
          name: body
          description: The Terraform JSON config
          required: true
          schema:
            $ref: '#/definitions/TerraformJSONConfig'
      responses:
        '200':
          description: The result of validating the provided configuration
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformValidationResult'
          examples:
            application/json:
              data:
                errors:
                  - "resource 'aws_elb.front' config: unknown variable referenced: 'name'; define it with a 'variable' block"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  /config:
    get:
      tags:
        - Cycloid
      description: Get the Cycloid configuration.
      operationId: getConfig
      security: []
      responses:
        '200':
          description: Cycloid configuration, including available authentication methods.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/AppConfig'
          examples:
            application/json:
              data:
                authentication:
                  local:
                    enabled: true
                  oauth:
                    - provider: azuread
                      tenant_id: 67b96869-421d-4897-9f95-dc66aacbe915
                      client_id: 67b96869-421d-4897-9f95-dc66aacbe915
                      type: AzureADAuthConfig
                    - provider: google
                      client_id: 741192805913-s10ibou8065iofnb9rcir9269skiqts9.apps.googleusercontent.com
                      type: GoogleOAuthConfig
                    - provider: github
                      host_address: https://api.github.com
                      client_id: 6a94210b44f4a612952e
                      type: GitHubOAuthConfig
                  saml2:
                    - provider: https://samltest.id/saml/idp
                      sso_url: https://samltest.id/idp/profile/SAML2/Redirect/SSO?SAMLRequest=fJLPbtswDIdfReDdkeV0aU3UAbwGwwJ...
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  /countries:
    get:
      tags:
        - Cycloid
      description: Get the Cycloid supported countries.
      operationId: getCountries
      security: []
      responses:
        '200':
          description: Cycloid supported countries
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Country'
          examples:
            application/json:
              data:
                - code: "AD"
                  name: "Andorra"
                - code: "FR"
                  name: "France"
                - code: "GB"
                  name: "United Kingdom"
        default:
          $ref: '#/responses/unexpected_error'
  /status:
    get:
      tags:
        - Cycloid
      description: Get the status of the Cycloid's services.
      operationId: getStatus
      security: []
      responses:
        '200':
          description: General application status and services statuses.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/GeneralStatus'
          examples:
            application/json:
              data:
                status: "Error"
                message: "some services returned an unknown state (s1), while some other returned errors (s2, s3)"
                checks:
                  - canonical: "s0"
                    category: "internal"
                    status: "Success"
                    message: "no issue reported while connecting to s0"
                  - canonical: "s1"
                    category: "internal"
                    status: "Unknown"
                    message: "unknown state for s1 service"
                  - canonical: "s2"
                    category: "internal"
                    status: "Error"
                    message: "issue detected while connecting to s2"
                  - canonical: "s3"
                    category: "internal"
                    status: "Success"
                    message: "issue detected while connecting to s3"
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/status/{service_status_canonical}':
    get:
      parameters:
        - $ref: '#/parameters/service_status_canonical'
      tags:
        - Cycloid
      description: Get the status of the Cycloid's service. It uses 200 and 500 to also identify the status
      operationId: getServiceStatus
      security: []
      responses:
        '200':
          description: General application status and services statuses.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CheckReport'
          examples:
            application/json:
              data:
                canonical: "s0"
                category: "internal"
                status: "Success"
                message: "no issue reported while connecting to s0"
        '500':
          $ref: '#/responses/unexpected_error'
  /version:
    get:
      tags:
        - Cycloid
      description: Get the version of the Cycloid's API.
      operationId: getAppVersion
      security: []
      responses:
        '200':
          description: Application version.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/AppVersion'
          examples:
            application/json:
              data:
                version: "1.0.0"
                branch: "master"
                revision: "9d3d4d97"
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/api_keys':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/owner_query'
      tags:
        - Organization API keys
      description: Get list of API keys of the organization.
      operationId: getAPIKeys
      responses:
        '200':
          description: List of the API keys which the organization has.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/APIKey'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: "ak-1"
                  name: "AK 1"
                  description: "this is ak-1"
                  role:
                    id: 5
                    name: "Organization API key"
                    description: "Role for API key"
                    policies: []
                  token: "jwt..."
                  id: 5
                  owner:
                    username: user-2
                    id: 10
                    given_name: Mariana
                    family_name: Jimenezo
                    email: mariana.jimenezo@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 42
                      name: "standard role"
                      description: "this is the standard role"
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: 'organization:delete'
                          resources: ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: 'organization:team:create'
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: 'organization:team:read'
                          resources: ["organization:org-can:team:team-can"]
                - canonical: "ak-2"
                  name: "AK 2"
                  description: "this is ak-2"
                  role:
                    id: 5
                    name: "Organization API key"
                    description: "Role for API key"
                    policies: []
                  token: "jwt..."
                  id: 5
                  owner:
                    username: user-3
                    id: 2
                    given_name: Jorge
                    family_name: Hombre
                    email: jorge.hombre@test.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579203'
                    created_at: 1503225001
                    role:
                      id: 42
                      name: "standard role"
                      description: "this is the standard role"
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: 'organization:delete'
                          resources: ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: 'organization:team:create'
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: 'organization:team:read'
                          resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization API keys
      description: Create a new API key in the organization.
      operationId: createAPIKey
      parameters:
        - in: body
          name: body
          description: The information of the API key to create.
          required: true
          schema:
            $ref: '#/definitions/NewAPIKey'
      responses:
        '200':
          description: >-
            API key created. The body contains the information of the new API key
            of the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/APIKey'
          examples:
            application/json:
              data:
                canonical: "ak-1"
                name: "AK 1"
                description: "this is ak-1"
                role:
                  id: 5
                  name: "Organization API key"
                  description: "Role for API key"
                  policies: []
                token: "jwt..."
                id: 5
                owner:
                  username: user-2
                  id: 10
                  given_name: Mariana
                  family_name: Jimenezo
                  email: mariana.jimenezo@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 42
                    name: "standard role"
                    description: "this is the standard role"
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/api_keys/{api_key_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/api_key_canonical'
    get:
      tags:
        - Organization API keys
      description: Get an API key of the organization.
      operationId: getAPIKey
      responses:
        '200':
          description: >-
            The information of the API key of the organization which has the
            specified canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/APIKey'
          examples:
            application/json:
              data:
                canonical: "ak-1"
                name: "AK 1"
                description: "this is ak-1"
                rules:
                  - id: 1
                    effect: "allow"
                    action: 'organization:delete'
                    resources: ["organization:org-can", "organization:org-can2"]
                  - id: 20
                    effect: "allow"
                    action: 'organization:team:create'
                    resources: []
                  - id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
                token: "jwt..."
                id: 5
                owner:
                  username: user-2
                  id: 10
                  given_name: Mariana
                  family_name: Jimenezo
                  email: mariana.jimenezo@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 42
                    name: "standard role"
                    description: "this is the standard role"
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization API keys
      description: Delete an API key of the organization.
      operationId: deleteAPIKey
      responses:
        '204':
          description: API key has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization API keys
      description: >-
        Update the information of an API key of the organization.
        If the API key has some information on the fields which aren't required
        and they are not sent or set to their default values, which depend of their
        types, the information will be removed.
      operationId: updateAPIkey
      parameters:
        - in: body
          name: body
          description: The information of the API key to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateAPIKey'
      responses:
        '200':
          description: >-
            API ey updated. The body contains information of the updated
            API key.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/APIKey'
          examples:
            application/json:
              data:
                canonical: "ak-1"
                name: "AK 1"
                description: "this is ak-1"
                rules:
                  - id: 1
                    effect: "allow"
                    action: 'organization:delete'
                    resources: ["organization:org-can", "organization:org-can2"]
                  - id: 20
                    effect: "allow"
                    action: 'organization:team:create'
                    resources: []
                  - id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
                token: "jwt..."
                id: 5
                owner:
                  username: user-2
                  id: 10
                  given_name: Mariana
                  family_name: Jimenezo
                  email: mariana.jimenezo@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 42
                    name: "standard role"
                    description: "this is the standard role"
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/appearances':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization Appearances
      description: List of appearances available in the organization.
      operationId: listAppearances
      responses:
        '200':
          description: List of appearances which are available in the organization.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Appearance'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: "default"
                  name: "Default"
                  display_name: "Cycloid"
                  tab_title: "Cycloid"
                  color: 
                    r: 28
                    g: 151
                    b: 151
                  logo: "https://console.cycloid.io/static/images/app-logo-square.svg"
                  favicon: "https://console.cycloid.io/static/favicons/favicon.ico"
                  footer: ""
                  is_active: false
                  created_at: 1503225026
                  updated_at: 1503335026
                - canonical: "custom"
                  name: "Custom"
                  display_name: "Brand Name"              
                  tab_title: "Brand Name"              
                  color: 
                    r: 28
                    g: 151
                    b: 151
                  logo: "https://console.cycloid.io/static/images/app-logo-square.svg"
                  favicon: "https://console.cycloid.io/static/favicons/favicon.ico"
                  footer: ""
                  is_active: true
                  created_at: 1503225026
                  updated_at: 1503335026
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the organization's appearance to create.
          required: true
          schema:
            $ref: '#/definitions/NewAppearance'
      tags:
        - Organization Appearances
      description: Create a new appearance for the organization.
      operationId: createAppearance
      responses:
        '200':
          description: New appearance created in the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Appearance'
          examples:
            application/json:
              data:
                display_name: "Brand Name"
                tab_title: "Brand Name"
                color: 
                  r: 0
                  g: 0
                  b: 0
                logo: "https://console.cycloid.io/static/images/app-logo-square.svg"
                favicon: "https://console.cycloid.io/static/favicons/favicon.ico"
                footer: ""
                is_active: false
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/appearances/{appearance_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/appearance_canonical'
    get:
      tags:
        - Organization Appearances
      description: Get the appearance available in the organization with a canonical
      operationId: getAppearance
      responses:
        '200':
          description: Appearance available in the organization with such canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Appearance'
          examples:
            application/json:
              data:
                canonical: "custom"
                name: "Default"
                display_name: "Cycloid"
                tab_title: "Cycloid"
                color: 
                  r: 28
                  g: 151
                  b: 151
                logo: "https://console.cycloid.io/static/images/app-logo-square.svg"
                favicon: "https://console.cycloid.io/static/favicons/favicon.ico"
                footer: ""
                is_active: false
                created_at: 1503225026
                updated_at: 1503335026
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      parameters:
        - in: body
          name: body
          description: The information of the organization's appearance to update.
          required: true
          schema:
            $ref: '#/definitions/Appearance'
      tags:
        - Organization Appearances
      description: Update an existing appearance in the organization.
      operationId: updateAppearance
      responses:
        '200':
          description: Updated appearance belonging to the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Appearance'
          examples:
            application/json:
              data:
                canonical: "custom"
                name: "Custom"
                display_name: "Brand Name"
                tab_title: "Brand Name"
                color: 
                  r: 0
                  g: 0
                  b: 0
                logo: "https://console.cycloid.io/static/images/app-logo-square.svg"
                favicon: "https://console.cycloid.io/static/favicons/favicon.ico"
                footer: ""
                is_active: true
                created_at: 1503225026
                updated_at: 1503335026
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Appearances
      description: Delete an existing appearance in the organization.
      operationId: deleteAppearance
      responses:
        '204':
          description: Organization appearance has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/children':
    get:
      parameters:
        - $ref: '#/parameters/organization_canonical'
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - in: query
          name: organization_name
          type: string
          description: Search by the organization's name
        - in: query
          name: organization_created_at
          type: string
          format: date-time
          description: Search by organization's creation date
        - $ref: '#/parameters/order_by_query'
      tags:
        - Organization Children
      description: Get the children organizations that the authenticated user has access.
      operationId: getChildren
      responses:
        '200':
          description: List of the children organizations which the authenticated user has access.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Organization'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: org1
                  id: 1
                  name: Organization 1
                  blocked: []
                  ci_team_name: asfdOPNljk
                  has_children: true
                  created_at: 1503225026
                  updated_at: 1503335026
                - canonical: org2
                  id: 1
                  name: Organization 2
                  blocked: []
                  ci_team_name: asfdOPNljk
                  has_children: false
                  created_at: 1501131026
                  updated_at: 1503333026
                - canonical: org3
                  id: 1
                  name: Organization 3
                  blocked: []
                  ci_team_name: asfdOPNljk
                  has_children: false
                  created_at: 1500135021
                  updated_at: 1503332021
              pagination:
                index: 1
                size: 10
                total: 3
        '422':
          $ref: '#/responses/unprocessable_entity'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization Children
      description: >-
        Create a new organization child, making the authenticated user the owner of
        it.
      operationId: createChild
      parameters:
        - $ref: '#/parameters/organization_canonical'
        - in: body
          name: body
          description: The information of the organization to create.
          required: true
          schema:
            $ref: '#/definitions/NewOrganization'
      responses:
        '200':
          description: >-
            Organization created. The body contains the information of the new
            created organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Organization'
          examples:
            application/json:
              data:
                id: 1
                canonical: org1
                name: Organization 1
                blocked: []
                ci_team_name: asfdOPNljk
                created_at: 1503225026
                updated_at: 1503335026
  '/organizations/{organization_canonical}/cloud_cost_management':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/cost_granularity_filter'
        - $ref: '#/parameters/cost_begin_filter'
        - $ref: '#/parameters/cost_end_filter'
        - $ref: '#/parameters/cost_currency_filter'
  
        - $ref: '#/parameters/cost_projects_filter'
        - $ref: '#/parameters/cost_linked_accounts_filter'
        - $ref: '#/parameters/cost_master_accounts_filter'
        - $ref: '#/parameters/cost_record_type_filter'
      tags:
        - Organization Cloud Cost Management Dashboard
      description: |
        Return the dashboard of the Cloud Cost Management. It contains one histogram per 
        cloud provider, five top projects, the list of projects resources 
        aggregated by cloud provider and the cost of the new resource in the 
        period.
      operationId: getCloudCostManagementDashboard
      responses:
        '200':
          description: Cloud Cost Management dashboard.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementDashboard'
          examples:
            application/json:
              data:
                providers:
                  cost: 400
                  buckets:
                    - cost: 300
                      value: aws
                      buckets:
                        - cost: 170
                          value: 2021-03
                        - cost: 130
                          value: 2021-04
                    - cost: 100
                      value: google
                      buckets:
                        - cost: 40
                          value: 2021-03
                        - cost: 60
                          value: 2021-04
                projects:
                  cost: 300
                  buckets:
                    - cost: 100
                      value: 2021-03
                      buckets:
                        - cost: 50
                          value: proj1
                        - cost: 50
                          value: proj2
                    - cost: 200
                      value: 2021-04
                      buckets:
                        - cost: 150
                          value: proj1
                        - cost: 50
                          value: proj2
                resources:
                  - project: proj1
                    providers:
                      - provider: aws
                        resources: 12
                        new_resources: 10
                      - provider: google
                        resources: 23
                        new_resources: 7
                  - project: proj2
                    providers:
                      - provider: aws
                        resources: 7
                        new_resources: 4
                filter_values:
                    providers: [aws, gcp]
                    projects: [proj1, proj2]
                    currencies: [USD, EUR]
                    tags: 
                      key1: ["value1", "value2"]
                      key2: ["value1", "value2", "value3"]
                      key3: ["value1"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/filter_values':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/cost_begin_filter'
        - $ref: '#/parameters/cost_end_filter'
        - $ref: '#/parameters/cost_projects_filter'
        - $ref: '#/parameters/cost_environments_filter'
        - $ref: '#/parameters/cost_services_filter'
        - $ref: '#/parameters/cost_tag_key_value_filter'
        - $ref: '#/parameters/cost_categories_filter'
        - $ref: '#/parameters/cost_master_accounts_filter'
        - $ref: '#/parameters/cost_linked_accounts_filter'
        - $ref: '#/parameters/cost_regions_filter'
        - $ref: '#/parameters/cost_resource_tagging_filter'
        - $ref: '#/parameters/cost_group_by_filter'
        - $ref: '#/parameters/cost_dashboard_filter_values'
      tags:
        - Organization Cloud Cost Management filter vaules
      description: Return a map with all the possible filter vaules 
      operationId: getCloudCostManagementFilterVaules
      responses:
        '200':
          description: |
            Cloud Cost Management histogram for a period of time and a single provider.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementFilterValues'
          examples:
            application/json:
              data:
                  projects: [proj1, proj2]
                  linked_account: [acc1, acc2]
                  regions: [us-east-1, eu-west-1]
                  components: [storage, compute, containers]
                  tags: 
                    key1: ["value1", "value2"]
                    key2: ["value1", "value2", "value3"]
                    key3: ["value1"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/projects':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/cost_granularity_filter'
        - $ref: '#/parameters/cost_begin_filter'
        - $ref: '#/parameters/cost_end_filter'
        - $ref: '#/parameters/cost_currency_filter'
  
        - $ref: '#/parameters/cost_projects_filter'
        - $ref: '#/parameters/cost_linked_accounts_filter'
        - $ref: '#/parameters/cost_master_accounts_filter'
      tags:
        - Organization Cloud Cost Management Projects Dashboard
      description: |
        Return the projects dashboard of the Cloud Cost Management. 
        It contains one date histogram with the aggregation by project,
        and a histogram with the aggregation by project and provider.
      operationId: getCloudCostManagementProjectsDashboard
      responses:
        '200':
          description: Cloud Cost Management dashboard.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementProjectsDashboard'
          examples:
            application/json:
              data:
                projects:
                  cost: 300
                  buckets:
                    - cost: 100
                      value: 2021-03
                      buckets:
                        - cost: 50
                          value: proj1
                        - cost: 50
                          value: proj2
                    - cost: 200
                      value: 2021-04
                      buckets:
                        - cost: 150
                          value: proj1
                        - cost: 50
                          value: proj2
                project_providers:
                  - project: proj1
                    providers:
                      - provider: 
                        - aws:
                          cost: 50
                        - google:
                          cost: 10
                  - project: proj2
                    providers:
                      - provider: 
                        - azure:
                          cost: 50
                        - google:
                          cost: 10
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/{provider_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
    get:
      parameters:
        - $ref: '#/parameters/cost_granularity_filter'
        - $ref: '#/parameters/cost_begin_filter'
        - $ref: '#/parameters/cost_end_filter'
        - $ref: '#/parameters/cost_currency_filter'
      
        - $ref: '#/parameters/cost_projects_filter'
        - $ref: '#/parameters/cost_environments_filter'
        - $ref: '#/parameters/cost_services_filter'
        - $ref: '#/parameters/cost_tag_key_value_filter'
        - $ref: '#/parameters/cost_categories_filter'
        - $ref: '#/parameters/cost_master_accounts_filter'
        - $ref: '#/parameters/cost_linked_accounts_filter'
        - $ref: '#/parameters/cost_regions_filter'
        - $ref: '#/parameters/cost_resource_tagging_filter'
        - $ref: '#/parameters/cost_group_by_filter'
        - $ref: '#/parameters/cost_record_type_filter'
      tags:
        - Organization Cloud Cost Management Provider Histograms
      description: Return a histogram of the costs generated in a given period aggregated by time granularity and other terms, for a single provider.
      operationId: getCloudCostManagementProvider
      responses:
        '200':
          description: |
            Cloud Cost Management histogram for a period of time and a single provider.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementProviderDetails'
          examples:
            application/json:
              data:
                cost: 200
                buckets:
                  - cost: 100
                    value: 2021-03
                    buckets:
                      - cost: 50
                        value: us-est-1
                        buckets:
                          - cost: 25
                            value: storage
                          - cost: 25
                            value: compute
                      - cost: 50
                        value: us-est-2
                        buckets:
                          - cost: 20
                            value: storge
                          - cost: 30
                            value: compute
                  - cost: 100
                    value: 2021-04
                    buckets:
                      - cost: 70
                        value: us-est-1
                        buckets:
                          - cost: 50
                            value: storage
                          - cost: 20
                            value: compute
                      - cost: 30
                        value: us-est-2
                        buckets:
                          - cost: 15
                            value: storage
                          - cost: 15
                            value: compute
                filter_values:
                  projects: [proj1, proj2]
                  linked_account: [acc1, acc2]
                  regions: [us-east-1, eu-west-1]
                  components: [storage, compute, containers]
                  tags: 
                    key1: ["value1", "value2"]
                    key2: ["value1", "value2", "value3"]
                    key3: ["value1"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/providers/{provider_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/provider_canonical'
    get:
      parameters:
        - $ref: '#/parameters/cost_granularity_filter'
        - $ref: '#/parameters/cost_begin_filter'
        - $ref: '#/parameters/cost_end_filter'
        - $ref: '#/parameters/cost_currency_filter'
        - $ref: '#/parameters/cost_projects_filter'
        - $ref: '#/parameters/cost_environments_filter'
        - $ref: '#/parameters/cost_services_filter'
        - $ref: '#/parameters/cost_tag_key_value_filter'
        - $ref: '#/parameters/cost_categories_filter'
        - $ref: '#/parameters/cost_master_accounts_filter'
        - $ref: '#/parameters/cost_linked_accounts_filter'
        - $ref: '#/parameters/cost_regions_filter'
        - $ref: '#/parameters/cost_resource_tagging_filter'
        - $ref: '#/parameters/cost_group_by_filter'
        - $ref: '#/parameters/cost_record_type_filter'
      tags:
        - Organization Cloud Cost Management Provider Details
      description: Return a histogram of the costs generated in a given period aggregated by time granularity and other terms, for a single provider.
      operationId: getCloudCostManagementProviderDetails
      responses:
        '200':
          description: |
            Cloud Cost Management histogram for a period of time and a single provider.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementHistogram'
          examples:
            application/json:
              data:
                cost: 200
                buckets:
                  - cost: 100
                    value: 2021-03
                    buckets:
                      - cost: 50
                        value: us-est-1
                        buckets:
                          - cost: 25
                            value: storage
                          - cost: 25
                            value: compute
                      - cost: 50
                        value: us-est-2
                        buckets:
                          - cost: 20
                            value: storge
                          - cost: 30
                            value: compute
                  - cost: 100
                    value: 2021-04
                    buckets:
                      - cost: 70
                        value: us-est-1
                        buckets:
                          - cost: 50
                            value: storage
                          - cost: 20
                            value: compute
                      - cost: 30
                        value: us-est-2
                        buckets:
                          - cost: 15
                            value: storage
                          - cost: 15
                            value: compute
                filter_values:
                  projects: [proj1, proj2]
                  linked_account: [acc1, acc2]
                  regions: [us-east-1, eu-west-1]
                  components: [storage, compute, containers]
                  tags: 
                    key1: ["value1", "value2"]
                    key2: ["value1", "value2", "value3"]
                    key3: ["value1"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/providers':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/cost_granularity_filter'
        - $ref: '#/parameters/cost_begin_filter'
        - $ref: '#/parameters/cost_end_filter'
        - $ref: '#/parameters/cost_currency_filter'
  
        - $ref: '#/parameters/cost_projects_filter'
        - $ref: '#/parameters/cost_linked_accounts_filter'
        - $ref: '#/parameters/cost_master_accounts_filter'
      tags:
        - Organization Cloud Cost Management Provider Histograms
      description: Return a histogram of the costs generated in a given period aggregated by time granularity and other terms, for a single provider.
      operationId: getCloudCostManagementProviders
      responses:
        '200':
          description: |
            Cloud Cost Management histogram for a period of time and a single provider.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementProviders'
          examples:
            application/json:
              data:
                - gcp:
                  cost: 200
                  buckets:
                    - cost: 100
                      value: 2021-03
                      buckets:
                        - cost: 50
                          value: us-est-1
                          buckets:
                            - cost: 25
                              value: storage
                            - cost: 25
                              value: compute
                        - cost: 50
                          value: us-est-2
                          buckets:
                            - cost: 20
                              value: storge
                            - cost: 30
                              value: compute
                    - cost: 100
                      value: 2021-04
                      buckets:
                        - cost: 70
                          value: us-est-1
                          buckets:
                            - cost: 50
                              value: storage
                            - cost: 20
                              value: compute
                        - cost: 30
                          value: us-est-2
                          buckets:
                            - cost: 15
                              value: storage
                            - cost: 15
                              value: compute
                - aws:
                  cost: 200
                  buckets:
                    - cost: 100
                      value: 2021-03
                      buckets:
                        - cost: 50
                          value: us-est-1
                          buckets:
                            - cost: 25
                              value: storage
                            - cost: 25
                              value: compute
                        - cost: 50
                          value: us-est-2
                          buckets:
                            - cost: 20
                              value: storge
                            - cost: 30
                              value: compute
                    - cost: 100
                      value: 2021-04
                      buckets:
                        - cost: 70
                          value: us-est-1
                          buckets:
                            - cost: 50
                              value: storage
                            - cost: 20
                              value: compute
                        - cost: 30
                          value: us-est-2
                          buckets:
                            - cost: 15
                              value: storage
                            - cost: 15
                              value: compute
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/tags':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organization Cloud Cost Management
      description: Return a list of tags used in Cloud Cost Management records.
      operationId: getCloudCostManagementTags
      responses:
        '200':
          description: List of Cloud Cost Management records' tags.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  type: string
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/accounts':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/cloud_cost_management_account_created_at_query'
        - $ref: '#/parameters/order_by_query'
      tags:
        - Organization Cloud Cost Management Accounts
      description: Return a list of Cloud Cost Management accounts which matches the scope specified by the filter.
      operationId: getCloudCostManagementAccounts
      responses:
        '200':
          description: List of Cloud Cost Management accounts.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/CloudCostManagementAccount'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                last_ingestion_ended_at: 1503335026
                account_id: account_id
                canonical: my-cloud-cost-management-account
                name: My AWS Cloud Cost Managment account
                external_backend:
                  credential_canonical: credential
                  purpose: cost_explorer
                  configuration:
                    engine: AWSStorage
                    region: eu-west1
                    bucket: b
                    key: k
                cloud_provider:
                  canonical: aws
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization Cloud Cost Management Accounts
      description: Create a new Cloud Cost Management account.
      operationId: createCloudCostManagementAccount
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/NewCloudCostManagementAccount'
      responses:
        '200':
          description: >-
            The new Cloud Cost Management account created.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementAccount'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                last_ingestion_ended_at: 1503335026
                account_id: account_id
                canonical: my-cloud-cost-management-account
                name: My AWS Cloud Cost Managment account
                external_backend:
                  credential_canonical: credential
                  purpose: cost_explorer
                  configuration:
                    engine: AWSStorage
                    region: eu-west1
                    bucket: b
                    key: k
                cloud_provider:
                  canonical: aws
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/accounts/has_parent':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/credential_canonical_query'
    get:
      tags:
        - Organization Cloud Cost Management Accounts
      description: Return whether account under provided credentials is a child account
      operationId: getCloudCostManagementAccountsHasParent
      responses:
        '200':
          description: CE Account of the parent
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementAccountParent'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/child-accounts':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      tags:
        - Organization Cloud Cost Management Accounts
      description: Create a new Cloud Cost Management account.
      operationId: createCloudCostManagementAccountChild
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/NewCloudCostManagementAccountChild'
      responses:
        '200':
          description: >-
            The new Cloud Cost Management account created.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementAccount'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                last_ingestion_ended_at: 1503335026
                account_id: account_id
                canonical: my-cloud-cost-management-account
                credential_canonical: this-credential-is-cool
                parent_account_id: 123456-78900
        
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/accounts/{cloud_cost_management_account_canonical}/linked_accounts':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/cloud_cost_management_account_canonical'
    get:
      tags:
        - Organization Cloud Cost Management Accounts
      description: Return a list of cloud provider accounts linked to a specific Cloud Cost Management account.
      operationId: getCloudCostManagementLinkedAccounts
      responses:
        '200':
          description: List of linked accounts of a Cloud Cost Management account.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/CloudCostManagementLinkedAccount'
          examples:
            application/json:
              data:
                - id: 102
                  name: A linked account
                  account_id: "xxxxxx-xxxxxx-xxxxxxx"
                  cloud_provider: aws
                - id: 109
                  name: Another linked account
                  account_id: "yyyyyy-yyyyyy-yyyyyyy"
                  cloud_provider: aws
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/cloud_cost_management/accounts/{cloud_cost_management_account_canonical}/linked_accounts/{cloud_provider_account_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/cloud_cost_management_account_canonical'
      - $ref: '#/parameters/cloud_provider_account_id'
    put:
      tags:
        - Organization Cloud Cost Management Accounts
      description: Update a Cloud Cost Management linked account
      operationId: updateCloudCostManagementLinkedAccount
      parameters:
        - in: body
          name: body
          description: The updated attributes of the Cloud Cost Management linked account
          required: true
          schema:
            $ref: '#/definitions/UpdateCloudCostManagementLinkedAccount'
      responses:
        '200':
          description: Updated Cloud Cost Management linked account
          schema:
            $ref: '#/definitions/CloudCostManagementLinkedAccount'
          examples:
            application/json:
              data:
                id: 99
                name: Updated linked account name
                account_id: "123456789"
                cloud_provider: aws
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/accounts/{cloud_cost_management_account_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/cloud_cost_management_account_canonical'
    get:
      tags:
        - Organization Cloud Cost Management Accounts
      description: Get the information of the CloudCostManagementAccount.
      operationId: getCloudCostManagementAccount
      responses:
        '200':
          description: The information of the CloudCostManagementAccount which has the specified canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementAccount'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                last_ingestion_ended_at: 1503335026
                account_id: account_id
                canonical: my-cloud-cost-management-account
                external_backend:
                  credential_canonical: credential
                  purpose: cost_explorer
                  configuration:
                    engine: AWSStorage
                    region: eu-west1
                    bucket: b
                    key: k
                cloud_provider:
                  canonical: aws
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Cloud Cost Management Accounts
      description: Delete the CloudCostManagementAccount.
      operationId: deleteCloudCostManagementAccount
      responses:
        '204':
          description: CloudCostManagementAccount has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization Cloud Cost Management Accounts
      description: >-
        Update an existing CloudCostManagementAccount
      operationId: updateCloudCostManagementAccount
      parameters:
        - in: body
          name: body
          description: The information of the organization to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateCloudCostManagementAccount'
      responses:
        '200':
          description: CloudCostManagementAccount updated.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementAccount'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                last_ingestion_ended_at: 1503335026
                account_id: account_id
                canonical: my-cloud-cost-management-account
                external_backend:
                  credential_canonical: credential
                  purpose: cost_explorer
                  configuration:
                    engine: AWSStorage
                    region: eu-west1
                    bucket: b
                    key: k
                cloud_provider:
                  canonical: aws
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_cost_management/tag_mapping':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organization Cloud Cost Management Tag Mappings
      description: Return the Cloud Cost Management tag mapping for the organization
      operationId: getCloudCostManagementTagMapping
      responses:
        '200':
          description: The CloudCostManagementTagMapping for the organization
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementTagMapping'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                project_tags: ["proj", "project"]
                project_regex: '^Project$'
                environment_tags: ["env", "environment"]
                environment_regex: '^Environment$'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization Cloud Cost Management Tag Mappings
      description: Create or Update a Cloud Cost Management Tag Mapping.
      operationId: putCloudCostManagementTagMapping
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/UpdateCloudCostManagementTagMapping'
      responses:
        '200':
          description: >-
            The new or updated Cloud Cost Management Tag Mapping
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CloudCostManagementTagMapping'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                project_tags: ["proj", "project"]
                project_regex: '^Project$'
                environment_tags: ["env", "environment"]
                environment_regex: '^Environment$'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cloud_providers':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Cloud providers
      description: Get the list of Cloud Providers
      operationId: getCloudProviders
      responses:
        '200':
          description: List of Cloud Providers
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/CloudProvider'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 1
                  canonical: 'aws'
                  abbreviation: 'AWS'
                  name: 'Amazon Web Services'
                  regions: ["af-south-1", "eu-west-2", "us-east-1", "us-east-2"]
                - id: 2
                  canonical: 'google'
                  abbreviation: 'GCP'
                  name: 'Google Cloud Platform'
                - id: 3
                  canonical: 'azurerm'
                  abbreviation: 'Azure'
                  name: 'Azure'
                  regions: ["asia", "asiapacific", "australia", "australiacentral"]
                - id: 4
                  canonical: 'flexibleengine'
                  abbreviation: 'FlexibleEngine'
                  name: 'Flexible Engine'
                - id: 5
                  canonical: 'openstack'
                  abbreviation: 'OpenStack'
                  name: 'OpenStack'
                - id: 6
                  canonical: 'scaleway'
                  abbreviation: 'Scaleway'
                  name: 'Scaleway'
                - id: 7
                  canonical: 'vmware'
                  abbreviation: 'VMware'
                  name: 'VMware'
                - id: 8
                  canonical: 'ovh'
                  abbreviation: 'OVH'
                  name: 'OVH Cloud'
                - id: 9
                  canonical: 'alibaba'
                  abbreviation: 'Alibaba'
                  name: 'Alibaba Cloud'
                - id: 10
                  canonical: 'oracle'
                  abbreviation: 'OCI'
                  name: 'Oracle Cloud Infrastructure'
              pagination:
                index: 1
                size: 10
                total: 2
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/config_repositories':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/default'
      tags:
        - Organization Config Repositories
      description: Return all the config repositories
      operationId: listConfigRepositories
      responses:
        '200':
          description: List of the config repositories.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/ConfigRepository'
          examples:
            application/json:
              data:
                - id: 1
                  canonical: my-personal-repo
                  name: My personal repo
                  url: 'git@github.com:myuser/repository.git'
                  branch: 'configs'
                  default: true
                  created_at: 1503225026
                  updated_at: 1503335026
                - id: 2
                  canonical: my-personal-repo2
                  name: My personal repo 2
                  url: 'git@github.com:myuser/repository.git'
                  branch: 'configs'
                  default: false
                  created_at: 1503225026
                  updated_at: 1503335026
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization Config Repositories
      parameters:
        - in: body
          name: body
          description: The information of the config repository to create.
          required: true
          schema:
            $ref: '#/definitions/NewConfigRepository'
      description: Creates a config repository
      operationId: createConfigRepository
      responses:
        '200':
          description: Success creation
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ConfigRepository'
          examples:
            application/json:
              data:
                id: 1
                name: My personal repo
                url: 'git@github.com:myuser/repository.git'
                canonical: my-personal-repo
                branch: 'configs'
                default: true
                credential_id: 1
                created_at: 1503225026
                updated_at: 1503335026
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/config_repositories/{config_repository_canonical}/config':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/config_repository_canonical'
    post:
      tags:
        - Organization Config Repositories
      description: Create Service Catalog config files in the Config Repository.
      operationId: createConfigRepositoryConfig
      parameters:
        - in: body
          name: body
          description: >
            The body contains Service Catalog's config files and paths where
            they'll be created in the Config Repository.
          required: true
          schema:
            $ref: '#/definitions/SCConfig'
      responses:
        '204':
          description: SC config files have been created successfully
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/config_repositories/{config_repository_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/config_repository_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization Config Repositories
      description: Return the Config Repository
      operationId: getConfigRepository
      responses:
        '200':
          description: Organization Config Repository.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ConfigRepository'
          examples:
            application/json:
              data:
                id: 1
                canonical: my-personal-repo
                name: My personal repo
                url: 'git@github.com:myuser/repository.git'
                branch: 'configs'
                default: true
                created_at: 1503225026
                updated_at: 1503335026
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization Config Repositories
      description: Update a config repository
      operationId: updateConfigRepository
      parameters:
        - in: body
          name: body
          description: The information of the config repository to create.
          required: true
          schema:
            $ref: '#/definitions/UpdateConfigRepository'
      responses:
        '200':
          description: Success creation
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ConfigRepository'
          examples:
            application/json:
              data:
                id: 1
                canonical: my-personal-repo
                name: My personal repo
                url: 'git@github.com:myuser/repository.git'
                branch: 'configs'
                default: true
                credential_id: 1
                created_at: 1503225026
                updated_at: 1503335026
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Config Repositories
      description: delete a Config Repositories
      operationId: deleteConfigRepository
      responses:
        '204':
          description: Organization Config repository has been deleted
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/cost_estimation/tfplan':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      tags:
        - Cost Estimation
      description: Estimate costs of a Terraform plan in JSON format.
      operationId: costEstimateTfPlan
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/TerraformPlanInput'
      responses:
        '200':
          description: The result of estimating the costs of a Terraform plan.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CostEstimationResult'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/credentials':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/credential_type_query'
        - $ref: '#/parameters/credential_types_query'        
      tags:
        - Organization Credentials
      description: Return all the Credentials, depending on the caller
        permissions it'll return the Raw data or not. If the caller
        has List and not Get it'll not return the Raw, if it has
        List and Read it'll return the Raw.
      operationId: listCredentials
      responses:
        '200':
          description: List of the Credentials
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/CredentialSimple'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 1
                  canonical: name-key1
                  name: name-key
                  type: ssh
                  path: my/path
                  raw:
                    ssh_key: key
                  created_at: 1503225026
                  updated_at: 1503335026
                  owner:
                    username: user-2
                    id: 10
                    given_name: Mariana
                    family_name: Jimenezo
                    email: mariana.jimenezo@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 42
                      name: "standard role"
                      description: "this is the standard role"
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: 'organization:delete'
                          resources: ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: 'organization:team:create'
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: 'organization:team:read'
                          resources: ["organization:org-can:team:team-can"]
                - id: 2
                  canonical: name-key2
                  name: name-key
                  type: ssh
                  path: my/path
                  raw:
                    ssh_key: key
                  created_at: 1503225026
                  updated_at: 1503335026
                  owner:
                    username: user-2
                    id: 10
                    given_name: Mariana
                    family_name: Jimenezo
                    email: mariana.jimenezo@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 42
                      name: "standard role"
                      description: "this is the standard role"
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: 'organization:delete'
                          resources: ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: 'organization:team:create'
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: 'organization:team:read'
                          resources: ["organization:org-can:team:team-can"]
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization Credentials
      description: >-
        Create a new Credential, based on the type you will have to pass different
        parameters within the body:
  
        * ssh: ssh_key
  
        * aws: access_key, secret_key
  
        * gcp: json_key
  
        * azure: client_id, client_secret, subscription_id, tenant_id
  
        * azure_storage: account_name, access_key
  
        * basic_auth: username, password
  
        * elasticsearch: username, password, ca_cert
  
        * swift: auth_url, username, password, domain_id, tenant_id
  
        * vmware: username, password
      operationId: createCredential
      parameters:
        - in: body
          name: body
          description: The information of the organization to create.
          required: true
          schema:
            $ref: '#/definitions/NewCredential'
      responses:
        '200':
          description: >-
            Credential created. The body contains the information of the new
            created Credential.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Credential'
          examples:
            application/json:
              data:
                id: 2
                canonical: name-key
                name: name-key
                type: ssh
                path: my/path
                raw:
                  ssh_key: key
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/credentials/{credential_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/credential_canonical'
    get:
      tags:
        - Organization Credentials
      description: Get the information of the Credential.
      operationId: getCredential
      responses:
        '200':
          description: The information of the Credential which has the specified ID.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Credential'
          examples:
            application/json:
              data:
                id: 2
                canonical: name-key
                name: name-key
                type: ssh
                path: my/path
                raw:
                  ssh_key: key
                owner:
                  username: user-2
                  id: 10
                  given_name: Mariana
                  family_name: Jimenezo
                  email: mariana.jimenezo@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 42
                    name: "standard role"
                    description: "this is the standard role"
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Credentials
      description: Delete the Credential.
      operationId: deleteCredential
      responses:
        '204':
          description: Credential has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '409':
          description: Credential deletion has internal conflict
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization Credentials
      description: >-
        Update an existing Credential, based on the type you will have to pass different
        parameters within the body:
  
        * ssh: ssh_key
  
        * aws: access_key, secret_key
  
        * gcp: json_key
  
        * azure: client_id, client_secret, subscription_id, tenant_id
  
        * azure_storage: account_name, access_key
  
        * basic_auth: username, password
  
        * elasticsearch: username, password, ca_cert
  
        * swift: auth_url, username, password, domain_id, tenant_id
  
        * vmware: username, password
      operationId: updateCredential
      parameters:
        - in: body
          name: body
          description: The information of the organization to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateCredential'
      responses:
        '200':
          description: Credential updated.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Credential'
          examples:
            application/json:
              data:
                id: 2
                canonical: name-key
                name: name-key
                type: ssh
                path: my/path
                raw:
                  ssh_key: key
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/credentials/{credential_canonical}/options':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/credential_canonical'
      - $ref: '#/parameters/credential_options_service_query'
    get:
      tags:
        - Organization Credentials
      description: Get options of the Credential.
      operationId: getCredentialOptions
      responses:
        '200':
          description: Service-specific options for the Credential with the specified ID.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                description: >- 
                  The credential options. The shape of the items could be anything, 
                  since each service can have very different options.
          examples:
            application/json:
              data:
                projects:
                  - id: cycloid-xxx
                    datasets:
                    - id: all_billing_data
                      tables:
                      - id: cloud_pricing_export
                      - id: gcp_billing_export_resource_v1_GOOGLE_CLOUD_ACCOUNT_ID
                      - id: gcp_billing_export_v1_GOOGLE_CLOUD_ACCOUNT_ID
                  - id: cycloid-demo
                    datasets: []
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/environments':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organization Environments
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      description: Get all the environments of the Organization
      operationId: getEnvironments
      responses:
        '200':
          description: Returns all the Environments
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Environment'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 2
                  canonical: 'staging'
                  created_at: 1503225026
                  updated_at: 1503335026
                - id: 3
                  canonical: 'dev'
                  created_at: 1503225026
                  updated_at: 1503335026
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/events':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/timestamp_range_begin_query_ms'
        - $ref: '#/parameters/timestamp_range_end_query_ms'
        - $ref: '#/parameters/event_type'
        - $ref: '#/parameters/event_severity'
      tags:
        - Organizations
      description: >-
        Retrieve the list of events which has been registered on the organization.
        The events to request can be filtered using Unix timestamps in
        milliseconds (begin and end timestamps range), the event type and
        severity; when more than one are applied then they are applied with a
        logical AND.
  
        - The Unix timestamps must always be specified, the rest of the filters
          are not mandatory.
      operationId: getEvents
      responses:
        '200':
          description: >-
            The list of events which fulfills the query parameters filter
          schema:
            type: object
            description: The list of log lines
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Event'
          examples:
            application/json:
              data:
                - timestamp: 0123456789
                  id: 42
                  type: Cycloid
                  title: A build has been created
                  message: Cyclobot created the build cleanup-deployment#42 of pipeline awesome-project-pr_1337
                  icon: fa-info-circle
                  severity: info
                  tags:
                    - key: action
                      value: create
                    - key: entity
                      value: build
                    - key: name
                      value: awesome-project-pr_1337/cleanup-deployment
                    - key: user
                      value: cyclobot
                - timestamp: 0123456795
                  id: 2
                  title: Success deployment of awesome-project version 1.1.93-rc.5 on staging environment
                  type: Custom
                  message: A new deployment of awesome-project version 1.1.93-rc.5 has been done on staging environment
                  severity: info
                  icon: fa-info-circle
                  tags:
                    - key: env
                      value: staging
                    - key: project
                      value: awesome-project
                - timestamp: 0123456810
                  id: 3
                  type: Monitoring
                  title: Nodes are overloaded
                  message: Kubernetes nodes of the deployment awesome-project are under heavy load
                  severity: warn
                  tags:
                    - key: Name
                      value: my-mum-kubernetes-prod
                    - key: UUID
                      value: 3ec0a46e-435e-4c5e-989b-02179efb49b5
                    - key: alertname
                      value: K8SNodeDiskPressure
                    - key: condition
                      value: DiskPressure
                    - key: customer
                      value: awesome-customer
                    - key: env
                      value: prod
                    - key: instance
                      value: 172.30.12.2338080
                    - key: job
                      value: kube-state-metrics
                    - key: node
                      value: ip-127-0-0-1.eu-west-1.compute.internal
                    - key: project
                      value: kubernetes
                    - key: receiver
                      value: on_call
                    - key: service
                      value: k8s
                    - key: severity
                      value: warning
                    - key: status
                      value: false
                - timestamp: 0123456823
                  id: 5
                  type: AWS
                  title: AWS created
                  message: A new AWS instance has been created
                  icon: fa-aws
                  severity: info
                  tags:
                    - key: env
                      value: testing
                    - key: project
                      value: awesome-project
                - timestamp: 0123456834
                  id: 7
                  type: AWS
                  title: AWS is ready
                  message: A new AWS instance is ready to accept requests
                  icon: fa-aws
                  severity: info
                  tags:
                    - key: env
                      value: testing
                    - key: project
                      value: secret-project
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organizations
      description: Send a event on the organization to be registered.
      operationId: sendEvent
      parameters:
        - in: body
          name: body
          description: The information associated with the event to register.
          required: true
          schema:
            $ref: '#/definitions/NewEvent'
      responses:
        '200':
          description: Event has been registered
          schema:
            type: object
            description: The newly created event
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Event'
          examples:
            application/json:
              data:
                - timestamp: 0123456789
                  type: Cycloid
                  title: New member added
                  message: A new member has been added to the project Website
                  icon: fa-info-circle
                  severity: info
                  tags:
                    - key: project_canonical
                      value: website
                    - key: environment_canonical
                      value: development
                    - key: user
                      value: batman
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
  '/organizations/{organization_canonical}/events/tags':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organizations
      description: >-
        Retrieve the list of tags and set of values for all the events of the organization.
      operationId: getEventsTags
      responses:
        '200':
          description: >-
            The list of tags and set of values for all the events of the organization.
          schema:
            type: object
            description: The list of tags with associated set of values
            required:
              - data
            properties:
              data:
                type: object
          examples:
            application/json:
              data:
                user: ['cycloidbot', 'geralt-of-rivia']
                env: ['prod', 'staging', 'testing']
                action: ['create', 'delete', 'update']
                project: ['awesome-project', 'pet-project', 'secret-project']
                entity: ['build', 'pipeline']
                name: ['awesome-project-pr_1337', 'awesome-project-pr_42']
                customer: ['awesome-customer', 'cycloid']
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/external_backends':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical_query'
      - $ref: '#/parameters/environment_canonical_query'
      - $ref: '#/parameters/external_backend_default_query'
    get:
      tags:
          - Organization External Backends
      description: Get the list of organization external backends
      operationId: getExternalBackends
      responses:
        '200':
          description: The list of the external backends
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/ExternalBackend'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 1
                  project_canonical: project1
                  credential_id: 1
                  purpose: 'logs'
                  configuration:
                    engine: AWSCloudWatchLogs
                    region: eu-west1
                  created_at: 1503225026
                  updated_at: 1503335026                  
                - id: 2
                  project_canonical: project2
                  credential_id: 2
                  purpose: 'logs'
                  configuration:
                    engine: AWSCloudWatchLogs
                    region: eu-west1
                  created_at: 1503225026
                  updated_at: 1503335026                  
                - id: 3
                  project_canonical: project1
                  environment_canonical: envA
                  credential: 3
                  purpose: 'remote_tfstate'
                  configuration:
                    engine: AWSStorage
                    region: eu-west1
                    bucket: mybucket
                    key: /my/key
                  created_at: 1503225026
                  updated_at: 1503335026                  
                - id: 4
                  project_canonical: project2
                  environment_canonical: envA
                  credential: 4
                  purpose: 'logs'
                  configuration:
                    engine: AWSStorage
                    container: mycontainer
                    blob: /my/blob
                  created_at: 1503225026
                  updated_at: 1503335026                  
                - id: 5
                  project_canonical: project2
                  environment_canonical: envB
                  credential_id: 5
                  purpose: 'remote_tfstate'
                  configuration:
                    engine: GCPStorage
                    bucket: mybucket
                    object: /my/object
                  created_at: 1503225026
                  updated_at: 1503335026                  
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization External Backends
      description: Save information about the external backend
      operationId: createExternalBackend
      parameters:
        - in: body
          name: body
          description: The information of the external backend
          required: true
          schema:
            $ref: '#/definitions/NewExternalBackend'
      responses:
        '200':
          description: external backend has been registered
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ExternalBackend'
          examples:
            application/json:
              data:
                id: 1
                project_canonical: project1
                credential_id: 1
                purpose: 'logs'
                configuration:
                  engine: AWSCloudWatchLogs
                  region: eu-west1
                created_at: 1503225026
                updated_at: 1503335026              
  '/organizations/{organization_canonical}/external_backends/{external_backend_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/external_backend_id'
    get:
      tags:
        - Organization External Backends
      description: Get the external backend
      operationId: getExternalBackend
      responses:
        '200':
          description: The external backend
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ExternalBackend'
          examples:
            application/json:
              data:
                id: 1
                project_canonical: project1
                credential_id: 1
                purpose: 'logs'
                configuration:
                  engine: AWSCloudWatchLogs
                created_at: 1503225026
                updated_at: 1503335026                
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization External Backends
      description: Update an External Backend
      operationId: updateExternalBackend
      parameters:
        - in: body
          name: body
          description: The information of the external backend new data
          required: true
          schema:
            $ref: '#/definitions/UpdateExternalBackend'
      responses:
        '200':
          description: Success update
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ExternalBackend'
          examples:
            application/json:
              data:
                id: 1
                project_canonical: project1
                credential_id: 1
                purpose: 'logs'
                configuration:
                  engine: AWSCloudWatchLogs
                  region: eu-west1
                created_at: 1503225026
                updated_at: 1503335026                
        '411':
          $ref: '#/responses/required_content_length_header'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization External Backends
      description: delete an External Backend
      operationId: deleteExternalBackend
      responses:
        '204':
          description: Organization Service Catalog Sources has been deleted
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/forms/config':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the filled forms for a new project.
          required: true
          schema:
            $ref: '#/definitions/FormInputs'
      tags:
        - Organization Forms
      description: Generate a set of configs based on the forms inputs
      operationId: createFormsConfig
      responses:
        '200':
          description: Set of config to create the project / push onto repositories
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: object
          examples:
            application/json:
              data:
                prod:
                  pipeline:
                    pipeline:
                      path: "pipeline/magento.yml"
                      content: "groups:\n\n- name: magento-((env))\n  jobs:\n  - magento-((env))-build\n  - full-deploy-front-magento-((env))\n  - app-deploy-front-magento-((env))\n  - terraform-plan-magento-((env))\n  - terraform-apply-magento-((env))\n  - magento-((env))-unittests\n  - magento-((env))-functional-tests\n\nresource_types:\n\n- name: terraform\n  type: docker-image\n  source:\n    repository: ljfranklin/terraform-resource\n\nresources:\n\n- name: terraform-magento-((env))\n  type: terraform\n  source:\n    storage:\n      bucket: ((terraform_storage_bucket_name))\n      bucket_path: ((terraform_storage_bucket_path))\n      region_name: ((aws_default_region))\n      access_key_id: \"((terraform_storage_access_key))\"\n      secret_access_key: \"((terraform_storage_secret_key))\"\n    vars:\n      access_key: ((aws_access_key))\n      secret_key: ((aws_secret_key))\n    env:\n      AWS_ACCESS_KEY_ID: ((aws_access_key))\n      AWS_DEFAULT_REGION: ((aws_default_region))\n      AWS_SECRET_ACCESS_KEY: ((aws_secret_key))\n"
                    variables:
                      path: "pipeline/variables.sample.yml"
                      destination: "pipeline/prod-variables.yml"
                      content: "env: prod\nmagento_deploy_bucket_name: magento-deploy\nmagento_deploy_bucket_object_path: /catalog-magento/prod/magento.tar.gz\nmagento_deploy_bucket_region: eu-west-1\nmagento_deploy_bucket_access_key: ...\nmagento_deploy_bucket_secret_access_key: ...\nterraform_storage_access_key: ...\nterraform_storage_secret_key: ...\nterraform_storage_bucket_name: magento-terraform-remote-state\nterraform_storage_bucket_path: magento/prod\naws_access_key: ...\naws_secret_key: ...\naws_default_region: eu-west-1\n\nansible_vault_password: ...\nbastion_url: admin@bastion.server.com\nbastion_private_key_pair: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\ncatalog_magento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\nmagento_git_repository: git@github.com:myuser/code-magento.git\nmagento_git_branch: master\nmagento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\n\nmagento_config_git_repository: git@github.com:myuser/config-magento.git\nmagento_config_git_branch: master\nmagento_config_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n"
                  ansible:
                    magento:
                      path: "ansible/environments/front.yml.sample"
                      destination: "ansible/environments/prod-front.yml"
                      content: "# In this file you could override any variables present in default_front.yaml file\n\n# Usually you might want to override those variables :\n# magento_backend_frontname: admin\n# magento_admin_firstname: admin\n# magento_admin_lastname: admin\n# magento_admin_email: root@localhost.local\n# magento_admin_user: admin\n\n# magento_admin_password: 4Bigs3cr3t\n\n# In case you want to use vault to encrypt this password use the following command to generate the ansible vault var :\n# echo -n \"4Bigs3cr3t\" | ansible-vault encrypt_string --stdin-name=magento_admin_password\n#>> magento_admin_password: !vault |\n#>>           $ANSIBLE_VAULT;1.1;AES256\n#>>           37363232383334316164366337366430316535636130376134323366313565356365363662653539\n#>>           3161303331303565643831383839626263653362636466660a316530613935393464366536383839\n#>>           30303836326138306339623431356234333239343435623333343333623938633761636132303662\n#>>           3135343861383531660a393934316237363961663865393939313966373838653339326565353263\n#>>           6238\n"
                  terraform:
                    magento:
                      path: "terraform/magento.tf.sample"
                      destination: "terraform/magento/prod/magento.tf"
                      content: "variable \"rds_password\" {\n    default = \"ChangeMePls\"\n}\n\nmodule \"magento\" {\n  source = \"module-magento\"\n\n  env                      = \"prod\"\n  vpc_id                   = \"<vpc-id>\"\n  private_subnets_ids      = [\"private-subnets\"]\n  magento_ssl_cert         = \"<ssl-cert-arn>\"\n  bastion_sg_allow         = \"<bastion-sg>\"\n  public_subnets_ids       = [\"<public-subnets>\"]\n\n  rds_password             = \"${var.rds_password}\"\n\n  # project = \"magento\"\n\n  # FIXME optimized false : should be changes with the instance type ?\n\n  # rds_database         = \"magento\"\n  # rds_disk_size        = 10\n  # rds_multiaz          = false\n  # rds_storage_type     = \"gp2\"\n  # rds_subnet           = \"<rds-subnet-id>\"\n  # rds_type             = \"db.t2.small\"\n  # rds_username         = \"magento\"\n  # rds_engine           = \"\"mysql\"\n  # rds_engine_version   = \"5.7.16\"\n  # rds_backup_retention = 7\n  # rds_parameters       = \"\"\n\n  # cache_subnet                     = \"cache-subnet-id\"\n  # elasticache_type                 = \"cache.t2.micro\"\n  # elasticache_nodes                = \"1\n  # elasticache_parameter_group_name = \"default.redis3.2\"\n  # elasticache_engine               = \"redis\"\n  # elasticache_port                 = \"6379\"\n  # front_count           = \"1\"\n  # front_disk_size       = \"60\"\n  # front_disk_type       = \"gp2\"\n  # front_type            = \"t2.small\"\n\n}\n"
                dev:
                  pipeline:
                    pipeline:
                      path: "pipeline/magento.yml"
                      content: "groups:\n\n- name: magento-((env))\n  jobs:\n  - magento-((env))-build\n  - full-deploy-front-magento-((env))\n  - app-deploy-front-magento-((env))\n  - terraform-plan-magento-((env))\n  - terraform-apply-magento-((env))\n  - magento-((env))-unittests\n  - magento-((env))-functional-tests\n\nresource_types:\n\n- name: terraform\n  type: docker-image\n  source:\n    repository: ljfranklin/terraform-resource\n\nresources:\n\n- name: terraform-magento-((env))\n  type: terraform\n  source:\n    storage:\n      bucket: ((terraform_storage_bucket_name))\n      bucket_path: ((terraform_storage_bucket_path))\n      region_name: ((aws_default_region))\n      access_key_id: \"((terraform_storage_access_key))\"\n      secret_access_key: \"((terraform_storage_secret_key))\"\n    vars:\n      access_key: ((aws_access_key))\n      secret_key: ((aws_secret_key))\n    env:\n      AWS_ACCESS_KEY_ID: ((aws_access_key))\n      AWS_DEFAULT_REGION: ((aws_default_region))\n      AWS_SECRET_ACCESS_KEY: ((aws_secret_key))\n"
                    variables:
                      path: "pipeline/variables.sample.yml"
                      destination: "pipeline/prod-variables.yml"
                      content: "env: dev\nmagento_deploy_bucket_name: magento-deploy\nmagento_deploy_bucket_object_path: /catalog-magento/dev/magento.tar.gz\nmagento_deploy_bucket_region: eu-west-1\nmagento_deploy_bucket_access_key: ...\nmagento_deploy_bucket_secret_access_key: ...\nterraform_storage_access_key: ...\nterraform_storage_secret_key: ...\nterraform_storage_bucket_name: magento-terraform-remote-state\nterraform_storage_bucket_path: magento/dev\naws_access_key: ...\naws_secret_key: ...\naws_default_region: eu-west-1\n\nansible_vault_password: ...\nbastion_url: admin@bastion.server.com\nbastion_private_key_pair: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\ncatalog_magento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\nmagento_git_repository: git@github.com:myuser/code-magento.git\nmagento_git_branch: master\nmagento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\n\nmagento_config_git_repository: git@github.com:myuser/config-magento.git\nmagento_config_git_branch: master\nmagento_config_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n"
                  ansible:
                    magento:
                      path: "ansible/environments/front.yml.sample"
                      destination: "ansible/environments/dev-front.yml"
                      content: "# In this file you could override any variables present in default_front.yaml file\n\n# Usually you might want to override those variables :\n# magento_backend_frontname: admin\n# magento_admin_firstname: admin\n# magento_admin_lastname: admin\n# magento_admin_email: root@localhost.local\n# magento_admin_user: admin\n\n# magento_admin_password: 4Bigs3cr3t\n\n# In case you want to use vault to encrypt this password use the following command to generate the ansible vault var :\n# echo -n \"4Bigs3cr3t\" | ansible-vault encrypt_string --stdin-name=magento_admin_password\n#>> magento_admin_password: !vault |\n#>>           $ANSIBLE_VAULT;1.1;AES256\n#>>           37363232383334316164366337366430316535636130376134323366313565356365363662653539\n#>>           3161303331303565643831383839626263653362636466660a316530613935393464366536383839\n#>>           30303836326138306339623431356234333239343435623333343333623938633761636132303662\n#>>           3135343861383531660a393934316237363961663865393939313966373838653339326565353263\n#>>           6238\n"
                  terraform:
                    magento:
                      path: "terraform/magento.tf.sample"
                      destination: "terraform/magento/dev/magento.tf"
                      content: "variable \"rds_password\" {\n    default = \"ChangeMePls\"\n}\n\nmodule \"magento\" {\n  source = \"module-magento\"\n\n  env                      = \"prod\"\n  vpc_id                   = \"<vpc-id>\"\n  private_subnets_ids      = [\"private-subnets\"]\n  magento_ssl_cert         = \"<ssl-cert-arn>\"\n  bastion_sg_allow         = \"<bastion-sg>\"\n  public_subnets_ids       = [\"<public-subnets>\"]\n\n  rds_password             = \"${var.rds_password}\"\n\n  # project = \"magento\"\n\n  # FIXME optimized false : should be changes with the instance type ?\n\n  # rds_database         = \"magento\"\n  # rds_disk_size        = 10\n  # rds_multiaz          = false\n  # rds_storage_type     = \"gp2\"\n  # rds_subnet           = \"<rds-subnet-id>\"\n  # rds_type             = \"db.t2.small\"\n  # rds_username         = \"magento\"\n  # rds_engine           = \"\"mysql\"\n  # rds_engine_version   = \"5.7.16\"\n  # rds_backup_retention = 7\n  # rds_parameters       = \"\"\n\n  # cache_subnet                     = \"cache-subnet-id\"\n  # elasticache_type                 = \"cache.t2.micro\"\n  # elasticache_nodes                = \"1\n  # elasticache_parameter_group_name = \"default.redis3.2\"\n  # elasticache_engine               = \"redis\"\n  # elasticache_port                 = \"6379\"\n  # front_count           = \"1\"\n  # front_disk_size       = \"60\"\n  # front_disk_type       = \"gp2\"\n  # front_type            = \"t2.small\"\n\n}\n"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/forms/validate':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      parameters:
        - in: body
          name: body
          description: The content of the forms file to be validated.
          required: true
          schema:
            $ref: '#/definitions/FormsValidation'
      tags:
        - Organization Forms
      description: Validate a forms file definition
      operationId: validateFormsFile
      responses:
        '200':
          description: The result of validating the provided configuration
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/FormsValidationResult'
          examples:
            application/json:
              data:
                forms:
                  version: 2
                  use_cases:
                    - name: prod
                      sections:
                        - name: ansible
                          groups:
                            - name: database
                              technologies: [ansible]
                              vars:
                                - widget: "radios"
                                  default: {foo: bar}
                                  unit: "($, GHz, GB)"
                                  type: "map"
                                  values: [{foo: bar}, {bar: foo}]
                                  description: ""
                                  key: "key-one"
                                  name: "map variable"
                                - widget: "checkbox"
                                  default: true
                                  type: "boolean"
                                  description: ""
                                  key: "key-oneb"
                                  name: "checkbox variable"
                                - widget: "dropdown"
                                  required: false
                                  default: [bar, foo]
                                  values: [[foo, bar], [bar, foo]]
                                  unit: "($, GHz, GB)"
                                  type: "array"
                                  description: "something k2"
                                  key: "key-two"
                                  name: "array variable"
                                - widget: "number"
                                  required: true
                                  unit: "something"
                                  type: "integer"
                                  description: "something k3"
                                  key: "key-three"
                                  name: "required variable without default"
                                - widget: "number"
                                  required: false
                                  type: "float"
                                  description: "something k3b"
                                  key: "key-threeb"
                                  name: "some float"
                                - widget: "dropdown"
                                  required: false
                                  default: 20
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k5"
                                  values: [20]
                                  key: "key-five"
                                  name: "dropdown one value"
                                - widget: "radios"
                                  required: false
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k6"
                                  values: [20]
                                  key: "key-six"
                                  name: "radios one value"
                                - widget: "slider_list"
                                  required: false
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k7"
                                  values: [20]
                                  key: "key-seven"
                                  name: "slider list one value"
                        - name: terraform
                          groups:
                            - name: database
                              technologies: [terraform]
                              vars:
                                - widget: "slider_range"
                                  required: false
                                  default: 2
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k1"
                                  values: [1, 10]
                                  key: "key-eight"
                                  name: "integer variable"
                                - widget: "dropdown"
                                  required: true
                                  default: 20
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k2"
                                  values: [10, 20, 30]
                                  key: "key-nine"
                                  name: "required with default"
                                - widget: "slider_list"
                                  required: false
                                  values: [1, 5]
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k3"
                                  key: "key-ten"
                                  name: "not required no default"
                        - name: pipeline
                          groups:
                            - name: database
                              technologies: [pipeline]
                              vars:
                                - widget: "auto_complete"
                                  default: t2.micro
                                  unit: "($, GHz, GB)"
                                  type: "string"
                                  description: "something"
                                  values: [t2.micro, t2.medium, t2.large]
                                  key: "key-eleven"
                                  name: "string with values and default"
                                # if not provided this variable will be ignored as it doesn't have default
                                - widget: "dropdown"
                                  required: false
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k5"
                                  key: "key-twelve"
                                  values: [100, 200]
                                  name: "not required no default, but values"
                                # if not provided this variable will be ignored as it doesn't have default
                                - widget: "dropdown"
                                  required: false
                                  unit: "($, GHz, GB)"
                                  type: "integer"
                                  description: "something k6"
                                  key: "key-thirteen"
                                  name: "not required no default, but values"
                                  values: [10, 40, 80]
                    - name: dev
                      sections:
                        - name: ansible
                          groups:
                            - name: database
                              technologies: [ansible]
                              vars:
                                - widget: "dropdown"
                                  default: {foo: bar}
                                  unit: "($, GHz, GB)"
                                  type: "map"
                                  values: [{foo: bar}, {bar: foo}]
                                  description: "something k1"
                                  key: "key-one"
                                  name: "map variable"
                  # This would only show that extra one can exist
                  # even if not used as long as they are valid.
                    - name: extra-one
                      sections:
                        - name: ansible
                          groups:
                            - name: database
                              technologies: [ansible]
                              vars:
                                - widget: "switch"
                                  type: "boolean"
                                  description: ""
                                  key: "key-two"
                                  name: "switch variable"
                                - widget: "dropdown"
                                  default: {foo: bar}
                                  unit: "($, GHz, GB)"
                                  type: "map"
                                  values: [{foo: bar}, {bar: foo}]
                                  description: "something k1"
                                  key: "key-one"
                                  name: "map variable"
                errors:
                  - "The Forms File has an invalid format: use case \"use-caseX\" invalid definition for variable \"key-one\" (key) in section \"ansible\" of \"database\": The Forms Widget has an invalid format"
                  - "The Forms File has an invalid format: use case \"use-caseX\" invalid definition for variable \"key-two\" (key) in section \"ansible\" of \"database\": The Forms Widget has an invalid format"
                  - "The Forms File has an invalid format: use case \"use-caseX\" invalid definition for variable \"key-four\" (key) in section \"ansible\" of \"database\": The Forms Widget has an invalid format"
                  - "The Forms File has an invalid format: use case \"use-caseX\" invalid definition for variable \"key-five\" (key) in section \"ansible\" of \"database\": The Forms Widget has an invalid format"
                  - "The Forms File has an invalid format: use case \"default\" invalid definition for variable \"key-two\" (key) in section \"ansible\" of \"database\": The Forms Widget has an invalid format"
                  - "The Forms File has an invalid format: use case \"default\" - key \"key-one\" has been found twice"
                  - "The Forms File has an invalid format: use case \"default\" - key \"key-two\" has been found twice"
                  - "The Forms File has an invalid format: Forms Technology \"INVALID-TECH\" is unknown"
                  - "The Forms File has an invalid format: use case \"default\" invalid definition for variable \"key-two\" (key) in section \"ansible\" of \"groupX\": The Forms File Branch Source has an invalid format"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/forms/values_ref':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      parameters:
        - in: body
          name: body
          description: The URL to fetch the values from
          required: true
          schema:
            $ref: '#/definitions/FormsValuesRef'
      tags:
        - Organization Forms
      description: Returns the values from the ref
      operationId: valuesRefForms
      responses:
        '200':
          description: The result pulling the values from the url
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: object
          examples:
            application/json:
              data:
                foo: bar
                bar: foo
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/projects/{project_canonical}/forms/estimate':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the filled forms for a new project.
          required: true
          schema:
            $ref: '#/definitions/FormInputs'
      tags:
        - Cost Estimation
      description: Estimates the Cost from the Froms Inputs
      operationId: costEstimateForms
      responses:
        '200':
          description: The result of estimating the costs of a stack.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: object
          examples:
            application/json:
              data:
                prod:
                  usecase:
                    - name: "some name"
                      info: "some potential info here"
                      prior_cost: "10.544"
                      prior_hourly_cost: "0.01444"
                      planned_cost: "30.252"
                      planned_hourly_cost: "0.04144"
                      resource_estimates:
                        - provider: aws
                          type: aws_instance
                          address: aws_instance.example
                          prior_cost: "10.544"
                          prior_hourly_cost: "0.01444"
                          planned_cost: "30.252"
                          planned_hourly_cost: "0.04144"
                          components:
                            - label: Compute
                              prior:
                                cost: "5.00"
                                hourly_cost: "0.00685"
                                quantity: 1
                              planned:
                                cost: "5.00"
                                hourly_cost: "0.00685"
                                quantity: 1
                            - label: Storage
                              prior:
                                cost: "5.544"
                                hourly_cost: "0.00759"
                                quantity: 30
                              planned:
                                cost: "25.252"
                                hourly_cost: "0.03459"
                                quantity: 150
                    - name: "some 2"
                      info: "some potential info here"
                      prior_cost: "10.544"
                      prior_hourly_cost: "0.01444"
                      planned_cost: "30.252"
                      planned_hourly_cost: "0.04144"
                      resource_estimates:
                        - provider: aws
                          type: aws_instance
                          address: aws_instance.example
                          prior_cost: "10.544"
                          prior_hourly_cost: "0.01444"
                          planned_cost: "30.252"
                          planned_hourly_cost: "0.04144"
                          components:
                            - label: Compute
                              prior:
                                cost: "5.00"
                                hourly_cost: "0.00685"
                                quantity: 1
                              planned:
                                cost: "5.00"
                                hourly_cost: "0.00685"
                                quantity: 1
                            - label: Storage
                              prior:
                                cost: "5.544"
                                hourly_cost: "0.00759"
                                quantity: 30
                              planned:
                                cost: "25.252"
                                hourly_cost: "0.03459"
                                quantity: 150
  
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/projects/{project_canonical}/forms/quotas':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the filled forms for a new project.
          required: true
          schema:
            $ref: '#/definitions/FormInputs'
      tags:
        - Organization Quotas
      description: Estimates the Quotas from the Form Inputs
      operationId: quotasEstimateForms
      responses:
        '200':
          description: The result of estimating the costs of a stack.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: object
          examples:
            application/json:
              data:
                prod:
                  usecase:
                    cpu: 10
                    memory: 20
                    storage: 30
                  usecase2:
                    cpu: 20
                    memory: 20
                    storage: 10
                dev:
                  usecase-dev:
                    cpu: 10
                    memory: 20
                    storage: 30
  
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infra_imports':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the Infra Import to create
          required: true
          schema:
            $ref: '#/definitions/NewInfraImport'
      tags:
        - Organization Infra Imports
      description: Create a new Infra Import
      operationId: createInfraImport
      responses:
        '202':
          description: The Infra Import has been created and processing in the background
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/import':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    get:
      tags:
        - Organization Infra Imports
      description: Get the Project Import of the organization.
      operationId: getProjectImport
      responses:
        '200':
          description: >-
            The information of the Project import process.
          headers:
            Content-Length:
              description: The length of the response body in octets (8-bit bytes).
              type: integer
              format: uint64
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/InfraImport'
          examples:
            application/json:
              data:
                status: Importing
                project_canonical: my-project-1
                service_catalog_ref: 'cycloidio:stack-magento'
                logs: The Provider1 Resource has been imported
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Infra Imports
      description: Delete the Project Import of the organization.
      operationId: deleteProjectImport
      responses:
        '204':
          description: The Project Import has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/import/retry':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    put:
      tags:
        - Organization Infra Imports
      description: Retry to import a Project.
      operationId: retryProjectImport
      responses:
        '202':
          description: The request to retry the Project import has been accepted and processing in the background
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/import':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
    get:
      tags:
        - Organization Infra Imports
      description: Get the import of a new Stack of the organization.
      operationId: getServiceCatalogImport
      responses:
        '200':
          description: >-
            The information of the Stack import process.
          headers:
            Content-Length:
              description: The length of the response body in octets (8-bit bytes).
              type: integer
              format: uint64
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/InfraImport'
          examples:
            application/json:
              data:
                status: Importing
                project_canonical: my-project-1
                service_catalog_ref: 'cycloidio:stack-magento'
                logs:
                  - 'Imported Resource 1'
                  - 'Imported Resource 2'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Infra Imports
      description: Delete the Stack import of the organization.
      operationId: deleteServiceCatalogImport
      responses:
        '204':
          description: The Stack import has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/import/retry':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
    put:
      tags:
        - Organization Infra Imports
      description: Retry to import a Stack.
      operationId: retryServiceCatalogImport
      responses:
        '202':
          description: The request to retry the Stack import has been accepted and processing in the background
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infra_policies':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/infra_policy_name_query'
        - $ref: '#/parameters/infra_policy_created_at_query'
        - $ref: '#/parameters/infra_policy_severity_query'
        - $ref: '#/parameters/infra_policy_enabled_query'
        - $ref: '#/parameters/infra_policy_canonical_query'
        - $ref: '#/parameters/order_by_query'
      tags:
        - Organization Infrastructure Policies
      description: Return a list of infrastructure policies which matches the scope specified by the filter.
      operationId: getInfraPolicies
      responses:
        '200':
          description: List of infrastructure policies.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/InfraPolicy'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 1
                  created_at: 1503225026
                  updated_at: 1503335026
                  name: 'My Infra Policy'
                  description: 'Apply changes across my infrastructure in a safe way!'
                  canonical: my-infra-policy
                  raw: 'allow = true {count(violation) == 0}'
                  owner:
                    username: user-1
                    id: 1
                    given_name: Mariano
                    family_name: Jimenez
                    email: mariano.jimenez@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 42
                      name: "standard role"
                      description: "this is the standard role"
                      policies:
                      - id: 1
                        code: "team:create"
                        description: "this is the policy"
                  enabled: true
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization Infrastructure Policies
      description: Create a new policy.
      operationId: createInfraPolicy
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/NewInfraPolicy'
      responses:
        '200':
          description: >-
            The new InfraPolicy created.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/InfraPolicy'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                name: 'My Infra Policy'
                description: 'Apply changes across my infrastructure in a safe way!'
                canonical: my-infra-policy
                raw: 'allow = true {count(violation) == 0}'
                owner:
                  username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 42
                    name: "standard role"
                    description: "this is the standard role"
                    policies:
                    - id: 1
                      code: "team:create"
                      description: "this is the policy"
                enabled: true
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infra_policies/{infra_policy_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/infra_policy_canonical'
    get:
      tags:
        - Organization Infrastructure Policies
      description: Get the information of the InfraPolicy.
      operationId: getInfraPolicy
      responses:
        '200':
          description: The information of the InfraPolicy which has the specified canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/InfraPolicy'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                name: 'My Infra Policy'
                description: 'Apply changes across my infrastructure in a safe way!'
                canonical: my-infra-policy
                raw: 'allow = true {count(violation) == 0}'
                owner:
                  username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 42
                    name: "standard role"
                    description: "this is the standard role"
                    policies:
                    - id: 1
                      code: "team:create"
                      description: "this is the policy"
                enabled: true
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Infrastructure Policies
      description: Delete the InfraPolicy.
      operationId: deleteInfraPolicy
      responses:
        '204':
          description: InfraPolicy has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization Infrastructure Policies
      description: >-
        Update an existing InfraPolicy
      operationId: updateInfraPolicy
      parameters:
        - in: body
          name: body
          description: The information of the organization to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateInfraPolicy'
      responses:
        '200':
          description: InfraPolicy updated.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/InfraPolicy'
          examples:
            application/json:
              data:
                id: 1
                created_at: 1503225026
                updated_at: 1503335026
                name: 'My Infra Policy'
                description: 'Apply changes across my infrastructure in a safe way!'
                canonical: my-infra-policy
                body: 'allow = true {count(violation) == 0}'
                owner:
                  username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 42
                    name: "standard role"
                    description: "this is the standard role"
                    policies:
                    - id: 1
                      code: "team:create"
                      description: "this is the policy"
                enabled: true
                severity: critical
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/validate_infra_policies':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/environment_canonical'
    post:
      tags:
        - Organization Infrastructure Policies
      description: Check the InfraPolicies assigned to the Project and the Environment to identify if some are not respected.
      operationId: validateProjectInfraPolicies
      parameters:
        - in: body
          name: body
          description: The project's attributes to check before to apply an infrastructure change.
          required: true
          schema:
            $ref: '#/definitions/TerraformPlanInput'
      responses:
        '200':
          description: The list of the policies not respected.
          schema:
            properties:
              data:
                $ref: '#/definitions/InfraPoliciesValidationResult'
          examples:
            application/json:
              data:
                criticals:
                - infra_policy:
                  id: 8
                  created_at: 1606735667
                  updated_at: 1606735667
                  canonical: infrapolicy-1
                  name: InfraPolicy 1
                  description: This is an example
                  body: |-
                    package example
  
                    deny[reason] {
                        reason := "This is a failing error example"
                    }
                  owner:
                    username: user-1
                    id: 1
                    given_name: Mariano
                    family_name: Jimenez
                    email: mariano.jimenez@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 42
                      name: "standard role"
                      description: "this is the standard role"
                      policies:
                      - id: 1
                        code: "team:read"
                        description: "this is the policy"
                  severity: critical
                  enabled: true
                reasons:
                - This is a failing error example
                warnings: []
                advisories: []
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/buckets':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of S3 buckets of the running AWS infrastructure and
        associated with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSBuckets
      responses:
        '200':
          description: >-
            The list of AWS S3 buckets which matches the scope specified by the
            filter.
          schema:
            type: object
            description: >-
              Although this response contains a collection of items, it doesn't
              have pagination because the AWS SDK, to request the S3 Buckets
              resources, doesn't provide any pagination mechanism.
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceBucket'
          examples:
            application/json:
              data:
                - CreationDate: '2017-03-29T05:15:27Z'
                  Name: config-bucket-123456789101
                  Tags: []
                - CreationDate: '2017-03-29T01:12:21Z'
                  Name: data-some-log-dbm
                  Tags:
                    - Key: client
                      Value: Cycloid
                - CreationDate: '2017-03-29T10:28:14Z'
                  Name: dev-sdk.web.fr
                  Tags: []
                - CreationDate: '2017-06-19T14:57:15Z'
                  Name: marianorajoy.es
                  Tags:
                    - Key: owner
                      Value: Mariano Rajoy
                - CreationDate: '2017-03-29T18:01:25Z'
                  Name: dtrump.com
                  Tags: []
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/aws_infrastructure_resource_query'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the number of resources classified by types, of the running AWS
        infrastructure of the organization and associated AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization and/or a set of type of resource.
      operationId: getRunningInfraAWS
      responses:
        '200':
          description: >-
            The number of resources classified per type which matches the scope
            specified by the filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/AWSInfrastructureResourcesAggregation'
          examples:
            application/json:
              data:
                instances:
                  total_amount: 94875
                vpcs:
                  total_amount: 98
                images:
                  total_amount: 6
                security_groups:
                  total_amount: 9
                subnets:
                  total_amount: 31
                volumes:
                  total_amount: 45
                snapshots:
                  total_amount: 786
                load_balancers_v2:
                  total_amount: 4
                db_instances:
                  total_amount: 34
                buckets:
                  total_amount: 10
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/db_instances':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of RDS DB instances of the running AWS infrastructure and
        associated with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSDBInstances
      responses:
        '200':
          description: >-
            The list of AWS RDS DB Instances which matches the scope specified
            by the filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceDBInstance'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - AllocatedStorage: 50
                  AutoMinorVersionUpgrade: true
                  AvailabilityZone: eu-west-1b
                  BackupRetentionPeriod: 7
                  CACertificateIdentifier: rds-ca-2015
                  CharacterSetName:
                  CopyTagsToSnapshot: false
                  DBClusterIdentifier:
                  DBInstanceArn: arn:aws:rds:eu-west-1:123456789101:db:amazon-rds-api-gateway-dev
                  DBInstanceClass: db.t2.small
                  DBInstanceIdentifier: amazon-rds-api-gateway-dev
                  DBInstanceStatus: available
                  DBName: api_gateway_dev
                  DBParameterGroups:
                  - DBParameterGroupName: rds-optimized-postgresql-amazon-dev
                    ParameterApplyStatus: in-sync
                  DBSecurityGroups:
                  DBSubnetGroup:
                    DBSubnetGroupArn:
                    DBSubnetGroupDescription: subnet-rds-amazon-dev
                    DBSubnetGroupName: subnet-rds-amazon-dev
                    SubnetGroupStatus: Complete
                    Subnets:
                    - SubnetAvailabilityZone:
                        Name: eu-west-1b
                      SubnetIdentifier: subnet-1ee9cf68
                      SubnetStatus: Active
                    - SubnetAvailabilityZone:
                        Name: eu-west-1c
                      SubnetIdentifier: subnet-5ccca204
                      SubnetStatus: Active
                    - SubnetAvailabilityZone:
                        Name: eu-west-1a
                      SubnetIdentifier: subnet-53614d37
                      SubnetStatus: Active
                    VpcId: vpc-257d2d41
                  DbInstancePort: 0
                  DbiResourceId: db-LLW4DT3OHVULRQ4GLZWSJ3MOVQ
                  DomainMemberships:
                  EnabledCloudwatchLogsExports:
                  Endpoint:
                    Address: amazon-rds-api-gateway-dev.cwhghoaxsi70.eu-west-1.rds.amazonaws.com
                    HostedZoneId: Z29XKXDKYMONMX
                    Port: 5432
                  Engine: postgres
                  EngineVersion: 9.4.7
                  EnhancedMonitoringResourceArn:
                  IAMDatabaseAuthenticationEnabled: false
                  InstanceCreateTime: '2017-12-05T18:21:34.311Z'
                  Iops:
                  KmsKeyId:
                  LatestRestorableTime: '2018-02-06T11:40:39Z'
                  LicenseModel: postgresql-license
                  MasterUsername: amazon
                  MonitoringInterval: 0
                  MonitoringRoleArn:
                  MultiAZ: false
                  OptionGroupMemberships:
                  - OptionGroupName: default:postgres-9-4
                    Status: in-sync
                  PendingModifiedValues:
                    AllocatedStorage:
                    BackupRetentionPeriod:
                    CACertificateIdentifier:
                    DBInstanceClass:
                    DBInstanceIdentifier:
                    DBSubnetGroupName:
                    EngineVersion:
                    Iops:
                    LicenseModel:
                    MasterUserPassword:
                    MultiAZ:
                    PendingCloudwatchLogsExports:
                    Port:
                    StorageType:
                  PerformanceInsightsEnabled: false
                  PerformanceInsightsKMSKeyId:
                  PreferredBackupWindow: 02:00-04:00
                  PreferredMaintenanceWindow: tue:06:00-tue:07:00
                  PromotionTier:
                  PubliclyAccessible: false
                  ReadReplicaDBClusterIdentifiers:
                  ReadReplicaDBInstanceIdentifiers:
                  ReadReplicaSourceDBInstanceIdentifier:
                  SecondaryAvailabilityZone:
                  StatusInfos:
                  StorageEncrypted: false
                  StorageType: gp2
                  TdeCredentialArn:
                  Timezone:
                  VpcSecurityGroups:
                  - Status: active
                    VpcSecurityGroupId: sg-64d29802
                  Tags: []
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/elasticache_clusters':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of Elasticache clusters of the running AWS infrastructure
        and associated with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSElasticacheClusters
      responses:
        '200':
          description: >-
            The list of AWS elasticache clusters which matches the scope
            specified by the filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceElasticacheCluster'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - AtRestEncryptionEnabled: false
                  AuthTokenEnabled: false
                  AutoMinorVersionUpgrade: true
                  CacheClusterCreateTime: '2015-11-23T11:24:24.677Z'
                  CacheClusterId: cache0
                  CacheClusterStatus: available
                  CacheNodeType: cache.t2.micro
                  CacheNodes:
                  CacheParameterGroup:
                    CacheNodeIdsToReboot:
                    CacheParameterGroupName: default.redis2.8
                    ParameterApplyStatus: in-sync
                  CacheSecurityGroups:
                  CacheSubnetGroupName: amazon-cache0-eu-we1
                  ClientDownloadLandingPage: 'https://console.aws.amazon.com/elasticache/home#client-download:'
                  ConfigurationEndpoint:
                  Engine: redis
                  EngineVersion: 2.8.23
                  NotificationConfiguration:
                  NumCacheNodes: 1
                  PendingModifiedValues:
                    CacheNodeIdsToRemove:
                    CacheNodeType:
                    EngineVersion:
                    NumCacheNodes:
                  PreferredAvailabilityZone: eu-west-1a
                  PreferredMaintenanceWindow: tue:06:00-tue:07:00
                  ReplicationGroupId:
                  SecurityGroups:
                  - SecurityGroupId: sg-fff37b9b
                    Status: active
                  SnapshotRetentionLimit:
                  SnapshotWindow:
                  TransitEncryptionEnabled: false
                  Tags:
                  - Key: project
                    Value: website
                  - Key: client
                    Value: cycloid
                  - Key: env
                    Value: prod
                  - Key: role
                    Value: cache
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/images':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of images of the running AWS infrastructure and associated
        with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSImages
      responses:
        '200':
          description: >-
            The list of AWS images which matches the scope specified by the
            filter.
          schema:
            type: object
            description: >-
              Although this response contains a collection of items, it doesn't
              have pagination because the AWS SDK, to request the images
              resources, doesn't provide any pagination mechanism.
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceImage'
          examples:
            application/json:
              data:
                - Architecture: x86_64
                  BlockDeviceMappings:
                  - DeviceName: "/dev/xvda"
                    Ebs:
                      DeleteOnTermination: true
                      Encrypted: false
                      Iops:
                      KmsKeyId:
                      SnapshotId: snap-e978d105
                      VolumeSize: 8
                      VolumeType: standard
                    NoDevice:
                    VirtualName:
                  CreationDate: '2016-05-24T21:14:11.000Z'
                  Description: hashicorp vault
                  EnaSupport:
                  Hypervisor: xen
                  ImageId: ami-01d94872
                  ImageLocation: 123456789101/vault
                  ImageOwnerAlias:
                  ImageType: machine
                  KernelId:
                  Name: vault
                  OwnerId: '123456789101'
                  Platform:
                  ProductCodes:
                  Public: false
                  RamdiskId:
                  RootDeviceName: "/dev/xvda"
                  RootDeviceType: ebs
                  SriovNetSupport:
                  State: available
                  StateReason:
                  Tags: []
                  VirtualizationType: hvm
                - Architecture: x86_64
                  BlockDeviceMappings:
                  - DeviceName: "/dev/xvda"
                    Ebs:
                      DeleteOnTermination: true
                      Encrypted: false
                      Iops:
                      KmsKeyId:
                      SnapshotId: snap-0d4d246f98692cab9
                      VolumeSize: 8
                      VolumeType: gp2
                    NoDevice:
                    VirtualName:
                  CreationDate: '2017-09-15T17:45:50.000Z'
                  Description:
                  EnaSupport:
                  Hypervisor: xen
                  ImageId: ami-34995b4d
                  ImageLocation: 123456789101/pipeline_demo 1505497225
                  ImageOwnerAlias:
                  ImageType: machine
                  KernelId:
                  Name: pipeline_demo 1505497225
                  OwnerId: '123456789101'
                  Platform:
                  ProductCodes:
                  Public: false
                  RamdiskId:
                  RootDeviceName: "/dev/xvda"
                  RootDeviceType: ebs
                  SriovNetSupport: simple
                  State: available
                  StateReason:
                  Tags:
                  - Key: client
                    Value: cycloid
                  - Key: env
                    Value: demo
                  - Key: Name
                    Value: demo-pipeline-1505497225
                  - Key: role
                    Value: front
                  - Key: project
                    Value: demo-website
                  VirtualizationType: hvm
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/instances':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of instances of the running AWS infrastructure and associated
        with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSInstances
      responses:
        '200':
          description: >-
            The list of AWS instances which matches the scope specified by the
            filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceInstance'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - AmiLaunchIndex: 0
                  Architecture: x86_64
                  BlockDeviceMappings:
                  - DeviceName: "/dev/xvda"
                    Ebs:
                      AttachTime: '2016-09-02T08:07:12Z'
                      DeleteOnTermination: true
                      Status: attached
                      VolumeId: vol-c888994f
                  ClientToken: ''
                  EbsOptimized: false
                  ElasticGpuAssociations:
                  EnaSupport:
                  Hypervisor: xen
                  IamInstanceProfile:
                    Arn: arn:aws:iam::123456789101:instance-profile/profile-front-website-prod
                    Id: AIPAJFKQFTYM7KEEE2SWU
                  ImageId: ami-e079f893
                  InstanceId: i-2000dcad
                  InstanceLifecycle:
                  InstanceType: t2.micro
                  KernelId:
                  KeyName: cycloid
                  LaunchTime: '2016-09-19T07:11:18Z'
                  Monitoring:
                    State: disabled
                  NetworkInterfaces:
                  - Association:
                      IpOwnerId: amazon
                      PublicDnsName: ec2-54-192-0-1.eu-west-1.compute.amazonaws.com
                      PublicIp: 54.192.0.1
                    Attachment:
                      AttachTime: '2016-09-02T08:07:11Z'
                      AttachmentId: eni-attach-10d509cf
                      DeleteOnTermination: true
                      DeviceIndex: 0
                      Status: attached
                    Description: ''
                    Groups:
                    - GroupId: sg-64565003
                      GroupName: website-front-prod
                    - GroupId: sg-3543334e
                      GroupName: allow_metrics
                    - GroupId: sg-c1db70a6
                      GroupName: allow_bastion
                    Ipv6Addresses:
                    MacAddress: 06:9a:1a:77:6c:db
                    NetworkInterfaceId: eni-b1f859fd
                    OwnerId: '123456789101'
                    PrivateDnsName: ip-10-42-0-2.eu-west-1.compute.internal
                    PrivateIpAddress: 10.42.0.2
                    PrivateIpAddresses:
                    - Association:
                        IpOwnerId: amazon
                        PublicDnsName: ec2-54-192-0-1.eu-west-1.compute.amazonaws.com
                        PublicIp: 54.192.0.1
                      Primary: true
                      PrivateDnsName: ip-10-42-0-2.eu-west-1.compute.internal
                      PrivateIpAddress: 10.42.0.2
                    SourceDestCheck: true
                    Status: in-use
                    SubnetId: subnet-6b5a8f1d
                    VpcId: vpc-21fb3e45
                  Placement:
                    Affinity:
                    AvailabilityZone: eu-west-1b
                    GroupName: ''
                    HostId:
                    SpreadDomain:
                    Tenancy: default
                  Platform:
                  PrivateDnsName: ip-10-42-0-2.eu-west-1.compute.internal
                  PrivateIpAddress: 10.42.0.2
                  ProductCodes:
                  PublicDnsName: ec2-54-192-0-1.eu-west-1.compute.amazonaws.com
                  PublicIpAddress: 54.192.0.1
                  RamdiskId:
                  RootDeviceName: "/dev/xvda"
                  RootDeviceType: ebs
                  SecurityGroups:
                  - GroupId: sg-64565003
                    GroupName: website-front-prod
                  - GroupId: sg-3543334e
                    GroupName: allow_metrics
                  - GroupId: sg-c1db70a6
                    GroupName: allow_bastion
                  SourceDestCheck: true
                  SpotInstanceRequestId:
                  SriovNetSupport:
                  State:
                    Code: 16
                    Name: running
                  StateReason:
                    Code: Client.UserInitiatedShutdown
                    Message: 'Client.UserInitiatedShutdown: User initiated shutdown'
                  StateTransitionReason: ''
                  SubnetId: subnet-6b5a8f1d
                  Tags:
                  - Key: project
                    Value: website
                  - Key: client
                    Value: cycloid
                  - Key: Name
                    Value: CYCLOID-WEBSITE-FRONT1-EU-WE1-PROD
                  - Key: env
                    Value: prod
                  - Key: role
                    Value: front
                  VirtualizationType: hvm
                  VpcId: vpc-21fb3e45
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/load_balancers_v1':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of load balancers (ELB) of the running AWS
        infrastructure and associated with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSLoadBalancersV1
      responses:
        '200':
          description: >-
            The list of AWS load balancers (ELB) which matches the scope
            specified by the filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceLoadBalancerV1'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - AvailabilityZones:
                  - eu-west-1b
                  - eu-west-1c
                  - eu-west-1a
                  BackendServerDescriptions:
                  CanonicalHostedZoneName: WEBSITE-FRONT-PROD-1234567890.eu-west-1.elb.amazonaws.com
                  CanonicalHostedZoneNameID: Z32O12XQLNTSW2
                  CreatedTime: '2016-09-02T08:07:35.52Z'
                  DNSName: WEBSITE-FRONT-PROD-1234567890.eu-west-1.elb.amazonaws.com
                  HealthCheck:
                    HealthyThreshold: 2
                    Interval: 30
                    Target: HTTP:80/
                    Timeout: 20
                    UnhealthyThreshold: 2
                  Instances:
                  - InstanceId: i-2000dcdd
                  - InstanceId: i-911b05af
                  ListenerDescriptions:
                  - Listener:
                      InstancePort: 80
                      InstanceProtocol: HTTP
                      LoadBalancerPort: 80
                      Protocol: HTTP
                      SSLCertificateId:
                    PolicyNames:
                  - Listener:
                      InstancePort: 80
                      InstanceProtocol: HTTP
                      LoadBalancerPort: 443
                      Protocol: HTTPS
                      SSLCertificateId: arn:aws:iam::123456789101:server-certificate/cloudfront/example
                    PolicyNames:
                    - website-front-prod
                    - ELBSecurityPolicy-2016-08
                  LoadBalancerName: WEBSITE-FRONT-PROD
                  Policies:
                    AppCookieStickinessPolicies:
                    LBCookieStickinessPolicies:
                    - CookieExpirationPeriod: 3600
                      PolicyName: website-front-prod
                    OtherPolicies:
                    - ELBSecurityPolicy-2016-08
                  Scheme: internet-facing
                  SecurityGroups:
                  - sg-9c494ffb
                  SourceSecurityGroup:
                    GroupName: website-elb-front-prod
                    OwnerAlias: '123456789101'
                  Subnets:
                  - subnet-550fac31
                  - subnet-6b5a8f1d
                  - subnet-b95dbde1
                  VPCId: vpc-21fb3e45
                  Tags:
                  - Key: client
                    Value: cycloid
                - AvailabilityZones:
                  - eu-west-1b
                  - eu-west-1c
                  - eu-west-1a
                  BackendServerDescriptions:
                  CanonicalHostedZoneName: WEBSITE-FRONT-PREPROD-1234567890.eu-west-1.elb.amazonaws.com
                  CanonicalHostedZoneNameID: Z32O12XQLNTSW2
                  CreatedTime: '2016-09-02T08:07:35.91Z'
                  DNSName: WEBSITE-FRONT-PREPROD-1234567890.eu-west-1.elb.amazonaws.com
                  HealthCheck:
                    HealthyThreshold: 2
                    Interval: 30
                    Target: HTTP:80/
                    Timeout: 20
                    UnhealthyThreshold: 2
                  Instances:
                  - InstanceId: i-ab00dc26
                  - InstanceId: i-9ec9a815
                  ListenerDescriptions:
                  - Listener:
                      InstancePort: 80
                      InstanceProtocol: HTTP
                      LoadBalancerPort: 80
                      Protocol: HTTP
                      SSLCertificateId:
                    PolicyNames:
                  - Listener:
                      InstancePort: 80
                      InstanceProtocol: HTTP
                      LoadBalancerPort: 443
                      Protocol: HTTPS
                      SSLCertificateId: arn:aws:iam::123456789101:server-certificate/cloudfront/example
                    PolicyNames:
                    - website-front-preprod
                    - ELBSecurityPolicy-2016-08
                  LoadBalancerName: WEBSITE-FRONT-PREPROD
                  Policies:
                    AppCookieStickinessPolicies:
                    LBCookieStickinessPolicies:
                    - CookieExpirationPeriod: 3600
                      PolicyName: AWSConsole-LBCookieStickinessPolicy-WEBSITE-FRONT-PREPROD-1473338142315
                    - CookieExpirationPeriod: 3600
                      PolicyName: AWSConsole-LBCookieStickinessPolicy-WEBSITE-FRONT-PREPROD-1473337367977
                    - CookieExpirationPeriod: 3600
                      PolicyName: website-front-preprod
                    - CookieExpirationPeriod: 3600
                      PolicyName: AWSConsole-LBCookieStickinessPolicy-WEBSITE-FRONT-PREPROD-1473337375883
                    OtherPolicies:
                    - ELBSecurityPolicy-2016-08
                  Scheme: internet-facing
                  SecurityGroups:
                  - sg-9b494ffc
                  SourceSecurityGroup:
                    GroupName: website-elb-front-preprod
                    OwnerAlias: '123456789101'
                  Subnets:
                  - subnet-550fac31
                  - subnet-6b5a8f1d
                  - subnet-b95dbde1
                  VPCId: vpc-21fb3e45
                  Tags: []
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/load_balancers_v2':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of load balancers (ELB v2 or a.k.a ALB)  of the running
        AWS infrastructure and associated with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSLoadBalancersV2
      responses:
        '200':
          description: >-
            The list of AWS load balancers (ELB v2 or a.k.a ALB) which matches
            the scope specified by the filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceLoadBalancerV2'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - AvailabilityZones:
                  - LoadBalancerAddresses:
                    SubnetId: subnet-225f3155
                    ZoneName: eu-west-1b
                  - LoadBalancerAddresses:
                    SubnetId: subnet-74f1712d
                    ZoneName: eu-west-1c
                  - LoadBalancerAddresses:
                    SubnetId: subnet-cd793fa8
                    ZoneName: eu-west-1a
                  CanonicalHostedZoneId: Z32O12XQLNTSW2
                  CreatedTime: '2016-12-14T15:32:58.83Z'
                  DNSName: alb-amazon-front-prex-1234567890.eu-west-1.elb.amazonaws.com
                  IpAddressType: ipv4
                  LoadBalancerArn: arn:aws:elasticloadbalancing:eu-west-1:123456789101:loadbalancer/app/alb-amazon-front-prex/f81f78ed3ec382cf
                  LoadBalancerName: alb-amazon-front-prex
                  Scheme: internet-facing
                  SecurityGroups:
                  - sg-4c10e028
                  State:
                    Code: active
                    Reason:
                  Type: application
                  VpcId: vpc-315ed454
                  Tags: []
                - AvailabilityZones:
                  - LoadBalancerAddresses:
                    SubnetId: subnet-3ba8a072
                    ZoneName: eu-west-1b
                  - LoadBalancerAddresses:
                    SubnetId: subnet-45d1d622
                    ZoneName: eu-west-1a
                  - LoadBalancerAddresses:
                    SubnetId: subnet-6b034030
                    ZoneName: eu-west-1c
                  CanonicalHostedZoneId: Z32O12XQLNTSW2
                  CreatedTime: '2017-12-19T09:12:39.84Z'
                  DNSName: amazon-apicache-staging-1234567890.eu-west-1.elb.amazonaws.com
                  IpAddressType: ipv4
                  LoadBalancerArn: arn:aws:elasticloadbalancing:eu-west-1:123456789101:loadbalancer/app/amazon-apicache-staging/f6404ce290fc3434
                  LoadBalancerName: amazon-apicache-staging
                  Scheme: internet-facing
                  SecurityGroups:
                  - sg-02510079
                  State:
                    Code: active
                    Reason:
                  Type: application
                  VpcId: vpc-d7d3cdb0
                  Tags:
                  - Key: client
                    Value: cycloid
                - AvailabilityZones:
                  - LoadBalancerAddresses:
                    SubnetId: subnet-1fe9cf69
                    ZoneName: eu-west-1b
                  - LoadBalancerAddresses:
                    SubnetId: subnet-5e614d3a
                    ZoneName: eu-west-1a
                  - LoadBalancerAddresses:
                    SubnetId: subnet-5ecca206
                    ZoneName: eu-west-1c
                  CanonicalHostedZoneId: Z32O12XQLNTSW2
                  CreatedTime: '2017-12-19T17:08:25.2Z'
                  DNSName: amazon-apicache-dev-1234567890.eu-west-1.elb.amazonaws.com
                  IpAddressType: ipv4
                  LoadBalancerArn: arn:aws:elasticloadbalancing:eu-west-1:123456789101:loadbalancer/app/amazon-apicache-dev/9f76887ef888cf4a
                  LoadBalancerName: amazon-apicache-dev
                  Scheme: internet-facing
                  SecurityGroups:
                  - sg-3980d042
                  State:
                    Code: active
                    Reason:
                  Type: application
                  VpcId: vpc-257d2d41
                  Tags: []
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/security_groups':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of security groups of the running AWS infrastructure and
        associated with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSSecurityGroups
      responses:
        '200':
          description: >-
            The list of AWS security groups which matches the scope specified
            by the filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceSecurityGroup'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - Description: Allow metrics server to collect metrics
                  GroupId: sg-35c7b54e
                  GroupName: test_allow_metrics
                  IpPermissions:
                  - FromPort: 9100
                    IpProtocol: tcp
                    IpRanges:
                    Ipv6Ranges:
                    PrefixListIds:
                    ToPort: 9100
                    UserIdGroupPairs:
                    - Description:
                      GroupId: sg-cada71ad
                      GroupName:
                      PeeringStatus: active
                      UserId: '123456789101'
                      VpcId: vpc-21fb3e45
                      VpcPeeringConnectionId: pcx-ab75ccc2
                  IpPermissionsEgress:
                  - FromPort:
                    IpProtocol: "-1"
                    IpRanges:
                    - CidrIp: 0.0.0.0/0
                      Description:
                    Ipv6Ranges:
                    PrefixListIds:
                    ToPort:
                    UserIdGroupPairs:
                  OwnerId: '123456789101'
                  Tags:
                  - Key: project
                    Value: infra
                  - Key: Name
                    Value: allow-metrics
                  - Key: client
                    Value: cycloid
                  VpcId: vpc-0296ad66
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/snapshots':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of snapshots of the running AWS infrastructure and associated
        with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSSnapshots
      responses:
        '200':
          description: >-
            The list of AWS snapshots which matches the scope specified by the
            filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceSnapshot'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - DataEncryptionKeyId:
                  Description: Created by CreateImage(i-7c6ea6bc) for ami-67affc14 from vol-fadc527c
                  Encrypted: false
                  KmsKeyId:
                  OwnerAlias:
                  OwnerId: '123456789101'
                  Progress: 100%
                  SnapshotId: snap-f4c73492
                  StartTime: '2016-11-17T16:17:18Z'
                  State: completed
                  StateMessage:
                  Tags: []
                  VolumeId: vol-fadc527c
                  VolumeSize: 8
                - DataEncryptionKeyId:
                  Description: Created by CreateImage(i-78a845ee) for ami-9d5a09ee from vol-73d82bc3
                  Encrypted: false
                  KmsKeyId:
                  OwnerAlias:
                  OwnerId: '123456789101'
                  Progress: 100%
                  SnapshotId: snap-94f92ff2
                  StartTime: '2016-11-16T16:46:39Z'
                  State: completed
                  StateMessage:
                  Tags: []
                  VolumeId: vol-73d82bc3
                  VolumeSize: 8
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/subnets':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of subnets of the running AWS infrastructure and associated
        with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSSubnets
      responses:
        '200':
          description: >-
            The list of AWS subnets instances which matches the scope specified
            by the filter.
          schema:
            type: object
            description: >-
              Although this response contains a collection of items, it doesn't
              have pagination because the AWS SDK, to request the subnets
              resources, doesn't provide any pagination mechanism.
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceSubnet'
          examples:
            application/json:
              data:
                - AssignIpv6AddressOnCreation: false
                  AvailabilityZone: eu-west-1b
                  AvailableIpAddressCount: 251
                  CidrBlock: 10.50.3.0/24
                  DefaultForAz: false
                  Ipv6CidrBlockAssociationSet:
                  MapPublicIpOnLaunch: false
                  State: available
                  SubnetId: subnet-373f3241
                  Tags:
                  - Key: client
                    Value: cycloid
                  - Key: Name
                    Value: private-subnet-eu-west-1b
                  VpcId: vpc-0296ad66
                - AssignIpv6AddressOnCreation: false
                  AvailabilityZone: eu-west-1a
                  AvailableIpAddressCount: 251
                  CidrBlock: 10.50.1.0/24
                  DefaultForAz: false
                  Ipv6CidrBlockAssociationSet:
                  MapPublicIpOnLaunch: false
                  State: available
                  SubnetId: subnet-6e131c0a
                  Tags:
                  - Key: client
                    Value: cycloid
                  - Key: Name
                    Value: private-subnet-eu-west-1a
                  VpcId: vpc-0296ad66
                - AssignIpv6AddressOnCreation: false
                  AvailabilityZone: eu-west-1a
                  AvailableIpAddressCount: 251
                  CidrBlock: 10.51.1.0/24
                  DefaultForAz: false
                  Ipv6CidrBlockAssociationSet:
                  MapPublicIpOnLaunch: false
                  State: available
                  SubnetId: subnet-76131c12
                  Tags:
                  - Key: client
                    Value: cycloid
                  - Key: Name
                    Value: private-subnet-eu-west-1a
                  VpcId: vpc-0c96ad68
                - AssignIpv6AddressOnCreation: false
                  AvailabilityZone: eu-west-1c
                  AvailableIpAddressCount: 251
                  CidrBlock: 10.42.0.0/24
                  DefaultForAz: false
                  Ipv6CidrBlockAssociationSet:
                  MapPublicIpOnLaunch: true
                  State: available
                  SubnetId: subnet-b95dbde1
                  Tags:
                  - Key: client
                    Value: cycloid
                  - Key: Name
                    Value: public-subnet-eu-west-1c
                  VpcId: vpc-21fb3e45
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/volumes':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/aws_next_token'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of volumes of the running AWS infrastructure and associated
        with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSVolumes
      responses:
        '200':
          description: >-
            The list of AWS volumes which matches the scope specified by the
            filter.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceVolume'
              pagination:
                $ref: '#/definitions/PaginationAWS'
          examples:
            application/json:
              data:
                - Attachments:
                  - AttachTime: '2017-04-26T09:31:12Z'
                    DeleteOnTermination: false
                    Device: "/dev/xvdf"
                    InstanceId: i-02e0848c23c9cf89d
                    State: attached
                    VolumeId: vol-0e976363ad5f4f523
                  AvailabilityZone: eu-west-1c
                  CreateTime: '2017-04-26T09:30:51.516Z'
                  Encrypted: false
                  Iops:
                  KmsKeyId:
                  Size: 10
                  SnapshotId: ''
                  State: in-use
                  Tags:
                  - Key: Name
                    Value: cycloid-kubernetes-etcd2-eu-we1-prod
                  VolumeId: vol-0e976363ad5f4f523
                  VolumeType: standard
                - Attachments:
                  - AttachTime: '2016-09-02T08:07:12Z'
                    DeleteOnTermination: true
                    Device: "/dev/xvda"
                    InstanceId: i-2000dcad
                    State: attached
                    VolumeId: vol-c888994f
                  AvailabilityZone: eu-west-1b
                  CreateTime: '2016-09-02T08:07:12.162Z'
                  Encrypted: false
                  Iops:
                  KmsKeyId:
                  Size: 10
                  SnapshotId: snap-de88bcce
                  State: in-use
                  Tags: []
                  VolumeId: vol-c888994f
                  VolumeType: standard
                - Attachments:
                  - AttachTime: '2016-09-02T08:07:12Z'
                    DeleteOnTermination: true
                    Device: "/dev/xvda"
                    InstanceId: i-ab00dc26
                    State: attached
                    VolumeId: vol-01889986
                  AvailabilityZone: eu-west-1b
                  CreateTime: '2016-09-02T08:07:12.887Z'
                  Encrypted: false
                  Iops:
                  KmsKeyId:
                  Size: 10
                  SnapshotId: snap-de88bcce
                  State: in-use
                  Tags: []
                  VolumeId: vol-01889986
                  VolumeType: standard
              pagination:
                next: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/infrastructures/aws/vpcs':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/credential_canonical_query'
        - $ref: '#/parameters/project_canonical_query'
        - $ref: '#/parameters/aws_tags'
      tags:
        - Organization Infrastructure
      deprecated: true
      description: >-
        Get the list of VPCs of the running AWS infrastructure and associated
        with the AWS account (credential).
        The parameters allow to select the scope of the request to one project
        of the organization.
      operationId: getRunningInfraAWSVPCs
      responses:
        '200':
          description: >-
            The list of AWS VPCs which matches the scope specified by the
            filter.
          schema:
            description: >-
              Although this response contains a collection of items, it doesn't
              have pagination because the AWS SDK, to request the VPCs resources,
              doesn't provide any pagination mechanism.
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/AWSInfrastructureResourceVPC'
          examples:
            application/json:
              data:
                - CidrBlock: 172.31.0.0/16
                  CidrBlockAssociationSet:
                  - AssociationId: vpc-cidr-assoc-5bd62d32
                    CidrBlock: 172.31.0.0/16
                    CidrBlockState:
                      State: associated
                      StatusMessage:
                  DhcpOptionsId: dopt-2e748c47
                  InstanceTenancy: default
                  Ipv6CidrBlockAssociationSet:
                  IsDefault: true
                  State: available
                  Tags: []
                  VpcId: vpc-462bd42f
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/inventory':
    parameters:
      - $ref: '#/parameters/jwt'
    get:
      consumes:
        - application/json
      security: []
      tags:
        - Organization Inventory
      description: >-
        Get the state
      operationId: getState
      responses:
        '200':
          description: Get the state of an organization
          schema:
            type: object
            description: The state of an organization
            required:
              - data
            properties:
              data:
                type: object
          examples:
            application/json:
              data:
                  terraform version: "0.12.28"
                  version: 1
                  serial: 1
                  lineage: "2f9ab173-9fc7-965b-c17d-2e43868f14cf"
                  resources:
                    - id: 1
                      provider: "aws"
                      type: "aws_instance"
                      name: "front"
                      module: "module.kapsule"
                      instances:
                        attributes: 
                          id: "sg-0e74bbe876eba7e6f"
                          ingress:
                           cidr_blocks: []
                           description: ""
                           from_port: 80
                           ipv6_cidr_blocks: []
                           prefix_list_ids: []
                           protocol: "tcp"
                           security_groups: ["sg-0cfe32960213dea69"]
                           self: false
                           to_port: 80
                        custom_attributes: 
                          custom_att: "sg-0e74bbe876eba7e6f"
                      outputs:
                        alb_front_dns_name: 
                          value: "cycloidio-website-front-prod-119239496.eu-west-1.elb.amazonaws.com"
                          type: "string"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      consumes:
        - application/json
      security: []
      tags:
        - Organization Inventory
      description: Create or update an Inventory State
      operationId: createOrUpdateState
      parameters:
        - in: body
          name: body
          description: The information of the Inventory new data
          required: true
          schema:
            type: object
      responses:
        '204':
          description: Success update
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        '423':
          $ref: '#/responses/locked_state'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/inventory':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organization Inventory
      description: >-
        List the inventory resources
      operationId: listInventoryResources
      responses:
        '200':
          description: List the Inventory Resources
          schema:
            type: object
            required:
              - data
              - pagination
              - filterss
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/InventoryResource'
              pagination:
                $ref: '#/definitions/Pagination'
              filters:
                $ref: '#/definitions/Filters'
          examples:
            application/json:
              data:
                - id: 1
                  provider: "aws"
                  type: "aws_instance"
                  name: "front"
                  module: "module.kapsule"
                  attributes: 
                    id: "sg-0e74bbe876eba7e6f"
                    ingress:
                     cidr_blocks: []
                     description: ""
                     from_port: 80
                     ipv6_cidr_blocks: []
                     prefix_list_ids: []
                     protocol: "tcp"
                     security_groups: ["sg-0cfe32960213dea69"]
                     self: false
                     to_port: 80
                  custom_attributes: 
                    custom_att: "sg-0e74bbe876eba7e6f"
              filters:
                types: ["aws_instance"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/inventory/resources':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      tags:
        - Organization Inventory
      description: Create an Inventory Resource
      operationId: createInventoryResource
      parameters:
        - in: body
          name: body
          description: The information of the Inventory new resource data
          required: true
          schema:
            $ref: '#/definitions/NewInventoryResource'
      responses:
        '204':
          description: Resource Created
        '403':
          $ref: '#/responses/not_enough_permissions'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/inventory/resource_types':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organization Inventory
      parameters:
        - $ref: '#/parameters/inventory_resource_provider_query'
      description: List Resource Types
      operationId: listResourceTypes
      responses:
        '200':
          description: Get Resource Types
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  type: string
        '403':
          $ref: '#/responses/not_enough_permissions'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/inventory/resource_labels':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organization Inventory
      description: List Resource Labels
      operationId: listResourceLabels
      responses:
        '200':
          description: Get Resource Labels
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/InventoryResourceLabel'
        '403':
          $ref: '#/responses/not_enough_permissions'
        default:
          $ref: '#/responses/unexpected_error'
  '/inventory/lock':
    parameters:
      - $ref: '#/parameters/jwt'
    post:
      consumes:
        - application/json
      security: []
      tags:
        - Organization Inventory
      description: Locks an Inventory State
      operationId: lockState
      parameters:
        - in: body
          name: body
          description: The information of the Inventory new data
          required: true
          schema:
            $ref: '#/definitions/StateLock'
      responses:
        '200':
          description: Lock ID of the Organization Inventory State
          schema:
            type: object
            description: The Inventory from the Project's environment
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/StateLock'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      consumes:
        - application/json
      security: []
      tags:
        - Organization Inventory
      description: unlocks an State of Inventory
      operationId: unlockState
      parameters:
        - in: body
          name: body
          description: The information of the Inventory new data
          required: true
          schema:
            $ref: '#/definitions/StateLock'
      responses:
        '204':
          description: Unlocking the Status of an Organization Status Inventory Item
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/inventory/resources/{inventory_resource_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/inventory_resource_id'
    get:
      tags:
        - Organization Inventory
      description: Get the inventory resource by the ID
      operationId: getInventoryResource
      responses:
        '200':
          description: Resource with the given ID
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/InventoryResource'
          examples:
            application/json:
              id: 1
              provider: "aws"
              type: "aws_instance"
              name: "front"
              module: "module.kapsule"
              attributes: 
                id: "sg-0e74bbe876eba7e6f"
                ingress:
                 cidr_blocks: []
                 description: ""
                 from_port: 80
                 ipv6_cidr_blocks: []
                 prefix_list_ids: []
                 protocol: "tcp"
                 security_groups: ["sg-0cfe32960213dea69"]
                 self: false
                 to_port: 80
              custom_attributes: 
                custom_att: "sg-0e74bbe876eba7e6f"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Inventory
      description: Delete an Inventory Resource
      operationId: deleteInventoryResource
      responses:
        '204':
          description: Inventory Resource deleted
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization Inventory
      description: Create an Inventory Resource
      operationId: updateInventoryResource
      parameters:
        - in: body
          name: body
          description: The information of the Inventory new data
          required: true
          schema:
            $ref: '#/definitions/NewInventoryResource'
      responses:
        '200':
          description: The updated Inventory Resource
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/InventoryResource'
          examples:
            application/json:
              data:
                id: 1
                provider: "aws"
                type: "aws_instance"
                name: "front"
                module: "module.kapsule"
                attributes: 
                  id: "sg-0e74bbe876eba7e6f"
                  ingress:
                   cidr_blocks: []
                   description: ""
                   from_port: 80
                   ipv6_cidr_blocks: []
                   prefix_list_ids: []
                   protocol: "tcp"
                   security_groups: ["sg-0cfe32960213dea69"]
                   self: false
                   to_port: 80
                custom_attributes: 
                  custom_att: "sg-0e74bbe876eba7e6f"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/inventory-plan':
    parameters:
      - $ref: '#/parameters/jwt'
    get:
      consumes:
        - application/json
      security: []
      tags:
        - Organization Inventory Plan
      description: >-
        Get the terraform plan of the inventory. It uses '-' as the Concourse resource that
        uses it automatically adds '-plan' on it's implementation to push the plan. So to
        simplify the configuration we use '-' also.
      operationId: getInventoryPlan
      responses:
        '200':
          description: Get the plan of an inventory
          schema:
            type: object
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      consumes:
        - application/json
      security: []
      tags:
        - Organization Inventory Plan
      description: Create or replace an Inventory plan
      operationId: setInventoryPlan
      parameters:
        - in: body
          name: body
          description: The plan of the Inventory
          schema: 
            type: object
      responses:
        '204':
          description: Success update
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/kpis':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical_query'
      - $ref: '#/parameters/environment_canonical_query'
      - $ref: '#/parameters/timestamp_range_begin_query'
      - $ref: '#/parameters/timestamp_range_end_query'
      - $ref: '#/parameters/kpi_retrieve_data'
      - $ref: '#/parameters/page_index'
      - $ref: '#/parameters/page_size'
      - $ref: '#/parameters/favorite'
    get:
      tags:
          - Organization kpis
      description: Get the list of configured organization KPIs
      operationId: getKpis
      responses:
        '200':
          description: The list of the KPIs
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/KPI'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 1
                  name: "My KPI 1"
                  canonical: "my-kpi-1"
                  type: "buildavgtime"
                  widget: "doughnut"
                  description: "This KPI shows the code coverage of your code on an environment"
                  project_canonical: "project1"
                  environment_canonical: "env1"
                  pipeline_name: "pipeline1"
                  job_name: "job1"
                  data_set:
                    - ["date", "time"]
                    - [1607904000, 39]
                    - [1607817600, 140]
                  created_at: 1503224026
                  updated_at: 1503224526
                  error: "Something went wrong while importing"
                  favorite: true
                - id: 2
                  name: "My KPI 2"
                  canonical: "my-kpi-2"
                  type: "timetorelease"
                  widget: "line"
                  conf:
                    envs: ["staging", "preprod", "prod"]
                  description: "This KPI shows how long time passes between deployment on your different environment"
                  project_canonical: "project2"
                  data_set:
                    - ["date", "env", "version", "duration", "final", "released"]
                    - [1592100100, "dev", "v1", 50, false, true]
                    - [1592100280, "dev", "v2", 95, false, true]
                    - [1592100500, "dev", "v3", 160, false, true]
                    - [1592101700, "dev", "v4", 0, false, false]
                    - [1592100150, "staging", "v1", 850, false, true]
                    - [1592100375, "staging", "v2", 625, false, true]
                    - [1592100660, "staging", "v3", 340, false, true]
                    - [1592101000, "prod", "v3", 0, true, false]
                  created_at: 1503227026
                  updated_at: 1503227526
                  error: ""
                  favorite: true
                - id: 10
                  name: "My KPI 10"
                  canonical: "my-kpi-10"
                  type: "codecoverage"
                  widget: "doughnut"
                  description: "This KPI shows the code coverage of your code on an environment"
                  project_canonical: "project2"
                  environment_canonical: "env2"
                  pipeline_name: ""
                  job_name: ""
                  data_set:
                    - ["date", "coverage"]
                    - [1592100100, 13.4]
                    - [1592100150, 28.0]
                    - [1592100280, 85.2]
                    - [1592100375, 83.9]
                  created_at: 1503225026
                  updated_at: 1503225526
                  error: ""
                  favorite: false
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization kpis
      description: Save information about the KPI
      operationId: createKpi
      parameters:
        - in: body
          name: body
          description: The information of the KPI
          required: true
          schema:
            $ref: '#/definitions/NewKPI'
      responses:
        '200':
          description: KPI has been configured
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/KPI'
          examples:
            application/json:
              data:
                id: 1
                name: "My KPI 1"
                canonical: "my-kpi-1"
                type: "buildavgtime"
                widget: "doughnut"
                description: "This KPI shows the code coverage of your code on an environment"
                project_canonical: "project1"
                environment_canonical: "env1"
                pipeline_name: "pipeline1"
                job_name: "job1"
                created_at: 1503224026
                updated_at: 1503224526
                error: "Something went wrong while importing"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/kpis/{kpi_canonical}/favorites':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/kpi_canonical'
    post:
      tags:
        - Organization kpis
      description: Add a kpi in the user favorites list.
      operationId: createKPIFavorite
      responses:
        '204':
          description: The kpi has been added to user favorites list.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization kpis
      description: Remove a kpi from the user favorites list.
      operationId: deleteKPIFavorite
      responses:
        '204':
          description: The kpi has been removed from user favorites list.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/kpis/{kpi_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/kpi_canonical'
      - $ref: '#/parameters/timestamp_range_begin_query'
      - $ref: '#/parameters/timestamp_range_end_query'
      - $ref: '#/parameters/kpi_retrieve_data'
    get:
      tags:
        - Organization kpis
      description: Get the KPI
      operationId: getKpi
      responses:
        '200':
          description: The KPI
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/KPI'
          examples:
            application/json:
              data:
                id: 1
                name: "My KPI 1"
                canonical: "my-kpi-1"
                type: "buildavgtime"
                widget: "doughnut"
                description: "This KPI shows the code coverage of your code on an environment"
                project_canonical: "project1"
                environment_canonical: "env1"
                pipeline_name: "pipeline1"
                job_name: "job1"
                data_set:
                  - ["date", "time"]
                  - [1607904000, 39]
                  - [1607817600, 140]
                created_at: 1503224026
                updated_at: 1503224526
                error: ""
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization kpis
      description: Update a KPI
      operationId: updateKpi
      parameters:
        - in: body
          name: body
          description: The information of the KPI new data
          required: true
          schema:
            $ref: '#/definitions/NewKPI'
      responses:
        '200':
          description: Success update
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/KPI'
          examples:
            application/json:
              data:
                id: 11
                name: "My KPI 11"
                canonical: "my-kpi-11"
                type: "buildavgtime"
                widget: "doughnut"
                description: "This KPI shows the code coverage of your code on an environment"
                project_canonical: "project1"
                environment_canonical: "env1"
                pipeline_name: "pipeline1"
                job_name: "job1"
                created_at: 1503224026
                updated_at: 1503224526
                error: ""
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization kpis
      description: delete a KPI
      operationId: deleteKpi
      responses:
        '204':
          description: Organization's KPI has been deleted
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  /organizations/{organization_canonical}/licence:
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organization licence
      description: >-
        Get currently active licence.
      operationId: getLicence
      security: []
      responses:
        '200':
          description: Currently active licence entity.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Licence'
          examples:
            application/json:
              data:
                key: "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55X25hbWUiOiJjeWNsb2lkIiwiZW1haWxfYWRkcmVzcyI6ImN5Y2xvaWRAb2ZmaWNlLmlvIiwibWVtYmVyc19jb3VudCI6NSwiZXhwaXJlc19hdCI6IjIwMjItMTItMTNUMDA6MDA6MDBaIiwidmVyc2lvbiI6IjEiLCJhdWQiOiJjeWNsb2lkIiwianRpIjoiNGE1ZTQzMDYtNmUwMy00MjFmLTllM2ItY2VlZmJhZjMyNDk0IiwiaWF0IjoxNjExMzE2NjUwLCJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJuYmYiOjE2MTEzMTY2NTAsInN1YiI6Imh0dHBzOi8vY3ljbG9pZC5pbyJ9.Z_DvpqprGU0uW26vkpzdTYvyC4imiw0AY1FJMmpeEyVkfYlRI2Q1MWcFZPxMaTafi1TAjwwJOxdY1fxnghMfKng4-4dEtPhcsJQy3nC_ODyACtxDpZMRRaIb8pzBN7AqFvBWWPVKAdqfYXI7IZMX5jjIfaFHtzzs5OnXwQ9USl4"
                created_at: 1503225026
                updated_at: 1503225026
                company_name: "Cycloid"
                email_address: "email@cycloid.io"
                expires_at: 1503226026
                members_count: 5
                version: "1"
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization licence
      description: >-
        Activate Cycloid's licence. If another licence already exists, 
        it will be overwritten
      operationId: activateLicence
      parameters:
        - in: body
          name: body
          description: The licence key
          required: true
          schema:
            $ref: '#/definitions/NewLicence'
      security: []
      responses:
        '204':
          description: The product has been activated
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/logs/sources':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/environment_canonical'
    get:
      tags:
        - Organization Logs
      description: >-
        Get the list of sources configured for the specified project's
        environment of the organization.
      operationId: getProjEnvLogSources
      responses:
        '200':
          description: The list of sources related to the project's environment.
          schema:
            type: object
            description: The list of log sources.
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/LogSource'
          examples:
            application/json:
              data:
                - id: 'access.log'
                - id: 'exception.log'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/logs/sources/{log_source_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/environment_canonical'
      - $ref: '#/parameters/log_source_id'
    get:
      parameters:
        - $ref: '#/parameters/timestamp_range_begin_query_ms'
        - $ref: '#/parameters/timestamp_range_end_query_ms'
        - $ref: '#/parameters/raw_query'
      tags:
        - Organization Logs
      description: >-
        Get log's entries information  of the specified log stream stream which
        is associated to the project's environment of the specified organization.
        The log's entries to request can be filtered using the unix timestamp
        ranges and/or the query as follow
        - When unix timestamps are defined, they are converted to the specific
          query language used by the configured underlying log system (e.g AWS
          Cloud Watch, ElasticSearch, etc.) and appended to the query value
          respecting the syntax but not checking the content of the query, which
          means that if the whole query must be enclosed by curly brackets hence
          the query value is enclosed on them, the time range filter will be
          added inside not just appended at the end, because otherwise it would
          cause wrong syntax; on the other hand, not checking the content means
          that if the query contains a timerange filter, the whole query will
          contain both and the result will be the one returned by on the
          underlying log system, being an error or not.
        - When no time range are defined, then the query is used as it has been
          send, there is not modification on the query to send to the underlying
          log system, hence the result will be the one returned by it.
        - If none of the filters (timestamp range and query) are sent, then
          a 422 status code will be responded.
        - Some constraints are established by the underlying log system, so
          depending which one has been configured some parameters may be
          required or not.
      operationId: getProjEnvLogEntries
      responses:
        '200':
          description: >-
            The list of log's entries which are comprehended by the begin and
            end timestamps and are selected by the optional query.
          schema:
            type: object
            description: The list of log lines
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/LogSourceEntry'
          examples:
            application/json:
              data:
                - timestamp: "0123456789"
                  host: 'theowlhost'
                  message: '178.154.171.21 - - [21/Sep/2017:02:51:22 +0200] "GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg HTTP/1.0" 302 773 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"'
                - timestamp: "0123456795"
                  host: 'mymon'
                  message: '141.8.132.28 - - [21/Sep/2017:02:51:27 +0200] "GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/ HTTP/1.0" 302 731 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"'
                - timestamp: "0123456800"
                  host: 'theowlhost'
                  message: '46.229.168.65 - - [21/Sep/2017:02:51:28 +0200] "GET /mosquitera-enrollable-lateral.html HTTP/1.0" 200 25313 "-" "Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)"'
                - timestamp: "0123456805"
                  host: 'mymon'
                  message: '141.10.132.56 - - [21/Sep/2017:02:51:56 +0200] "GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/ HTTP/1.0" 302 731 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"'
                - timestamp: "0123456810"
                  host: 'burrowing'
                  message: '46.229.168.65 - - [21/Sep/2017:02:52:03 +0200] "GET /mosquitera-enrollable-lateral.html HTTP/1.0" 200 25313 "-" "Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)"'
                - timestamp: "0123456823"
                  host: 'theowlhost'
                  message: '141.10.132.56 - - [21/Sep/2017:02:52:23 +0200] "GET /1663-large_default/tienda-de-campana-basica-para-2-personas.jpg/ HTTP/1.0" 302 731 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"'
                - timestamp: "0123456834"
                  host: 'elf'
                  message: '123.229.145.65 - - [21/Sep/2017:02:52:49 +0200] "GET /mosquitera-enrollable-lateral.html HTTP/1.0" 200 25313 "-" "Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)"'
                - timestamp: "0123456834"
                  host: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaelf'
                  message: '123.229.145.65 - - [21/Sep/2017:02:52:49 +0200] "GET /mosquitera-enrollable-lateral.html HTTP/1.0" 200 25313 "-" "Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)"'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/members':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/invitation_state_query'
        - in: query
          name: user_given_name
          type: string
          description: Search by the user's given name
        - in: query
          name: user_family_name
          type: string
          description: Search by the user's family name
        - in: query
          name: role_name
          type: string
          description: Search by the role's name
        - in: query
          name: user_canonical
          type: string
          description: Search by the user canonical
        - in: query
          name: user_created_at
          type: integer
          format: uint64
          description: Search by user creation date
        - in: query
          name: member_created_at
          type: integer
          format: uint64
          description: Search by member joining date
        - $ref: '#/parameters/order_by_query'
      tags:
        - Organization members
      description: Get the members of an organization.
      operationId: getOrgMembers
      responses:
        '200':
          description: List of the members of the organization.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/MemberOrg'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  invitation_email: jordi.capdevila@fakeemail.com
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  invitation_state: accepted
                  last_login_at: 1503225576
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                - username: user2
                  id: 1
                  given_name: Jordi
                  family_name: Capdevila
                  invitation_email: jordi.capdevila@fakeemail.com
                  email: jordi.capdevila@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503281026
                  last_login_at: 1503225576
                  invitation_state: accepted
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                - username: user-3
                  id: 1
                  given_name: Ivan
                  family_name: Drago
                  invitation_email: jordi.capdevila@fakeemail.com
                  email: ivan.drago@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1502225026
                  last_login_at: 1503225576
                  invitation_state: accepted
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
              pagination:
                index: 1
                size: 10
                total: 3
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization members
      description: Invite a user to be a member of the organization.
      operationId: inviteUserToOrgMember
      parameters:
        - in: body
          name: body
          description: The user's member invitation.
          required: true
          schema:
            $ref: '#/definitions/NewMemberInvitation'
      responses:
        '200':
          description: The information of the member of the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/MemberOrg'
          examples:
            application/json:
              data:
                id: 1
                username: user2
                given_name: Jordi
                family_name: Capdevila
                invitation_email: jordi.capdevila@fakeemail.com
                email: jordi.capdevila@fakeemail.com
                picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                created_at: 1503281026
                invitation_state: accepted
                role:
                  id: 2
                  name: project manager
                  description: A project manager
                  policies:
                    - id: 21
                      code: 'team:read'
                      entities: []
                      description: Grant the access to read the teams of an organization
                    - id: 22
                      code: 'team:edit'
                      entities: []
                      description: Grant the access to edit teams
                    - id: 60
                      code: 'project:read'
                      entities: []
                      description: Grant the access to projects
                    - id: 61
                      code: 'project:create'
                      entities: []
                      description: Grant the access to create a project in the organization
                    - id: 62
                      code: 'project:edit'
                      entities: []
                      description: Grant the access to edit projects
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/members/{member_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/member_id'
    get:
      tags:
        - Organization members
      description: Get the information of a member of the organization.
      operationId: getOrgMember
      responses:
        '200':
          description: The information of the member of the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/MemberOrg'
          examples:
            application/json:
              data:
                id: 1
                username: user2
                given_name: Jordi
                family_name: Capdevila
                invitation_email: jordi.capdevila@fakeemail.com
                email: jordi.capdevila@fakeemail.com
                picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                created_at: 1503281026
                invitation_state: accepted
                role:
                  id: 2
                  name: project manager
                  description: A project manager
                  policies:
                    - id: 21
                      code: 'team:read'
                      entities: []
                      description: Grant the access to read the teams of an organization
                    - id: 22
                      code: 'team:edit'
                      entities: []
                      description: Grant the access to edit teams
                    - id: 60
                      code: 'project:read'
                      entities: []
                      description: Grant the access to projects
                    - id: 61
                      code: 'project:create'
                      entities: []
                      description: Grant the access to create a project in the organization
                    - id: 62
                      code: 'project:edit'
                      entities: []
                      description: Grant the access to edit projects
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization members
      description: Update member of the organization.
      operationId: updateOrgMember
      parameters:
        - in: body
          name: body
          description: The member information to be updated.
          required: true
          schema:
            $ref: '#/definitions/MemberAssignation'
      responses:
        '200':
          description: The information of the member of the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/MemberOrg'
          examples:
            application/json:
              data:
                id: 1
                username: user2
                given_name: Jordi
                family_name: Capdevila
                invitation_email: jordi.capdevila@fakeemail.com
                email: jordi.capdevila@fakeemail.com
                picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                created_at: 1503281026
                invitation_state: accepted
                role:
                  id: 2
                  name: project manager
                  description: A project manager
                  policies:
                    - id: 21
                      code: 'team:read'
                      entities: []
                      description: Grant the access to read the teams of an organization
                    - id: 22
                      code: 'team:edit'
                      entities: []
                      description: Grant the access to edit teams
                    - id: 60
                      code: 'project:read'
                      entities: []
                      description: Grant the access to projects
                    - id: 61
                      code: 'project:create'
                      entities: []
                      description: Grant the access to create a project in the organization
                    - id: 62
                      code: 'project:edit'
                      entities: []
                      description: Grant the access to edit projects
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization members
      description: Remove a member of the organization.
      operationId: removeOrgMember
      responses:
        '204':
          description: Member has been removed.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/members/{member_id}/resend':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/member_id'
    put:
      tags:
        - Organization members
      description: Resend the email containing the verification token to accept the member Invitation.
      operationId: resendMemberInvitation
      security: []
      responses:
        '204':
          description: The member Invitation has been resent.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/members/verify/{verification_token}':
    parameters:
      - $ref: '#/parameters/verification_token'
    get:
      tags:
        - Organization members
      description: Get the email address used for the pending member invitation
      operationId: getPendingMemberInvitation
      security: []
      responses:
        '200':
          description: The email address used for the pending member invitation
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/PendingMemberInvitation'
          examples:
            application/json:
              data:
                email: user@user.com
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/pipelines':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/concourse_pipeline_name_query'
      - $ref: '#/parameters/project_canonical_query'
      - $ref: '#/parameters/environment_canonical_query'
      - $ref: '#/parameters/statuses_query'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization pipelines
      description: Get all the pipelines that the authenticated user has access to.
      operationId: getPipelines
      responses:
        '200':
          description: List of all the pipelines which authenticated user has access to.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Pipeline'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 154
                  name: approval-resource
                  paused: true
                  archived: false
                  public: false
                  groups: []
                  team_name: cycloid-products
                  environment: dev
                  use_case: "approval-of-resources"
                  created_at: 1500135021
                  updated_at: 1500135021
                  project:
                    id: 5
                    canonical: "proj-1"
                    name: "project1"
                    created_at: 1500135021
                    updated_at: 1500135021
                    service_catalog_ref: "cycloidio:stack-magento"
                - id: 196
                  name: frontend
                  paused: false
                  public: false
                  archived: false
                  environment: dev
                  use_case: "frontend"
                  groups:
                    - name: pull-requests
                      jobs:
                        - pr-code-validate
                      resources: []
                    - name: preprod
                      jobs:
                        - preprod-code-validate
                        - preprod-build-deploy
                      resources: []
                  team_name: cycloid-products
                  created_at: 1500135021
                  updated_at: 1500135021
                  project:
                    id: 5
                    canonical: "proj-1"
                    name: "project1"
                    created_at: 1500135021
                    updated_at: 1500135021
                    service_catalog_ref: "cycloidio:stack-magento"
                - id: 252
                  name: http-api
                  use_case: "ci-cd-pipelines"
                  environment: dev
                  paused: false
                  public: false
                  archived: false
                  groups:
                    - name: all
                      jobs:
                        - code-validation-develop
                        - code-validation-pull-requests
                      resources: []
                    - name: develop
                      jobs:
                        - code-validation-develop
                      resources: []
                    - name: pull-requests
                      jobs:
                        - code-validation-pull-requests
                      resources: []
                  team_name: cycloid-products
                  created_at: 1500135021
                  updated_at: 1500135021
                  project:
                    id: 5
                    canonical: "proj-1"
                    name: "project1"
                    created_at: 1500135021
                    updated_at: 1500135021
                    service_catalog_ref: "cycloidio:stack-magento"
              pagination:
                index: 1
                size: 10
                total: 5
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/pipelines/{inpath_pipeline_name}/diff':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/pipeline_name'
    put:
      parameters:
        - in: body
          name: body
          description: The pipeline configuration
          required: true
          schema:
            $ref: '#/definitions/UpdatePipeline'
      tags:
        - Organization pipelines
      description: The diff between the provided pipeline configuration and the pipeline from the given name.
      operationId: diffPipeline
      responses:
        '200':
          description: The diff between the provided pipeline configuration and the existing pipeline has been done.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/PipelineDiffs'
          examples:
            application/json:
              data:
                jobs:
                - name: foo
                  label: job
                  status: added
                  diff:
                  - delta_type: "+"
                    line: "- terraform-plan-api"
                groups:
                - name: bar
                  label: group
                  status: removed
                  diff:
                  - delta_type: "-"
                    line: "- test-develop"
                resources:
                - name: bli
                  label: resource
                  status: changed
                  diff:
                  - delta_type: "-"
                    line: "  - key: foo"
                  - delta_type: "+"
                    line: "  - key: bar"
                resource_types:
                - name: glop
                  label: resource type
                  status: removed
                  diff:
                  - delta_type: "-"
                    line: "name: terraform"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/pipelines/{inpath_pipeline_name}/synced':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/pipeline_name'
    get:
      tags:
        - Organization pipelines
      description: Will check if the pipeline from the database and the one specified in the stack are synced or not
      operationId: syncedPipeline
      responses:
        '200':
          description: The diff between the stack's pipeline and the existing pipeline if any exists.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/PipelineStatus'
          examples:
            application/json:
              data:
                synced: "out_of_sync"
                error: ""
                diffs:
                  jobs:
                  - name: foo
                    label: job
                    status: added
                    diff:
                    - delta_type: "+"
                      line: "- terraform-plan-api"
                  groups:
                  - name: bar
                    label: group
                    status: removed
                    diff:
                    - delta_type: "-"
                      line: "- test-develop"
                  resources:
                  - name: bli
                    label: resource
                    status: changed
                    diff:
                    - delta_type: "-"
                      line: "  - key: foo"
                    - delta_type: "+"
                      line: "  - key: bar"
                  resource_types:
                  - name: glop
                    label: resource type
                    status: removed
                    diff:
                    - delta_type: "-"
                      line: "name: terraform"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization pipelines
      description: Get the pipelines that the authenticated user has access to.
      operationId: getProjectPipelines
      responses:
        '200':
          description: List of the pipelines which authenticated user has access to.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Pipeline'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 154
                  name: approval-resource
                  paused: true
                  public: false
                  groups: []
                  team_name: cycloid-products
                  environment: dev
                  use_case: "approval-resource"
                  created_at: 1500135021
                  updated_at: 1500135021
                  status: succeeded
                  started: true
                  project:
                    id: 5
                    canonical: "proj-1"
                    name: "project1"
                    created_at: 1500135021
                    updated_at: 1500135021
                    service_catalog_ref: 'cycloidio:stack-magento'
                - id: 196
                  name: frontend
                  paused: false
                  public: false
                  environment: dev
                  use_case: "frontend-use-case"
                  created_at: 1500135021
                  updated_at: 1500135021
                  status: failed
                  started: true
                  groups:
                    - name: pull-requests
                      jobs:
                        - pr-code-validate
                      resources: []
                    - name: preprod
                      jobs:
                        - preprod-code-validate
                        - preprod-build-deploy
                      resources: []
                  team_name: cycloid-products
                  project:
                    id: 5
                    canonical: "proj-1"
                    name: "project1"
                    created_at: 1500135021
                    updated_at: 1500135021
                    service_catalog_ref: 'cycloidio:stack-magento'
                - id: 238
                  name: ci-website
                  paused: true
                  environment: dev
                  public: false
                  use_case: "website-use-case"
                  created_at: 1500135021
                  updated_at: 1500135021
                  status: pending
                  started: true
                  groups:
                    - name: all
                      jobs:
                        - code-validation-preprod
                        - build-container-preprod
                        - tag-container-image-preprod
                        - clean-container-preprod
                      resources: []
                    - name: preprod
                      jobs:
                        - code-validation-preprod
                        - build-container-preprod
                        - tag-container-image-preprod
                        - clean-container-preprod
                      resources: []
                  team_name: cycloid-products
                  project:
                    id: 5
                    canonical: "proj-1"
                    name: "project1"
                    created_at: 1500135021
                    updated_at: 1500135021
                    service_catalog_ref: 'cycloidio:stack-magento'
              pagination:
                index: 1
                size: 10
                total: 5
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      parameters:
        - in: body
          name: body
          description: The configuration of the pipeline to create.
          required: true
          schema:
            $ref: '#/definitions/NewPipeline'
      tags:
        - Organization pipelines
      description: Create a new pipeline
      operationId: createPipeline
      responses:
        '200':
          description: The information of the pipeline which has been created.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Pipeline'
          examples:
            application/json:
              data:
                id: 238
                name: ci-website
                paused: true
                public: false
                environment: dev
                use_case: "website-ci-use-case"
                created_at: 1500135021
                updated_at: 1500135021
                status: "pending"
                started: false
                groups:
                  - name: all
                    jobs:
                      - code-validation-preprod
                      - build-container-preprod
                      - tag-container-image-preprod
                      - clean-container-preprod
                    resources: []
                  - name: preprod
                    jobs:
                      - code-validation-preprod
                      - build-container-preprod
                      - tag-container-image-preprod
                      - clean-container-preprod
                    resources: []
                team_name: cycloid-products
                project:
                  id: 5
                  canonical: "proj-1"
                  name: "project1"
                  created_at: 1500135021
                  updated_at: 1500135021
                  service_catalog_ref: 'cycloidio:stack-magento'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
    get:
      tags:
        - Organization pipelines
      description: Get the configuration of the pipeline.
      operationId: getPipeline
      responses:
        '200':
          description: The information of the pipeline which has the specified name.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Pipeline'
          examples:
            application/json:
              data:
                id: 238
                name: ci-website
                paused: true
                public: false
                environment: dev
                use_case: "website-ci-use-case"
                created_at: 1500135021
                updated_at: 1500135021
                groups:
                  - name: all
                    jobs:
                      - code-validation-preprod
                      - build-container-preprod
                      - tag-container-image-preprod
                      - clean-container-preprod
                    resources: []
                  - name: preprod
                    jobs:
                      - code-validation-preprod
                      - build-container-preprod
                      - tag-container-image-preprod
                      - clean-container-preprod
                    resources: []
                team_name: cycloid-products
                project:
                  id: 5
                  canonical: "proj-1"
                  name: "project1"
                  created_at: 1500135021
                  updated_at: 1500135021
                  service_catalog_ref: 'cycloidio:stack-magento'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization pipelines
      description: Delete the pipeline.
      operationId: deletePipeline
      responses:
        '204':
          description: Pipeline has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      parameters:
        - in: body
          name: body
          description: The pipeline configuration
          required: true
          schema:
            $ref: '#/definitions/UpdatePipeline'
      tags:
        - Organization pipelines
      description: Update the configuration of the given pipeline name.
      operationId: updatePipeline
      responses:
        '200':
          description: The information of the pipeline which has been updated.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Pipeline'
          examples:
            application/json:
              data:
                id: 238
                name: ci-website
                paused: true
                public: false
                environment: dev
                use_case: "website-ci-use-case"
                groups:
                  - name: all
                    jobs:
                      - code-validation-preprod
                      - build-container-preprod
                      - tag-container-image-preprod
                      - clean-container-preprod
                    resources: []
                  - name: preprod
                    jobs:
                      - code-validation-preprod
                      - build-container-preprod
                      - tag-container-image-preprod
                      - clean-container-preprod
                    resources: []
                team_name: cycloid-products
                created_at: 1500135021
                updated_at: 1500135021
                project:
                  id: 5
                  canonical: "proj-1"
                  name: "project1"
                  created_at: 1500135021
                  updated_at: 1500135021
                  service_catalog_ref: 'cycloidio:stack-magento'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/policies':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Policies
      description: Get the list of Policies
      operationId: getPolicies
      responses:
        '200':
          description: List of Policies
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Policy'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 1
                  code: 'organization:delete'
                  description: Grant the access to delete the organization
                - id: 2
                  code: 'organization:edit'
                  description: Grant the access to edit the organization
                - id: 20
                  code: 'team:create'
                  description: Grant the access to create teams
                - id: 21
                  code: 'team:read'
                  description: Grant the access to read the teams of an organization
                - id: 22
                  code: 'team:edit'
                  description: Grant the access to edit teams
                - id: 23
                  code: 'team:delete'
                  description: Grant the access to delete teams
                - id: 40
                  code: 'member:invite'
                  description: >-
                    Grant the access to invite members to join to the
                    organization
                - id: 41
                  code: 'member:remove'
                  description: Grant the access to remove members
                - id: 42
                  code: 'member:read'
                  description: Grant the access to read the members
                - id: 60
                  code: 'project:read'
                  entities: ["10", "32"]
                  description: Grant the access to projects
                - id: 61
                  code: 'project:create'
                  entities: []
                  description: Grant the access to create a project in the organization
                - id: 62
                  code: 'project:edit'
                  entities: []
                  description: Grant the access to edit projects
              pagination:
                index: 1
                size: 10
                total: 2
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/builds/{build_id}/abort':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
      - $ref: '#/parameters/build_id'
    put:
      tags:
        - Organization pipelines jobs build
      description: Abort a specific build.
      operationId: abortBuild
      responses:
        '204':
          description: The build has been aborted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/builds':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
    get:
      tags:
        - Organization pipelines jobs build
      parameters:
        - $ref: '#/parameters/concourse_page_since'
        - $ref: '#/parameters/concourse_page_until'
        - $ref: '#/parameters/concourse_page_limit'
      description: Get the pipeline job's builds that the authenticated user has access to.
      operationId: getBuilds
      responses:
        '200':
          description: >-
            List the pipeline job's builds which authenticated user has access
            to.
          schema:
            type: object
            required:
              - data
              - pagination_concourse
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Build'
              pagination_concourse:
                $ref: '#/definitions/PaginationConcourse'
          examples:
            application/json:
              data:
                - id: 11406
                  team_name: cycloid-products
                  name: '82'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11406
                  pipeline_name: ci-website
                  pipeline_id: 3
                  start_time: 1504185240
                  end_time: 1504185344
                  reap_time: 0
                - id: 11404
                  team_name: cycloid-products
                  name: '81'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11404
                  pipeline_name: ci-website
                  pipeline_id: 3
                  start_time: 1504184979
                  end_time: 1504185078
                  reap_time: 0
                - id: 11402
                  team_name: cycloid-products
                  name: '80'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11402
                  pipeline_name: ci-website
                  pipeline_id: 3
                  start_time: 1504184038
                  end_time: 1504184140
                  reap_time: 0
              pagination_concourse:
                next:
                  since: 11402
                  until: 0
                  limit: 3
                previous:
                  since: 11508
                  until: 0
                  limit: 3
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization pipelines jobs build
      description: Create a new build for the job
      operationId: createBuild
      responses:
        '200':
          description: Create a new build for the pipeline's job and returns its details
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Build'
          examples:
            application/json:
              data:
                id: 11406
                team_name: cycloid-products
                name: '82'
                status: failed
                job_name: build-container-preprod
                api_url: /api/v1/builds/11406
                pipeline_name: ci-website
                pipeline_id: 3
                start_time: 1504185240
                end_time: 1504185344
                reap_time: 0
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/builds/{build_id}/events':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/build_id'
    get:
      tags:
        - Organization pipelines build
      description: Get the events of a build.
      operationId: getBuildEvents
      security:
        - api_key_query: []
      produces:
        - text/event-stream
        - application/json
      responses:
        '200':
          description: Stream is starting
          x-produces:
            - text/event-stream
          headers:
            Content-Type:
              type: string
              enum:
                - text/event-stream
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/builds/{build_id}/plan':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
      - $ref: '#/parameters/build_id'
    get:
      tags:
        - Organization pipelines jobs build
      description: Get the plan of the build.
      operationId: getBuildPlan
      responses:
        '200':
          description: The information of the build's plan which has the specified id.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/PublicPlan'
          examples:
            application/json:
              data:
                schema: exec.v2
                plan:
                  id: 59b6ed1d
                  do:
                    - id: 59b6ed1b
                      get:
                        type: git
                        name: concourse
                        resource: concourse
                        version:
                          ref: 37a827fb8056bfb88848823f49ae8efe9515e2ea
                    - id: 59b6ed1c
                      task:
                        name: build
                        privileged: false
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/builds/{build_id}/preparation':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
      - $ref: '#/parameters/build_id'
    get:
      tags:
        - Organization pipelines jobs build
      description: Get the preparation of the Build.
      operationId: getBuildPreparation
      produces:
        - application/json
      responses:
        '200':
          description: Return the Preparation
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Preparation'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/builds/{build_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
      - $ref: '#/parameters/build_id'
    get:
      tags:
        - Organization pipelines jobs build
      description: Get the information of the build.
      operationId: getBuild
      responses:
        '200':
          description: The information of the build which has the specified id.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Build'
          examples:
            application/json:
              data:
                id: 11406
                team_name: cycloid-products
                name: '82'
                status: failed
                job_name: build-container-preprod
                api_url: /api/v1/builds/11406
                pipeline_name: ci-website
                pipeline_id: 3
                start_time: 1504185240
                end_time: 1504185344
                reap_time: 0
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization pipelines jobs build
      description: Reruns a specific build.
      operationId: rerunBuild
      responses:
        '200':
          description: Returns the new build created from the specified build ID.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Build'
          examples:
            application/json:
              data:
                id: 11406
                team_name: cycloid-products
                name: '82.1'
                status: waiting
                job_name: build-container-preprod
                api_url: /api/v1/builds/11406
                pipeline_name: ci-website
                pipeline_id: 3
                start_time: 1504185240
                end_time: 1504185344
                reap_time: 0
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/builds/{build_id}/resources':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
      - $ref: '#/parameters/build_id'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization pipelines jobs build
      description: Get the resources of the build.
      operationId: getBuildResources
      responses:
        '200':
          description: The resources of the build's which has the specified id.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/BuildInputsOutputs'
          examples:
            application/json:
              data:
                inputs:
                  - name: git-website-preprod
                    resource: git-website-preprod
                    type: git
                    version:
                      ref: 59ecb8ec73d7c4ea4c3827440ed1429268cf4c94
                    metadata:
                      - name: commit
                        value: 59ecb8ec73d7c4ea4c3827440ed1429268cf4c94
                      - name: author
                        value: Adrien Jerphagnon
                      - name: author_date
                        value: '2017-07-19 15:23:46 +0200'
                      - name: committer
                        value: Adrien Jerphagnon
                      - name: committer_date
                        value: '2017-07-19 15:23:46 +0200'
                      - name: branch
                        value: master
                      - name: message
                        value: Up assets version
                    pipeline_id: 238
                    first_occurrence: true
                  - name: vault-preprod
                    resource: vault-preprod
                    type: vault
                    version:
                      date: '1500470493'
                    metadata: []
                    pipeline_id: 238
                    first_occurrence: true
                  - name: vault-preprod
                    resource: vault-preprod
                    type: vault
                    version:
                      date: '1500470521'
                    metadata: []
                    pipeline_id: 238
                    first_occurrence: true
                outputs:
                  - id: 0
                    name: "website preprod"
                    type: ''
                    metadata: []
                    resource: ecr-website-preprod
                    version:
                      digest: >-
                        sha256:58c226280d56dcfe5f7f1de2cce6f22eac36fa95ce8e1b9c604523c4a50d7401
                    enabled: false
                  - id: 0
                    name: "slack alert preprod"
                    type: ''
                    metadata: []
                    resource: slack-alert-preprod
                    version:
                      timestamp: '1500470978'
                    enabled: false
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/config':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
    get:
      tags:
        - Organization pipelines
      description: Get the YAML configuration of the pipeline.
      operationId: getPipelineConfig
      responses:
        200:
          description:
            This endpoint returns the config of the pipeline.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: string
          examples:
            application/json:
              data: "{\"resources\":[{\"name\":\"5m\",\"type\":\"time\",\"source\":{\"interval\":\"5m\"}}],\"jobs\":[{\"name\":\"job-hello-world\",\"public\":true,\"plan\":[{\"get\":\"5m\",\"trigger\":true},{\"task\":\"hello-world\",\"privileged\":true,\"config\":{\"platform\":\"linux\",\"image_resource\":{\"type\":\"docker-image\",\"source\":{\"repository\":\"busybox\"}},\"run\":{\"path\":\"echo\",\"args\":[\"hello world\"]}}}]}]}"
        403:
          $ref: '#/responses/not_enough_permissions'
        404:
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization pipelines jobs
      description: Get the jobs of the pipeline that the authenticated user has access to.
      operationId: getJobs
      responses:
        '200':
          description: List of the pipeline's jobs which authenticated user has access to.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Job'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 1273
                  name: code-validation-preprod
                  paused: false
                  pipeline_id: 1
                  pipeline_name: "fake-pipeline-0"
                  first_logged_build_id: 0
                  disable_manual_trigger: false
                  next_build:
                    id: 11214
                    team_name: ieijcu
                    name: some-build
                    status: running
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  finished_build:
                    id: 11405
                    team_name: cycloid-products
                    name: '33'
                    status: succeeded
                    job_name: code-validation-preprod
                    start_time: 1504185102
                    end_time: 1504185134
                    reap_time: 0
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  inputs:
                    - name: git-website-preprod
                      resource: git-website-preprod
                      passed: []
                      trigger: true
                      tags: []
                  outputs: []
                  groups:
                    - all
                    - preprod
                - id: 1274
                  name: build-container-preprod
                  paused: false
                  first_logged_build_id: 0
                  disable_manual_trigger: false
                  pipeline_id: 1
                  pipeline_name: "fake-pipeline-0"
                  next_build:
                    id: 11214
                    team_name: ieijcu
                    name: some-build
                    status: running
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  finished_build:
                    id: 11406
                    team_name: cycloid-products
                    name: '82'
                    status: failed
                    job_name: build-container-preprod
                    start_time: 1504185240
                    end_time: 1504185344
                    reap_time: 0
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  inputs:
                    - name: git-website-preprod
                      resource: git-website-preprod
                      passed:
                        - code-validation-preprod
                      trigger: true
                      tags: []
                    - name: vault-preprod
                      resource: vault-preprod
                      passed: []
                      trigger: false
                      tags: []
                  outputs:
                    - name: slack-alert-preprod
                      resource: slack-alert-preprod
                    - name: slack-alert-preprod
                      resource: slack-alert-preprod
                    - name: ecr-website-preprod
                      resource: ecr-website-preprod
                  groups:
                    - all
                    - preprod
                - id: 1275
                  name: tag-container-image-preprod
                  paused: false
                  first_logged_build_id: 0
                  disable_manual_trigger: false
                  pipeline_id: 1
                  pipeline_name: "fake-pipeline-0"
                  next_build:
                    id: 11214
                    team_name: ieijcu
                    name: some-build
                    status: running
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  finished_build:
                    id: 10793
                    team_name: cycloid-products
                    name: '16'
                    status: succeeded
                    job_name: tag-container-image-preprod
                    start_time: 1500471046
                    end_time: 1500471211
                    reap_time: 0
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  inputs:
                    - name: git-website-preprod
                      resource: git-website-preprod
                      passed:
                        - build-container-preprod
                      trigger: false
                      tags: []
                    - name: ecr-website-preprod
                      resource: ecr-website-preprod
                      passed:
                        - build-container-preprod
                      trigger: true
                      tags: []
                  outputs:
                    - name: ecr-website-preprod
                      resource: ecr-website-preprod
                  groups:
                    - all
                    - preprod
                - id: 1276
                  name: clean-container-preprod
                  paused: false
                  first_logged_build_id: 0
                  disable_manual_trigger: false
                  pipeline_id: 1
                  pipeline_name: "fake-pipeline-0"
                  next_build:
                    id: 11214
                    team_name: ieijcu
                    name: some-build
                    status: running
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  finished_build:
                    id: 10794
                    team_name: cycloid-products
                    name: '13'
                    status: succeeded
                    job_name: clean-container-preprod
                    start_time: 1500471262
                    end_time: 1500471305
                    reap_time: 0
                    pipeline_id: 1
                    pipeline_name: "fake-pipeline-0"
                  inputs:
                    - name: ecr-website-preprod
                      resource: ecr-website-preprod
                      passed:
                        - tag-container-image-preprod
                      trigger: true
                      tags: []
                  outputs: []
                  groups:
                    - all
                    - preprod
              pagination:
                index: 1
                size: 10
                total: 4
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/pause':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
    put:
      tags:
        - Organization pipelines jobs
      description: Pause a job
      operationId: pauseJob
      responses:
        '204':
          description: Job has been paused.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
    get:
      tags:
        - Organization pipelines jobs
      description: Get the information of the job.
      operationId: getJob
      responses:
        '200':
          description: The configuration of the job which has the specified name.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Job'
          examples:
            application/json:
              data:
                id: 1274
                name: build-container-preprod
                paused: false
                first_logged_build_id: 0
                disable_manual_trigger: false
                next_build:
                  id: 11214
                  team_name: ieijcu
                  name: some-build
                  status: running
                  api_url: /api/v1/builds/11408
                finished_build:
                  id: 11406
                  team_name: cycloid-products
                  name: '82'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11406
                  pipeline_name: ci-website
                  start_time: 1504185240
                  end_time: 1504185344
                  reap_time: 0
                inputs:
                  - name: git-website-preprod
                    resource: git-website-preprod
                    passed:
                      - code-validation-preprod
                    trigger: true
                    tags: []
                  - name: vault-preprod
                    resource: vault-preprod
                    passed: []
                    trigger: false
                    tags: []
                outputs:
                  - name: slack-alert-preprod
                    resource: slack-alert-preprod
                  - name: slack-alert-preprod
                    resource: slack-alert-preprod
                  - name: ecr-website-preprod
                    resource: ecr-website-preprod
                groups:
                  - all
                  - preprod
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/tasks/{step_name}/cache':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
      - $ref: '#/parameters/step_name'
    delete:
      parameters:
        - $ref: '#/parameters/cache_path_query'
      tags:
        - Organization pipelines jobs
      description: Clear task cache
      operationId: clearTaskCache
      responses:
        '200':
          description: Cache has been cleared.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ClearTaskCache'
          examples:
            application/json:
              data:
                caches_removed: 42
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/jobs/{job_name}/unpause':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/job_name'
    put:
      tags:
        - Organization pipelines jobs
      description: Unpause a job
      operationId: unpauseJob
      responses:
        '204':
          description: Job has been unpause.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/pause':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
    put:
      tags:
        - Organization pipelines
      description: Pause a pipeline
      operationId: pausePipeline
      responses:
        '204':
          description: Pipeline has been paused.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/rename':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/pipeline_name_query'
    put:
      tags:
        - Organization pipelines
      description: Rename a pipeline
      operationId: renamePipeline
      responses:
        '204':
          description: Pipeline has been renamed.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/check':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
    post:
      parameters:
        - in: body
          name: body
          description: Check for new version from the specified version.
          required: false
          schema:
            $ref: '#/definitions/CIVersion'
      tags:
        - Organization pipelines resources
      description: Trigger a check for a specified resource.
      operationId: checkResource
      responses:
        '200':
          description: The resource checked result.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Build'
          examples:
            application/json:
              data:
                api_url: "/api/v1/builds/62"
                id: 62
                name: "check"
                pipeline_id: 1
                pipeline_name: "pipeline1"
                resource_name: "5m"
                start_time: 1630426278
                status: "started"
                team_name: "1359872e-88fe-47a7-8c55-923108823a55"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization pipelines resources
      description: Get the resources of the pipeline.
      operationId: getPipelineResources
      responses:
        '200':
          description: The resources of the pipeline's which has the specified name.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Resource'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - name: ecr-website-preprod
                  type: docker-image
                  groups: []
                  paused: false
                  failing_to_check: false
                  check_error: ''
                - name: git-website-preprod
                  type: git
                  groups: []
                  paused: false
                  failing_to_check: false
                  check_error: ''
                - name: vault-preprod
                  type: vault
                  groups: []
                  paused: false
                  failing_to_check: false
                  check_error: ''
                - name: slack-alert-preprod
                  type: slack-notification
                  groups: []
                  paused: false
                  failing_to_check: false
                  check_error: ''
              pagination:
                index: 1
                size: 10
                total: 4
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/pin_comment':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
    put:
      parameters:
        - in: body
          name: body
          description: Specify the comment to put on a pinned resource.
          required: true
          schema:
            $ref: '#/definitions/PinComment'
      tags:
        - Organization pipelines resources
      description: Set pin comment on a specified resource
      operationId: resourceSetPinComment
      responses:
        '204':
          description: Resource pin has been commented
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
    get:
      tags:
        - Organization pipelines resources
      description: Get a specific resource of the pipeline.
      operationId: getResource
      responses:
        '200':
          description: The resource of the pipeline's which has the specified name.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Resource'
          examples:
            application/json:
              data:
                name: ecr-website-preprod
                type: docker-image
                groups: []
                paused: false
                failing_to_check: false
                check_error: ''
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/unpin':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
    put:
      tags:
        - Organization pipelines resources
      description: Unpin a specified resource
      operationId: unpinResource
      responses:
        '204':
          description: Resource has been unpinned
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/versions':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
      - $ref: '#/parameters/filter_version'
    get:
      tags:
        - Organization pipelines resources
      parameters:
        - $ref: '#/parameters/concourse_page_since'
        - $ref: '#/parameters/concourse_page_until'
        - $ref: '#/parameters/concourse_page_limit'
      description: Get versions of a pipeline's resource
      operationId: getResourceVersions
      responses:
        '200':
          description: Get versions of a specified resource.
          schema:
            type: object
            required:
              - data
              - pagination_concourse
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/ResourceVersion'
              pagination_concourse:
                $ref: '#/definitions/PaginationConcourse'
          examples:
            application/json:
              data:
                - id: 45
                  type: time
                  resource: time-resource
                  enabled: true
                  version:
                    time: "2018-06-07T16:12:02.037357287Z"
                - id: 46
                  type: time
                  resource: time-resource
                  enabled: true
                  version:
                    time: "2018-06-07T16:13:02.037357287Z"
              pagination_concourse:
                next:
                  since: 11402
                  until: 0
                  limit: 3
                previous:
                  since: 11896
                  until: 0
                  limit: 3
        '422':
          $ref: '#/responses/unprocessable_entity'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/versions/{resource_version_id}/disable':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
      - $ref: '#/parameters/resource_version_id'
    put:
      tags:
        - Organization pipelines resources
      description: Disable a specified version of a resource
      operationId: disableResourceVersion
      responses:
        '204':
          description: Resource version have been disabled
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/versions/{resource_version_id}/enable':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
      - $ref: '#/parameters/resource_version_id'
    put:
      tags:
        - Organization pipelines resources
      description: Enable a specified version of a resource
      operationId: enableResourceVersion
      responses:
        '204':
          description: Resource version have been enabled
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/versions/{resource_version_id}/input_to':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
      - $ref: '#/parameters/resource_version_id'
    get:
      tags:
        - Organization pipelines resources
      description: Get builds that used a specified resource version as input.
      operationId: getBuildsWithVersionAsInput
      responses:
        '200':
          description: The resource of the pipeline's which has the specified name.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Build'
          examples:
            application/json:
              data:
                - id: 11406
                  team_name: cycloid-products
                  name: '82'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11406
                  pipeline_name: ci-website
                  pipeline_id: 3
                  start_time: 1504185240
                  end_time: 1504185344
                  reap_time: 0
                - id: 11404
                  team_name: cycloid-products
                  name: '81'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11404
                  pipeline_name: ci-website
                  pipeline_id: 3
                  start_time: 1504184979
                  end_time: 1504185078
                  reap_time: 0
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/versions/{resource_version_id}/output_of':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
      - $ref: '#/parameters/resource_version_id'
    get:
      tags:
        - Organization pipelines resources
      description: Get builds that used a specified resource version as output.
      operationId: getBuildsWithVersionAsOutput
      responses:
        '200':
          description: The resource of the pipeline's which has the specified name.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Build'
          examples:
            application/json:
              data:
                - id: 11406
                  team_name: cycloid-products
                  name: '82'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11406
                  pipeline_name: ci-website
                  pipeline_id: 3
                  start_time: 1504185240
                  end_time: 1504185344
                  reap_time: 0
                - id: 11404
                  team_name: cycloid-products
                  name: '81'
                  status: failed
                  job_name: build-container-preprod
                  api_url: /api/v1/builds/11404
                  pipeline_name: ci-website
                  pipeline_id: 3
                  start_time: 1504184979
                  end_time: 1504185078
                  reap_time: 0
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/resources/{resource_name}/versions/{resource_version_id}/pin':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
      - $ref: '#/parameters/resource_name'
      - $ref: '#/parameters/resource_version_id'
    put:
      tags:
        - Organization pipelines resources
      description: Pin a specified version of a resource
      operationId: pinResourceVersion
      responses:
        '204':
          description: Resource version has been pinned
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/unpause':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
    put:
      tags:
        - Organization pipelines
      description: Unpause a pipeline
      operationId: unpausePipeline
      responses:
        '204':
          description: Pipeline has been unpaused.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/pipelines/{inpath_pipeline_name}/variables':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/pipeline_name'
    get:
      tags:
        - Organization pipelines
      description: Get the YAML variables of the pipeline.
      operationId: getPipelineVariables
      responses:
        200:
          description:
            This endpoint returns the variables of the pipeline.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/PipelineVariables'
          examples:
            application/json:
              data:
                yaml_vars: "var1: some_var"
                has_saved_yaml_vars: true
        403:
          $ref: '#/responses/not_enough_permissions'
        404:
          $ref: '#/responses/not_found_entity_in_path'
        409:
          description: Project has no config repository configured
        default:
          $ref: '#/responses/unexpected_error'
  "/organizations/{organization_canonical}/projects":
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/project_name_query'
        - $ref: '#/parameters/project_created_at_query'
        - $ref: '#/parameters/project_description_query'
        - $ref: '#/parameters/project_config_repository_canonical_query'
        - $ref: '#/parameters/service_catalog_source_canonical_query'
        - $ref: '#/parameters/owner_query'
        - $ref: '#/parameters/order_by_query'
        - $ref: '#/parameters/favorite'
        - $ref: '#/parameters/environment_canonical_query'
      tags:
        - Organization projects
      description: Get list of projects of the organization.
      operationId: getProjects
      responses:
        "200":
          description: List of the projects which the organization has.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Project'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: proj-1
                  description: my-description1
                  id: 1
                  cloud_provider:
                    id: 4
                    canonical: "aws"
                    abbreviation: "AWS"
                    name: "Amazon Web Services"
                    created_at: 1503225026
                    updated_at: 1503335026
                  owner:
                    username: user-1
                    id: 1
                    given_name: Mariano
                    family_name: Jimenez
                    email: mariano.jimenez@fakeemail.com
                    picture_url: "https://avatars2.githubusercontent.com/u/14579210"
                    created_at: 1503225026
                    role:
                      id: 17
                      name: existing
                      description: Organization existing role
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: "organization:delete"
                          resources:
                            ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: "organization:team:create"
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: "organization:team:read"
                          resources: ["organization:org-can:team:team-can"]
                  environments:
                    - dev
                    - staging
                    - production
                  service_catalog_name: Magento Stack
                  service_catalog_ref: cycloidio:stack-magento
                  created_at: 1503225026
                  updated_at: 1503335026
                  name: Project 1
                  favorite: true
                - canonical: proj2
                  description: my-description2
                  id: 1
                  cloud_provider:
                    id: 2
                    canonical: "google"
                    abbreviation: "GCP"
                    name: "Google Cloud Platform"
                    created_at: 1503225026
                    updated_at: 1503335026
                  environments:
                    - dev
                    - staging
                  service_catalog_name: Magento Stack 2
                  service_catalog_ref: cycloidio:stack-magento2
                  created_at: 1501131026
                  updated_at: 1503333026
                  name: Project 2
                  favorite: true
                - canonical: proj3
                  description: my-description3
                  id: 1
                  environments: []
                  service_catalog_name: Some other stack
                  service_catalog_ref: cycloidio:stack-something
                  created_at: 1500135021
                  updated_at: 1503332021
                  name: Project 3
                  favorite: true
                - canonical: proj-4
                  description: my-description4
                  id: 1
                  owner:
                    username: user-2
                    id: 10
                    given_name: Mariana
                    family_name: Jimenezo
                    email: mariana.jimenezo@fakeemail.com
                    picture_url: "https://avatars2.githubusercontent.com/u/14579210"
                    created_at: 1503225026
                    role:
                      id: 17
                      name: existing
                      description: Organization existing role
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: "organization:delete"
                          resources:
                            ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: "organization:team:create"
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: "organization:team:read"
                          resources: ["organization:org-can:team:team-can"]
                  environments:
                    - dev
                    - staging
                    - production
                  service_catalog_name: Magento Stack 3
                  service_catalog_ref: cycloidio:stack-magento3
                  created_at: 1500035021
                  updated_at: 1502332021
                  name: Project 4
                  favorite: false
              pagination:
                index: 1
                size: 10
                total: 4
        "403":
          $ref: '#/responses/not_enough_permissions'
        "404":
          $ref: '#/responses/not_found_entity_in_path'
        "422":
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization projects
      description: Create a new project with pipelines in the organization.
      operationId: createProject
      parameters:
        - in: body
          name: body
          description: | 
            The information of the project to create.
          required: true
          schema:
            $ref: '#/definitions/NewProject'
      responses:
        "200":
          description: >-
            Project created. The body contains the information of the new project
            of the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Project'
          examples:
            application/json:
              data:
                id: 1
                canonical: proj3
                description: the-description
                created_at: 1500135021
                updated_at: 1503332021
                name: Project 3
                service_catalog:
                  id: 1
                  name: foo
                  canonical: stack-foo
                  author: Cycloid CI
                  description: CI sample
                  keywords:
                    - ci
                  ref: cycloid:stack-foo
                  directory: "/config"
                  service_catalog_source_id: 1
                  trusted: true
                owner:
                  username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: "https://avatars2.githubusercontent.com/u/14579210"
                  created_at: 1503225026
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: "organization:delete"
                        resources:
                          ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: "organization:team:create"
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: "organization:team:read"
                        resources: ["organization:org-can:team:team-can"]
        "404":
          $ref: '#/responses/not_found_entity_in_path'
        "411":
          $ref: '#/responses/required_content_length_header'
        "422":
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: "#/responses/unexpected_error"
  '/organizations/{organization_canonical}/projects/{project_canonical}/environments':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    post:
      tags:
        - Organization projects
      description: Create a new environment with provider, icon and color in a project
      operationId: createEnvironment
      parameters:
        - in: body
          name: body
          description: The canonical of the environment to create and its configuration.
          required: true
          schema:
            $ref: '#/definitions/NewEnvironment'
      responses:
        "200":
          description: Environment created. The body contains the information of the new environment.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Environment'
          examples:
            application/json:
              data:
                id: 1
                canonical: env
                created_at: 1500135021
                updated_at: 1503332021
                use_case: prod
                color: lime
                icon: world
                cloud_provider_canonical: aws
        "404":
          $ref: '#/responses/not_found_entity_in_path'
        "411":
          $ref: '#/responses/required_content_length_header'
        "422":
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: "#/responses/unexpected_error"
  '/organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/environment_canonical'
    delete:
      tags:
        - Organization projects
      description: Delete a project environment.
      operationId: deleteEnvironment
      responses:
        '204':
          description: Project environment has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization projects
      description: Update a project environment of the organization.
      operationId: updateEnvironment
      parameters:
        - in: body
          name: body
          description: The canonical of the environment to update and its configuration.
          required: true
          schema:
            $ref: '#/definitions/UpdateEnvironment'
      responses:
        "200":
          description: Environment updated. The body contains the information of the updated environment.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Environment'
          examples:
            application/json:
              data:
                use_case: prod
                color: lime
                icon: world
                cloud_provider_canonical: aws
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    get:
      tags:
        - Organization projects
      description: Get a project environment of the organization.
      operationId: getEnvironment
      responses:
        "200":
          description: The body contains the environment.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Environment'
          examples:
            application/json:
              data:
                use_case: prod
                color: lime
                icon: world
                cloud_provider_canonical: aws
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/projects/{project_canonical}/environment/{environment_canonical}/config':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/environment_canonical'
    get:
      tags:
        - Organization projects
      description: Fetch the current project's environment's configuration.
      operationId: getProjectConfig
      responses:
        '200':
          description: Set of config to create the project / push onto repositories
          headers:
            Content-Length:
              description: The length of the response body in octets (8-bit bytes).
              type: integer
              format: uint64
          schema:
            properties:
              data:
                type: object
                $ref: '#/definitions/ProjectEnvironmentConfig'
          examples:
            application/json:
              data:
                use_case: "prod"
                resource_pool_canonical: "prcan"
                forms:
                  prod:
                    ansible:
                      database:
                        - widget: "radios"
                          default: {foo: bar}
                          unit: "($, GHz, GB)"
                          type: "map"
                          values: [{foo: bar}, {bar: foo}]
                          description: ""
                          key: "key-one"
                          name: "map variable"
                          current: {foo: bar}
                        - widget: "dropdown"
                          required: false
                          default: [bar, foo]
                          values: [[foo, bar], [bar, foo]]
                          unit: "($, GHz, GB)"
                          type: "array"
                          description: "something k2"
                          key: "key-two"
                          name: "array variable"
                          current: [bar, foo]
                        - widget: "number"
                          required: true
                          unit: "something"
                          type: "integer"
                          description: "something k3"
                          key: "key-three"
                          name: "required variable without default"
                          current:
                    terraform:
                      database:
                        - widget: "slider_range"
                          required: false
                          default: 2
                          unit: "($, GHz, GB)"
                          type: "integer"
                          description: "something k1"
                          values: [1, 10]
                          key: "key-one"
                          name: "integer variable"
                          current: 10
                        - widget: "dropdown"
                          required: true
                          default: 20
                          unit: "($, GHz, GB)"
                          type: "integer"
                          description: "something k2"
                          values: [10, 20, 30]
                          key: "key-two"
                          name: "required with default"
                          current:
                        - widget: "slider_list"
                          required: false
                          values: [1, 5]
                          unit: "($, GHz, GB)"
                          type: "integer"
                          description: "something k3"
                          key: "key-three"
                          name: "not required no default"
                          current: 1
                    pipeline:
                      database:
                        - widget: "cy_cred"
                          default: t2.micro
                          unit: "($, GHz, GB)"
                          type: "string"
                          description: "something"
                          values: [t2.micro, t2.medium, t2.large]
                          key: "key-four"
                          name: "string with values and default"
                        # if not provided this variable will be ignored as it doesn't have default
                        - widget: "dropdown"
                          required: false
                          unit: "($, GHz, GB)"
                          type: "integer"
                          description: "something k5"
                          key: "key-five"
                          values: [100, 200]
                          name: "not required no default, but values"
                          current: 152
                        # if not provided this variable will be ignored as it doesn't have default
                        - widget: "dropdown"
                          required: false
                          unit: "($, GHz, GB)"
                          type: "integer"
                          description: "something k6"
                          key: "key-six"
                          name: "not required no default, but values"
                          current: 10
                          values: [10, 40, 80]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}/favorites':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    post:
      tags:
        - Organization projects
      description: Add a new project in the user favorites list.
      operationId: createProjectFavorite
      responses:
        '204':
          description: The project has been added to user favorites list.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization projects
      description: Remove a project from the user favorites list.
      operationId: deleteProjectFavorite
      responses:
        '204':
          description: The project has been removed from user favorites list.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/projects/{project_canonical}/environments/{environment_canonical}/infrastructure':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
      - $ref: '#/parameters/environment_canonical'
    get:
      tags:
        - Organization Infrastructure
      description: >-
        Get the infrastructure of the Project on the environment
      operationId: getProjInfrastructure
      responses:
        '200':
          description: Get the Infrastructure View of the Project's environment
          schema:
            type: object
            description: The Infrastructure from the Project's environment
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Infrastructure'
          examples:
            application/json:
              data:
                graph:
                  nodes:
                    - id: "UUID-node-1"
                      canonical: "aws_lb.front"
                      position: [0, 0]
                      resource:
                        canonical: "aws_lb"
                        keywords: ["some", "key"]
                        category: "some category"
                        image: 'http://via.placeholder.com/150x150'
                        description: "description of the resource"
                        short_description: "resource"
                        is_node: true
                        is_edge: false
                    - id: "UUID-node-2"
                      canonical: "aws_instance.front"
                      position: [0, 0]
                      resource:
                        canonical: "aws_instance"
                        keywords: ["some", "key"]
                        category: "some category"
                        image: 'http://via.placeholder.com/150x150'
                        description: "description of the resource"
                        short_description: "resource"
                        is_node: true
                        is_edge: false
                  edges:
                    - id: "UUID-edge-1"
                      source: "UUID-node-1"
                      target: "UUID-node-2"
                      canonicals:
                        - "aws_security_group.front"
                config:
                  resource:
                    aws_lb:
                      front:
                        access_logs.#: "1"
                        access_logs.0.bucket: ""
                        access_logs.0.enabled: "false"
                        access_logs.0.prefix: ""
                        arn: "arn:aws:elasticloadbalancing:eu-west-1:99999994:loadbalancer/app/amazon-front-prod/fa8c187e287baaf1"
                        arn_suffix: "app/amazon-front-prod/fa8c187e287baaf1"
                        dns_name: "amazon-front-prod-1234567890.eu-west-1.elb.amazonaws.com"
                        enable_deletion_protection: "false"
                        enable_http2: "true"
                        id: "arn:aws:elasticloadbalancing:eu-west-1:99999994:loadbalancer/app/amazon-front-prod/fa8c187e287baaf1"
                        idle_timeout: "600"
                        internal: "false"
                        ip_address_type: "ipv4"
                        load_balancer_type: "application"
                        name: "amazon-front-prod"
                        security_groups.#: "1"
                        security_groups.3982542233: "sg-815549fb"
                        subnet_mapping.#: "3"
                        subnet_mapping.1243641484.allocation_id: ""
                        subnet_mapping.1243641484.subnet_id: "subnet-e8f5368e"
                        subnet_mapping.1617803526.allocation_id: ""
                        subnet_mapping.1617803526.subnet_id: "subnet-4caca117"
                        subnet_mapping.707871693.allocation_id: ""
                        subnet_mapping.707871693.subnet_id: "subnet-08c11040"
                        subnets.#: "3"
                        subnets.1359096304: "subnet-08c11040"
                        subnets.3529352084: "subnet-4caca117"
                        subnets.4038704495: "subnet-e8f5368e"
                        tags.%: "6"
                        tags.Name: "amazon-front-eu-we1-prod"
                        tags.client: "amazon"
                        tags.cycloid.io: "true"
                        tags.env: "prod"
                        tags.project: "amazon"
                        tags.role: "front"
                        vpc_id: "vpc-5972c43f"
                        zone_id: "Z32O12XQLNTSW2"
                    aws_instance:
                      front:
                        ami: ami-0211a849817dcceca
                        arn: arn:aws:ec2:eu-west-1:99999992:instance/i-08ffccfdf54168280
                        associate_public_ip_address: false
                        availability_zone: eu-west-1a
                        cpu_core_count: 1
                        cpu_threads_per_core: 2
                        credit_specification:
                          - cpu_credits: unlimited
                        disable_api_termination: false
                        ebs_block_device: []
                        ebs_optimized: false
                        ephemeral_block_device: []
                        get_password_data: false
                        host_id:
                        iam_instance_profile: cycloid_profile-front-sample-magento-prod
                        id: i-08ffccfdf54168280
                        instance_initiated_shutdown_behavior:
                        instance_state: running
                        instance_type: t3.small
                        ipv6_address_count: 0
                        ipv6_addresses: []
                        key_name: cycloid
                        monitoring: false
                        network_interface: []
                        network_interface_id:
                        password_data: ''
                        placement_group: ''
                        primary_network_interface_id: eni-01eac7f767b723514
                        private_dns: ip-10-4-0-3.eu-west-1.compute.internal
                        private_ip: 10.4.0.3
                        public_dns: ''
                        public_ip: ''
                        root_block_device:
                          - delete_on_termination: true
                            encrypted: false
                            iops: 180
                            kms_key_id: ''
                            volume_id: vol-0a0da4a72f6548eb0
                            volume_size: 60
                            volume_type: gp2
                        security_groups: []
                        source_dest_check: true
                        subnet_id: subnet-7e131c1a
                        tags:
                          Name: sample-magento-front0-eu-we1-prod
                          bar: bla
                          client: cycloid
                          cycloid.io: 'true'
                          env: prod
                          foo: test
                          monitoring_discovery: 'false'
                          project: sample-magento
                          role: front
                        tenancy: default
                        timeouts:
                        user_data:
                        user_data_base64:
                        volume_tags:
                          Name: sample-magento-front0-eu-we1-prod
                          bar: bla
                          client: cycloid
                          cycloid.io: 'true'
                          env: prod
                          foo: test
                          monitoring_discovery: 'false'
                          project: sample-magento
                          role: front
                        vpc_security_group_ids:
                          - sg-0d6e0e07fbc6ec626
                          - sg-ddeee6bb
                    aws_security_group:
                      front:
                        cidr_blocks:
                          - "0.0.0.0/0"
                        description: ""
                        from_port: 443
                        id: "sgrule-3405156902"
                        ipv6_cidr_blocks: []
                        prefix_list_ids: []
                        protocol: "tcp"
                        security_group_id: "sg-0f4d72e0081ca0c09"
                        self: false
                        source_security_group_id: null
                        to_port: 443
                        type: "ingress"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/projects/{project_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/project_canonical'
    get:
      tags:
        - Organization projects
      description: Get a project of the organization.
      operationId: getProject
      responses:
        '200':
          description: >-
            The information of the project of the organization which has the
            specified ID.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Project'
          examples:
            application/json:
              data:
                id: 1
                canonical: proj2
                environments:
                  - id: 2
                    canonical: 'staging'
                    created_at: 1503225026
                    updated_at: 1503335026
                    use_case: 'uc'
                  - id: 3
                    canonical: 'dev'
                    created_at: 1503225026
                    updated_at: 1503335026
                    use_case: 'uc2'
                created_at: 1501131026
                updated_at: 1503333026
                name: Project 2
                service_catalog:
                  id: 1
                  name: foo
                  canonical: stack-foo
                  author: Cycloid CI
                  description: CI sample
                  keywords:
                    - ci
                  ref: cycloid:stack-foo
                  directory: "/config"
                  service_catalog_source_id: 1
                  trusted: true
                owner:
                  username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization projects
      description: Delete a project of the organization.
      operationId: deleteProject
      responses:
        '204':
          description: Project has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization projects
      description: >-
        Update the information of a project of the organization.
        If the project has some information on the fields which aren't required
        and they are not sent or set to their default values, which depend of their
        types, the information will be removed.
      operationId: updateProject
      parameters:
        - in: body
          name: body
          description: The information of the project to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateProject'
      responses:
        '200':
          description: >-
            Project updated. The body contains information of the updated
            project.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Project'
          examples:
            application/json:
              data:
                id: 1
                canonical: proj-1
                service_catalog:
                  id: 1
                  name: foo
                  canonical: stack-foo
                  author: Cycloid CI
                  description: CI sample
                  keywords:
                    - ci
                  ref: cycloid:stack-foo
                  directory: "/config"
                  service_catalog_source_id: 1
                  trusted: true
                owner:
                  username: user-1
                  id: 10
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                created_at: 1503225026
                updated_at: 1503335026
                name: Project 1
                service_catalog_ref: cycloidio:stack-magento
                config_repository_canonical: stack-magento-cr
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/quotas':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization Quotas
      description: List of quotas available in the organization.
      operationId: listQuotas
      responses:
        '200':
          description: List of quotas which are available in the organization.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Quota'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 17
                  memory: 10
                  cpu: 11
                  storage: 12
                  used_memory: 10
                  used_cpu: 11
                  used_storage: 12
                - id: 2
                  memory: 10
                  cpu: 11
                  storage: 12
                  used_memory: 10
                  used_cpu: 11
                  used_storage: 12
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the organization's quota to create.
          required: true
          schema:
            $ref: '#/definitions/NewQuota'
      tags:
        - Organization Quotas
      description: Create a new quota available in the organization.
      operationId: createQuota
      responses:
        '200':
          description: New quota created in the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Quota'
          examples:
            application/json:
              data:
                id: 17
                memory: 10
                cpu: 11
                storage: 12
                used_memory: 10
                used_cpu: 11
                used_storage: 12
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/quotas/{quota_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/quota_id'
    get:
      tags:
        - Organization Quotas
      description: Get the quota available in the organization with an canonical
      operationId: getQuota
      responses:
        '200':
          description: Quota available in the organization with such canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Quota'
          examples:
            application/json:
              data:
                id: 17
                memory: 10
                cpu: 11
                storage: 12
                used_memory: 10
                used_cpu: 11
                used_storage: 12
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      parameters:
        - in: body
          name: body
          description: The information of the organization's quota to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateQuota'
      tags:
        - Organization Quotas
      description: Update an existing quota in the organization.
      operationId: updateQuota
      responses:
        '200':
          description: Updated quota belonging to the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Quota'
          examples:
            application/json:
              data:
                memory: 10
                cpu: 11
                storage: 12
                used_memory: 10
                used_cpu: 11
                used_storage: 12
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Quotas
      description: Delete an existing quota in the organization.
      operationId: deleteQuota
      responses:
        '204':
          description: Organization quota has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  
  '/organizations/{organization_canonical}/quotas/{quota_id}/consumptions':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/quota_id'
    get:
      tags:
        - Organization Quotas
      description: Get the quota consumptions by project and environment
      operationId: listQuotaConsumptions
      responses:
        '200':
          description: Quota available in the organization with such canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ProjectEnvironmentConsumption'
          examples:
            application/json:
              data:
                id: 17
                memory: 10
                cpu: 11
                storage: 12
                project:
                  id: 1
                  canonical: proj2
                  name: "prj"
                  created_at: 1501131026
                  updated_at: 1503333026
                  owner:
                    username: user-1
                    id: 1
                    given_name: Mariano
                    family_name: Jimenez
                    email: mariano.jimenez@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                environment:
                  id: 3
                  canonical: 'dev'
                  cloud_provider:
                    canonical: 'aws'
                    abbreviation: 'AWS'
                    name: 'Amazon Web Services'
                  created_at: 1503225026
                  updated_at: 1503335026
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/resource_pools':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization Resource Pools
      description: List of resource pools available in the organization.
      operationId: listResourcePools
      responses:
        '200':
          description: List of resource pools which are available in the organization.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/ResourcePool'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 17
                  name: Prod Pool
                  canonical: prod_pool
                  label: production
                  memory: 10
                  cpu: 11
                  storage: 12
                  used_memory: 10
                  used_cpu: 11
                  used_storage: 12
                  allocated_memory: 10
                  allocated_cpu: 11
                  allocated_storage: 12
                - id: 2
                  name: Stating Pool
                  canonical: staging_pool
                  label: staging
                  memory: 10
                  cpu: 11
                  storage: 12
                  used_memory: 10
                  used_cpu: 11
                  used_storage: 12
                  allocated_memory: 10
                  allocated_cpu: 11
                  allocated_storage: 12
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the organization's resource_pool to create.
          required: true
          schema:
            $ref: '#/definitions/NewResourcePool'
      tags:
        - Organization Resource Pools
      description: Create a new resource pool available in the organization.
      operationId: createResourcePool
      responses:
        '200':
          description: New resource pool created in the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ResourcePool'
          examples:
            application/json:
              data:
                name: existing
                canonical: resource_pool_can
                label: staging
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/resource_pools/{resource_pool_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/resource_pool_canonical'
    get:
      tags:
        - Organization ResourcePools
      description: Get the resource pool available in the organization with an canonical
      operationId: getResourcePool
      responses:
        '200':
          description: ResourcePool available in the organization with such canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ResourcePool'
          examples:
            application/json:
              data:
                id: 17
                name: Prod Pool
                canonical: prod_pool
                label: production
                memory: 10
                cpu: 11
                storage: 12
                used_memory: 10
                used_cpu: 11
                used_storage: 12
                allocated_memory: 10
                allocated_cpu: 11
                allocated_storage: 12
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      parameters:
        - in: body
          name: body
          description: The information of the organization's resource_pool to update.
          required: true
          schema:
            $ref: '#/definitions/NewResourcePool'
      tags:
        - Organization Resource Pools
      description: Update an existing resource_pool in the organization.
      operationId: updateResourcePool
      responses:
        '200':
          description: Updated resource pool belonging to the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ResourcePool'
          examples:
            application/json:
              data:
                id: 17
                name: Prod Pool
                canonical: prod_pool
                label: production
                memory: 10
                cpu: 11
                storage: 12
                used_memory: 10
                used_cpu: 11
                used_storage: 12
                allocated_memory: 10
                allocated_cpu: 11
                allocated_storage: 12
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Resource Pools
      description: Delete an existing resource_pool in the organization.
      operationId: deleteResourcePool
      responses:
        '204':
          description: Organization resource_pool has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/roles':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization Roles
      description: Get the list of roles available in the organization.
      operationId: getRoles
      responses:
        '200':
          description: List of roles which are available in the organization.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Role'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - id: 17
                  name: existing
                  description: Organization existing role
                  canonical: role-can
                  rules:
                    - id: 1
                      effect: "allow"
                      action: 'organization:delete'
                      resources: ["organization:org-can", "organization:org-can2"]
                    - id: 20
                      effect: "allow"
                      action: 'organization:team:create'
                      resources: []
                    - id: 21
                      effect: "allow"
                      action: 'organization:team:read'
                      resources: ["organization:org-can:team:team-can"]
                - id: 2
                  name: project manager
                  canonical: role-can2
                  description: A project manager
                  rules:
                    - id: 20
                      effect: "allow"
                      action: 'organization:team:create'
                      resources: []
                    - id: 21
                      effect: "allow"
                      action: 'organization:team:read'
                      resources: ["organization:org-can:team:team-can"]
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the organization's role to create.
          required: true
          schema:
            $ref: '#/definitions/NewRole'
      tags:
        - Organization Roles
      description: Create a new role available in the organization.
      operationId: createRole
      responses:
        '200':
          description: New role created in the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/NewRole'
          examples:
            application/json:
              data:
                id: 17
                name: existing
                description: Organization existing role
                canonical: role-can
                rules:
                  - id: 1
                    effect: "allow"
                    action: 'organization:delete'
                    resources: ["organization:org-can", "organization:org-can2"]
                  - id: 20
                    effect: "allow"
                    action: 'organization:team:create'
                    resources: []
                  - id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/roles/{role_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/role_canonical'
    get:
      tags:
        - Organization Roles
      description: Get the role available in the organization with an canonical
      operationId: getRole
      responses:
        '200':
          description: Role available in the organization with such canonical.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Role'
          examples:
            application/json:
              data:
                id: 17
                name: existing
                description: Organization existing role
                canonical: role-can
                rules:
                  - id: 1
                    effect: "allow"
                    action: 'organization:delete'
                    resources: ["organization:org-can", "organization:org-can2"]
                  - id: 20
                    effect: "allow"
                    action: 'organization:team:create'
                    resources: []
                  - id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      parameters:
        - in: body
          name: body
          description: The information of the organization's role to update.
          required: true
          schema:
            $ref: '#/definitions/NewRole'
      tags:
        - Organization Roles
      description: Update an existing role in the organization.
      operationId: updateRole
      responses:
        '200':
          description: Updated role belonging to the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Role'
          examples:
            application/json:
              data:
                id: 17
                name: existing
                description: Organization existing role
                canonical: role-can
                rules:
                  - id: 1
                    effect: "allow"
                    action: 'organization:delete'
                    resources: ["organization:org-can", "organization:org-can2"]
                  - id: 20
                    effect: "allow"
                    action: 'organization:team:create'
                    resources: []
                  - id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Roles
      description: Delete an existing role in the organization.
      operationId: deleteRole
      responses:
        '204':
          description: Organization role has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalog_sources':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization Service Catalog Sources
      description: Return all the private service catalogs
      operationId: getServiceCatalogSources
      responses:
        '200':
          description: List of the private service catalogs.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/ServiceCatalogSource'
          examples:
            application/json:
              data:
                - id: 1
                  canonical: my-personal-repo
                  name: My personal repo
                  url: 'git@github.com:myuser/repository.git'
                  credential_id: 1
                  created_at: 1503225026
                  updated_at: 1503335026
                  branch: "my-favourite-branch"
                  stack_count: 1
                  owner:
                    username: user-1
                    id: 1
                    given_name: Mariano
                    family_name: Jimenez
                    email: mariano.jimenez@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 3
                      name: developer
                      description: A developer of the team
                      policies:
                        - id: 21
                          code: 'team:read'
                          entities: []
                          description: Grant the access to read the teams of an organization
                        - id: 42
                          code: 'member:read'
                          entities: []
                          description: Grant the access to read the members
                  service_catalogs:
                    - id: 1
                      name: foo
                      canonical: stack-foo
                      directory: "/config"
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo
                      service_catalog_source_id: 1
                      trusted: true
                - id: 2
                  canonical: my-personal-repo-2
                  name: My personal repo 2
                  url: "https://github.com/cycloid-community-catalog/stack-dummy.git"
                  created_at: 1503225026
                  updated_at: 1503335026
                  branch: "my-second-favourite-branch"
                  stack_count: 4
                  owner:
                    username: user-1
                    id: 1
                    given_name: Mariano
                    family_name: Jimenez
                    email: mariano.jimenez@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 3
                      name: developer
                      description: A developer of the team
                      policies:
                        - id: 21
                          code: 'team:read'
                          entities: []
                          description: Grant the access to read the teams of an organization
                        - id: 42
                          code: 'member:read'
                          entities: []
                          description: Grant the access to read the members
                        - id: 60
                          code: 'project:read'
                          entities: []
                          description: Grant the access to projects
                  service_catalogs:
                    - id: 2
                      name: bar
                      canonical: stack-bar
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-bar
                      directory: "/cfg"
                      service_catalog_source_id: 2
                      trusted: true
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization Service Catalog Sources
      parameters:
        - in: body
          name: body
          description: The information of the organization to create.
          required: true
          schema:
            $ref: '#/definitions/NewServiceCatalogSource'
      description: Creates a Service catalog source
      operationId: createServiceCatalogSource
      responses:
        '200':
          description: Success creation
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalogSource'
          examples:
            application/json:
              data:
                id: 1
                canonical: my-personal-repo
                name: My personal repo
                url: 'git@github.com:myuser/repository.git'
                credential_id: 1
                created_at: 1503225026
                updated_at: 1503335026
                branch: 'my-scs-branch'
                stack_count: 1
                owner:
                  username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 3
                    name: developer
                    description: A developer of the team
                    policies:
                      - id: 21
                        code: 'team:read'
                        entities: []
                        description: Grant the access to read the teams of an organization
                      - id: 42
                        code: 'member:read'
                        entities: []
                        description: Grant the access to read the members
                      - id: 60
                        code: 'project:read'
                        entities: []
                        description: Grant the access to projects
                service_catalogs:
                  - id: 1
                    name: foo
                    canonical: stack-foo
                    author: Cycloid CI
                    description: CI sample
                    keywords:
                      - ci
                    ref: cycloid:stack-foo
                    directory: "/config"
                    service_catalog_source_id: 1
                    trusted: true
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalog_sources/{service_catalog_source_canonical}/refresh':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_source_canonical'
    post:
      tags:
        - Organization Service Catalog Sources
      description: Refresh a Service catalog source
      operationId: refreshServiceCatalogSource
      responses:
        '200':
          description: Success refresh
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalogChanges'
          examples:
            application/json:
              data:
                id: 1
                canonical: my-personal-repo
                name: My personal repo
                url: 'git@github.com:cycloidio/youdeploy-http-api.git'
                credential_id: 1
                created_at: 1503225026
                updated_at: 1503335026
                branch: 'my-favourite-branch'
                changes:
                  created:
                    - id: 1
                      name: foo
                      canonical: stack-foo
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo
                      directory: "/config"
                      service_catalog_source_id: 1
                      trusted: true
                  updated:
                    - id: 2
                      name: foo2
                      canonical: stack-foo2
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo2
                      directory: "/config/prod"
                      service_catalog_source_id: 1
                      trusted: true
                  deleted:
                    - id: 3
                      name: fo3
                      canonical: stack-foo3
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo3
                      directory: "/"
                      service_catalog_source_id: 1
                      trusted: true
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalog_sources/{service_catalog_source_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_source_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization Service Catalog Sources
      description: Return the Service Catalog Source
      operationId: getServiceCatalogSource
      responses:
        '200':
          description: Organization Service Catalog Sources.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalogSource'
          examples:
            application/json:
              data:
                  id: 1
                  canonical: my-personal-repo
                  name: My personal repo
                  url: 'git@github.com:myuser/repository.git'
                  created_at: 1503225026
                  updated_at: 1503335026
                  credential_id: 1
                  branch: "my-scs-branch"
                  stack_count: 1
                  service_catalogs:
                    - id: 1
                      name: foo
                      canonical: stack-foo
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo
                      directory: "/config"
                      service_catalog_source_id: 1
                      trusted: true
                  owner:
                    username: user-1
                    id: 1
                    given_name: Mariano
                    family_name: Jimenez
                    email: mariano.jimenez@fakeemail.com
                    picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                    created_at: 1503225026
                    role:
                      id: 3
                      name: developer
                      description: A developer of the team
                      policies:
                        - id: 21
                          code: 'team:read'
                          entities: []
                          description: Grant the access to read the teams of an organization
                        - id: 42
                          code: 'member:read'
                          entities: []
                          description: Grant the access to read the members
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization Service Catalog Sources
      description: Update a Service catalog source
      operationId: updateServiceCatalogSource
      parameters:
        - in: body
          name: body
          description: The information of the organization to create.
          required: true
          schema:
            $ref: '#/definitions/UpdateServiceCatalogSource'
      responses:
        '200':
          description: Success update
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalogSource'
          examples:
            application/json:
              data:
                id: 1
                canonical: my-personal-repo
                name: My personal repo
                url: 'git@github.com:myuser/repository.git'
                credential_id: 1
                created_at: 1503225026
                updated_at: 1503335026
                branch: 'my-favourite-branch'
                stack_count: 1
                owner:
                  username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  role:
                    id: 3
                    name: developer
                    description: A developer of the team
                    policies:
                      - id: 21
                        code: 'team:read'
                        entities: []
                        description: Grant the access to read the teams of an organization
                      - id: 42
                        code: 'member:read'
                        entities: []
                        description: Grant the access to read the members
                service_catalogs:
                  created:
                    - id: 1
                      name: foo
                      canonical: stack-foo
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo
                      directory: "/config"
                      service_catalog_source_id: 1
                      trusted: true
                  updated:
                    - id: 2
                      name: foo2
                      canonical: stack-foo2
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo2
                      directory: "/config/prod"
                      service_catalog_source_id: 1
                      trusted: true
                  deleted:
                    - id: 3
                      name: fo3
                      canonical: stack-foo3
                      author: Cycloid CI
                      description: CI sample
                      keywords:
                        - ci
                      ref: cycloid:stack-foo3
                      directory: "/"
                      service_catalog_source_id: 1
                      trusted: true
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization Service Catalog Sources
      description: delete a Service catalog source
      operationId: deleteServiceCatalogSource
      responses:
        '204':
          description: Organization Service Catalog Sources has been deleted
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalog_sources/{service_catalog_source_canonical}/validate':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_source_canonical'
    post:
      tags:
        - Organization Service Catalog Sources
      description: Validate a Service catalog source
      operationId: validateServiceCatalogSource
      responses:
        '204':
          description: The SCS has been validated
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/subscriptions':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      parameters:
        - in: body
          name: body
          description: The information of the subscription to create
          required: true
          schema:
            $ref: '#/definitions/NewSubscription'
      tags:
        - Organization Subscriptions
      description: Creates a subscription for the Organization
      operationId: createSubscription
      responses:
        '204':
          description: Created Subscription
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/teams':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/team_name_query'
        - $ref: '#/parameters/team_created_at_query'
        - $ref: '#/parameters/team_description_query'
        - $ref: '#/parameters/owner_query'
        - $ref: '#/parameters/order_by_query'
      tags:
        - Organization teams
      description: Get list of teams of the organization.
      operationId: getTeams
      responses:
        '200':
          description: List of the teams which the organization has.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Team'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: team1
                  id: 1
                  created_at: 1503225026
                  updated_at: 1503335026
                  name: Team 1
                  owner:
                    id: 99
                    username: 'superuser'
                    given_name: 'Owen'
                    family_name: 'Smith'
                    email: 'superuser@company.com'
                    created_at: 1503225026
                    role:
                      id: 17
                      name: existing
                      description: Organization existing role
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: 'organization:delete'
                          resources: ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: 'organization:team:create'
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: 'organization:team:read'
                          resources: ["organization:org-can:team:team-can"]
                  roles:
                    - id: 17
                      name: existing
                      description: Organization existing role
                      canonical: role-can
                      rules:
                        - id: 1
                          effect: "allow"
                          action: 'organization:delete'
                          resources: ["organization:org-can", "organization:org-can2"]
                        - id: 20
                          effect: "allow"
                          action: 'organization:team:create'
                          resources: []
                        - id: 21
                          effect: "allow"
                          action: 'organization:team:read'
                          resources: ["organization:org-can:team:team-can"]
                  member_count: 12
                  members_preview:
                    - id: 42
                      username: 'coder'
                      given_name: 'Cody'
                      family_name: 'Coder'
                      email: 'coder@company.com'
                      created_at: 678123
                    - id: 43
                      username: 'tester'
                      given_name: 'Tony'
                      family_name: 'Tester'
                      email: 'tester@company.com'
                      created_at: 678123
              pagination:
                index: 1
                size: 10
                total: 1
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization teams
      description: Create a new team in the organization.
      operationId: createTeam
      parameters:
        - in: body
          name: body
          description: The information of the team to create.
          required: true
          schema:
            $ref: '#/definitions/NewTeam'
      responses:
        '200':
          description: >-
            Team created. The body contains the information of the new team of
            the organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Team'
          examples:
            application/json:
              data:
                id: 1
                canonical: team1
                created_at: 1503225026
                updated_at: 1503335026
                name: Team 1
                owner:
                  id: 99
                  username: 'superuser'
                  given_name: 'Owen'
                  family_name: 'Smith'
                  email: 'superuser@company.com'
                  created_at: 1503225026
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                roles:
                  - id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                  - id: 10
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                member_count: 12
                members_preview:
                  - id: 42
                    username: 'coder'
                    given_name: 'Cody'
                    family_name: 'Coder'
                    email: 'coder@company.com'
                    created_at: 678123
                  - id: 43
                    username: 'tester'
                    given_name: 'Tony'
                    family_name: 'Tester'
                    email: 'tester@company.com'
                    created_at: 678123
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/teams/{team_canonical}/members':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/team_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization team members
      description: Get the members of a team of the organization.
      operationId: getTeamMembers
      responses:
        '200':
          description: List of the members who are assigned to the team.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/MemberTeam'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - username: user-1
                  id: 1
                  given_name: Mariano
                  family_name: Jimenez
                  email: mariano.jimenez@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503225026
                  last_login_at: 1503225576
                - username: user2
                  id: 1
                  given_name: Jordi
                  family_name: Capdevila
                  email: jordi.capdevila@fakeemail.com
                  picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                  created_at: 1503281026
                  invited_at: 1503281026
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organization team members
      description: Assign a user of the organization to be a member of a team.
      operationId: assignMemberToTeam
      parameters:
        - in: body
          name: body
          description: The assignation information for being a member or being updated.
          required: true
          schema:
            $ref: '#/definitions/NewTeamMemberAssignation'
      responses:
        '200':
          description: The information of the member of the team.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/MemberTeam'
          examples:
            application/json:
              data:
                id: 1
                username: user-1
                given_name: Mariano
                family_name: Jimenez
                email: mariano.jimenez@fakeemail.com
                picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                created_at: 1503225026
                last_login_at: 1503281333
                role:
                  id: 17
                  name: existing
                  description: Organization existing role
                  canonical: role-can
                  rules:
                    - id: 1
                      effect: "allow"
                      action: 'organization:delete'
                      resources: ["organization:org-can", "organization:org-can2"]
                    - id: 20
                      effect: "allow"
                      action: 'organization:team:create'
                      resources: []
                    - id: 21
                      effect: "allow"
                      action: 'organization:team:read'
                      resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/teams/{team_canonical}/members/{member_id}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/team_canonical'
      - $ref: '#/parameters/member_id'
    get:
      tags:
        - Organization team members
      description: Get the information of a member of the team.
      operationId: getTeamMember
      responses:
        '200':
          description: The information of the member of the team.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/MemberTeam'
          examples:
            application/json:
              data:
                id: 1
                username: user-1
                given_name: Mariano
                family_name: Jimenez
                email: mariano.jimenez@fakeemail.com
                picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                created_at: 1503225026
                last_login_at: 1503281333
                role:
                  id: 17
                  name: existing
                  description: Organization existing role
                  canonical: role-can
                  rules:
                    - id: 1
                      effect: "allow"
                      action: 'organization:delete'
                      resources: ["organization:org-can", "organization:org-can2"]
                    - id: 20
                      effect: "allow"
                      action: 'organization:team:create'
                      resources: []
                    - id: 21
                      effect: "allow"
                      action: 'organization:team:read'
                      resources: ["organization:org-can:team:team-can"]
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization team members
      description: >-
        Unassign a member of the team. After this operation, the user will not
        be a member of the team.
      operationId: unassignMemberFromTeam
      responses:
        '204':
          description: The user has been unassigned of the team.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/teams/{team_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/team_canonical'
    get:
      tags:
        - Organization teams
      description: Get the information of a team of the organization.
      operationId: getTeam
      responses:
        '200':
          description: >-
            The information of the team of the organization which has the
            specified ID.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Team'
          examples:
            application/json:
              data:
                id: 1
                canonical: team-2
                created_at: 1503225026
                updated_at: 1503335026
                name: Team 2
                owner:
                  id: 99
                  username: 'superuser'
                  given_name: 'Owen'
                  family_name: 'Smith'
                  email: 'superuser@company.com'
                  created_at: 1503225026
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                roles:
                  - id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                member_count: 12
                members_preview:
                  - id: 42
                    username: 'cooluser'
                    given_name: 'given'
                    family_name: 'family'
                    email: 'cooluser@company.com'
                    created_at: 678123
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organization teams
      description: Delete a team of the organization.
      operationId: deleteTeam
      responses:
        '204':
          description: Team has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organization teams
      description: Update the information of a team of the organization.
      operationId: updateTeam
      parameters:
        - in: body
          name: body
          description: The information of the team to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateTeam'
      responses:
        '200':
          description: Team updated. The body contains information of the updated team.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Team'
          examples:
            application/json:
              data:
                id: 1
                canonical: team-3
                created_at: 1503220026
                updated_at: 1503335126
                name: Team 3
                owner:
                  id: 99
                  username: 'superuser'
                  given_name: 'Owen'
                  family_name: 'Smith'
                  email: 'superuser@company.com'
                  created_at: 1503225026
                  role:
                    id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                roles:
                  - id: 17
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 20
                        effect: "allow"
                        action: 'organization:team:create'
                        resources: []
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                  - id: 10
                    name: existing
                    description: Organization existing role
                    canonical: role-can
                    rules:
                      - id: 1
                        effect: "allow"
                        action: 'organization:delete'
                        resources: ["organization:org-can", "organization:org-can2"]
                      - id: 21
                        effect: "allow"
                        action: 'organization:team:read'
                        resources: ["organization:org-can:team:team-can"]
                member_count: 12
                members_preview:
                  - id: 42
                    username: 'coder'
                    given_name: 'Cody'
                    family_name: 'Coder'
                    email: 'coder@company.com'
                    created_at: 678123
                  - id: 43
                    username: 'tester'
                    given_name: 'Tony'
                    family_name: 'Tester'
                    email: 'tester@company.com'
                    created_at: 678123
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/workers':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
      tags:
        - Organization workers
      description: Get the workers that the authenticated user has access to.
      operationId: getWorkers
      responses:
        '200':
          description: List of the workers which authenticated user has access to.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Worker'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - name: worker1
                  state: running
                  version: "2.1"
                  platform: linux
                  ephemeral: false
                  active_containers: 256
                  active_volumes: 0
                  team: org1
                  start_time: 1552997739
                - name: worker2
                  state: running
                  version: "2.1"
                  platform: linux
                  tags:
                    - fastcpu
                  ephemeral: true
                  active_containers: 256
                  active_volumes: 10
                  start_time: 1552997639
                  team: org2
                - name: worker3
                  state: running
                  version: "2.1"
                  platform: linux
                  tags:
                    - ssd
                  ephemeral: true
                  active_containers: 300
                  active_volumes: 20
                  start_time: 1552997839
                  team: org3
              pagination:
                index: 1
                size: 5
                total: 3
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/ancestors':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organizations
      description: >-
        Get all the ancestors between the Organization and the User with the shortest path.
      operationId: getAncestors
      responses:
        '200':
          description: Get all the ancestors between the Organization and the User with the shortest path. 0 index is the parent and n is the searched child
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Organization'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: org1
                  id: 1
                  name: Organization 1
                  ci_team_name: asfdOPNljk
                  created_at: 1503225026
                  updated_at: 1503335026
                  blocked: []
                  quotas: false
                  can_create_appearance: true
                  can_children_create_appearance: true
                - canonical: org2
                  id: 2
                  name: Organization 2
                  ci_team_name: asfdOPNljk
                  created_at: 1501131026
                  updated_at: 1503333026
                  blocked:
                  - "require_payment"
                  quotas: false
                  can_create_appearance: true
                  can_children_create_appearance: true
                - canonical: org3
                  id: 3
                  name: Organization 3
                  ci_team_name: asfdOPNljk
                  created_at: 1500135021
                  updated_at: 1503332021
                  blocked:
                  - "require_payment"
                  quotas: false
                  can_create_appearance: true
                  can_children_create_appearance: true
              pagination:
                total: 42
                index: 33
                size: 10
        '401':
          $ref: '#/responses/unauthenticated'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/branches':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/credential_canonical_not_required_query'
      - $ref: '#/parameters/git_url_query'
    get:
      tags:
        - Organizations
      description: | 
        Return all the branches of repository. If the repository is empty then an
        empty list will be returned.
      operationId: getRepoBranches
      responses:
        '200':
          description: List of the repository branches
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  type: string
          examples:
            application/json:
              data:
                - "stacks"
                - "stacks2"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/can_do':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      tags:
        - Organizations
      description: Checks if the JWT can do the action
      operationId: canDo
      parameters:
        - in: body
          name: body
          description: The information of the authorization
          required: true
          schema:
            $ref: '#/definitions/CanDoInput'
      responses:
        '200':
          description: The information of the possibility to do the action
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/CanDoOutput'
          examples:
            application/json:
              data:
                ok: true
                entity_canonicals:
                  - "pepito"
                  - "grillo"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  /organizations:
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - in: query
          name: organization_name
          type: string
          description: Search by the organization's name
        - in: query
          name: organization_created_at
          type: integer
          format: uint64
          description: Search by organization's creation date
        - $ref: '#/parameters/order_by_query'
      tags:
        - Organizations
      description: Get the organizations that the authenticated user has access.
      operationId: getOrgs
      responses:
        '200':
          description: List of the organizations which authenticated user has access.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/Organization'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - canonical: org1
                  id: 1
                  name: Organization 1
                  ci_team_name: asfdOPNljk
                  ci_port: 443
                  ci_url: https://scheduler.cycloid.io
                  created_at: 1503225026
                  updated_at: 1503335026
                  has_children: true
                  blocked: []
                  quotas: false
                  can_create_appearance: true
                  can_children_create_appearance: true
                  subscription:
                    expires_at: 1501131026
                    members_count: 10
                    plan:
                      id: 5
                      name: "Free Trial"
                      canonical: "free_trial"
                - canonical: org2
                  id: 1
                  name: Organization 2
                  ci_team_name: asfdOPNljk
                  ci_port: 443
                  ci_url: https://scheduler.cycloid.io
                  created_at: 1501131026
                  updated_at: 1503333026
                  has_children: false
                  blocked: []
                  quotas: false
                  can_create_appearance: true
                  can_children_create_appearance: true
                  subscription:
                    expires_at: 1501131026
                    members_count: 10
                    plan:
                      id: 5
                      name: "Free Trial"
                      canonical: "free_trial"
                - canonical: org3
                  id: 1
                  name: Organization 3
                  ci_team_name: asfdOPNljk
                  ci_port: 443
                  ci_url: https://scheduler.cycloid.io
                  created_at: 1500135021
                  updated_at: 1503332021
                  has_children: false
                  blocked: []
                  quotas: false
                  can_create_appearance: true
                  can_children_create_appearance: true
                  subscription:
                    expires_at: 1501131026
                    members_count: 10
                    plan:
                      id: 5
                      name: "Free Trial"
                      canonical: "free_trial"
              pagination:
                index: 1
                size: 10
                total: 3
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - Organizations
      description: >-
        Create a new organization, making the authenticated user the owner of
        it.
      operationId: createOrg
      parameters:
        - in: body
          name: body
          description: The information of the organization to create.
          required: true
          schema:
            $ref: '#/definitions/NewOrganization'
      responses:
        '200':
          description: >-
            Organization created. The body contains the information of the new
            created organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Organization'
          examples:
            application/json:
              data:
                id: 1
                canonical: org1
                name: Organization 1
                ci_team_name: asfdOPNljk
                ci_port: 443
                ci_url: https://scheduler.cycloid.io
                created_at: 1503225026
                updated_at: 1503335026
                has_children: false
                blocked: []
                quotas: false
                can_create_appearance: true
                can_children_create_appearance: false
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organizations
      description: Get the information of the organization.
      operationId: getOrg
      responses:
        '200':
          description: The information of the organization which has the specified ID.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Organization'
          examples:
            application/json:
              data:
                id: 1
                canonical: org3
                ci_team_name: asfdOPNljk
                name: Organization 3
                blocked: []
                has_children: false
                quotas: false
                can_create_appearance: true
                can_children_create_appearance: false
                created_at: 1500135021
                updated_at: 1503332021
                subscription:
                  expires_at: 1501131026
                  members_count: 10
                  plan:
                    id: 5
                    name: "Free Trial"
                    canonical: "free_trial"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Organizations
      description: Delete the organization.
      operationId: deleteOrg
      responses:
        '204':
          description: Organization has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Organizations
      description: Update the information of the organization.
      operationId: updateOrg
      parameters:
        - in: body
          name: body
          description: The information of the organization to update.
          required: true
          schema:
            $ref: '#/definitions/UpdateOrganization'
      responses:
        '200':
          description: >-
            Organization updated. The body contains information of the updated
            organization.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Organization'
          examples:
            application/json:
              data:
                id: 1
                canonical: org2
                ci_team_name: asfdOPNljk
                name: Organization 2
                blocked: []
                quotas: false
                can_create_appearance: true
                can_children_create_appearance: true
                created_at: 1501131026
                updated_at: 1503333026
                subscription:
                  expires_at: 1501131026
                  members_count: 10
                  plan:
                    id: 5
                    name: "Free Trial"
                    canonical: "free_trial"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/summary':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    get:
      tags:
        - Organizations
      description: Get the summary of the organization
      operationId: getSummary
      responses:
        '200':
          description: The summary object
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/Summary'
          examples:
            application/json:
              data:
                projects: 5
                pipelines: 5
                credentials: 5
                service_catalog_sources: 5
                config_repositories: 5
                teams: 5
                users: 5
                roles: 5
                service_catalogs: 5
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
  '/saml2/acs':
    post:
      description: Assertion Consumer Service callback endpoint for the SAML2 Identity Provider.
      operationId: samlAssertionConsumerService
      security: []
      tags:
        - SAML2
      consumes:
        - application/x-www-form-urlencoded
      parameters:
        - in: formData
          name: SAMLResponse
          type: string
          description: Base64-encoded SAML authentication response document.
      responses:
        '303':
          description: >-
            The response will always be a redirect to the front-end with the authentication code. With this code, the
            application can proceed with a normal OAuth flow, by sending it to the /user/saml2/oauth endpoint.
          headers:
            Location:
              description: >-
                Location URL will contain either a "code" or "error" query parameter, depending on authentication result.
              type: string
              format: uri
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/saml2':
    get:
      description: Returns the Cycloid instance's SAML2 metadata that can be plugged into an Identity Provider.
      operationId: getSamlMetadata
      security: []
      tags:
        - SAML2
      produces:
        - application/xml
      responses:
        '200':
          description: SAML2 XML metadata describing the Cycloid Service Provider.
          schema:
            type: object
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs':
    parameters:
      - $ref: '#/parameters/organization_canonical'
    post:
      tags:
        - Service catalogs
      description: Create a new Service Catalog
      operationId: createServiceCatalog
      parameters:
        - in: body
          name: body
          description: The information of the ServiceCatalog.
          required: true
          schema:
            $ref: '#/definitions/NewServiceCatalog'
      responses:
        '200':
          description: The information of the service catalog.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalog'
          examples:
            application/json:
              data:
                id: 1
                name: stack-magento
                author: Cycloid
                canonical: stack-magento
                image: 'http://via.placeholder.com/150x150'
                description: Super magento stack
                type: stack
                trusted: true
                keywords:
                  - stack
                  - php
                ref: "orgCanonical:stackCanonical"
                directory: "/config"
                visibility: local
                technologies:
                  - technology: nginx
                    version: "1.15"
                  - technology: debian
                    version: "9.1"
                  - technology: magento
                    version: "2.2"
                  - technology: Php
                    version: "7.2"
                  - technology: Redis
                    version: "2.4"
                  - technology: Elasticsearch
                    version: "6.2"
                created_at: 1503225026
                updated_at: 1503335026
                service_catalog_source_canonical: "scscan"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    get:
      parameters:
        - $ref: '#/parameters/page_index'
        - $ref: '#/parameters/page_size'
        - $ref: '#/parameters/service_catalog_own_query'
        - $ref: '#/parameters/service_catalog_template_query'
      tags:
        - Service catalogs
      description: Return all the service catalogs
      operationId: listServiceCatalogs
      responses:
        '200':
          description: List of the service catalogs.
          schema:
            type: object
            required:
              - data
              - pagination
            properties:
              data:
                type: array
                items:
                  $ref: '#/definitions/ServiceCatalog'
              pagination:
                $ref: '#/definitions/Pagination'
          examples:
            application/json:
              data:
                - name: stack-magento
                  id: 1
                  author: Cycloid
                  canonical: stack-magento
                  image: 'http://via.placeholder.com/150x150'
                  description: Super magento stack
                  trusted: true
                  keywords:
                    - stack
                    - php
                  ref: "orgCanonical:stackCanonical"
                  directory: "/config"
                  visibility: local
                  service_catalog_source_canonical: "scscan"
                  technologies:
                    - technology: nginx
                      version: "1.15"
                    - technology: debian
                      version: "9.1"
                    - technology: magento
                      version: "2.2"
                    - technology: Php
                      version: "7.2"
                    - technology: Redis
                      version: "2.4"
                    - technology: Elasticsearch
                      version: "6.2"
                  created_at: 1503225026
                  updated_at: 1503335026
                - name: infra-classic-web
                  id: 2
                  author: Cycloid
                  canonical: stack-magento
                  image: 'http://via.placeholder.com/150x150'
                  description: Super magento stack
                  trusted: false
                  keywords:
                    - stack
                    - php
                  ref: "cycloidio:stack-magento"
                  visibility: local
                  service_catalog_source_canonical: "scscan"
                  technologies:
                    - technology: nginx
                      version: "1.15"
                    - technology: debian
                      version: "9.1"
                    - technology: magento
                      version: "2.2"
                    - technology: Php
                      version: "7.2"
                    - technology: Redis
                      version: "2.4"
                    - technology: Elasticsearch
                      version: "6.2"
                  created_at: 1503225026
                  updated_at: 1503335026
              pagination:
                index: 1
                size: 10
                total: 2
        '403':
          $ref: '#/responses/not_enough_permissions'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/config':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
  
      - $ref: '#/parameters/use_case_query'
      - $ref: '#/parameters/project_canonical_query'
      - $ref: '#/parameters/environment_canonical_query'
    get:
      tags:
        - Service catalogs
      description: Get the config of the service catalog
      operationId: getServiceCatalogConfig
      responses:
        '200':
          description: The config of the service catalog.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: object
          examples:
            application/json:
              data: {
                first-usecase: {
                  pipeline: {
                    pipeline: {
                      path: "pipeline/magento.yml",
                      content: "groups:\n\n- name: magento-((env))\n  jobs:\n  - magento-((env))-build\n  - full-deploy-front-magento-((env))\n  - app-deploy-front-magento-((env))\n  - terraform-plan-magento-((env))\n  - terraform-apply-magento-((env))\n  - magento-((env))-unittests\n  - magento-((env))-functional-tests\n\nresource_types:\n\n- name: terraform\n  type: docker-image\n  source:\n    repository: ljfranklin/terraform-resource\n\nresources:\n\n- name: terraform-magento-((env))\n  type: terraform\n  source:\n    storage:\n      bucket: ((terraform_storage_bucket_name))\n      bucket_path: ((terraform_storage_bucket_path))\n      region_name: ((aws_default_region))\n      access_key_id: \"((terraform_storage_access_key))\"\n      secret_access_key: \"((terraform_storage_secret_key))\"\n    vars:\n      access_key: ((aws_access_key))\n      secret_key: ((aws_secret_key))\n    env:\n      AWS_ACCESS_KEY_ID: ((aws_access_key))\n      AWS_DEFAULT_REGION: ((aws_default_region))\n      AWS_SECRET_ACCESS_KEY: ((aws_secret_key))\n"
                    },
                    variables: {
                      path: "pipeline/variables.sample.yml",
                      destination: "pipeline/($ environment $)-variables.yml",
                      content: "env: ($ environment $)\nmagento_deploy_bucket_name: magento-deploy\nmagento_deploy_bucket_object_path: /catalog-magento/($ environment $)/magento.tar.gz\nmagento_deploy_bucket_region: eu-west-1\nmagento_deploy_bucket_access_key: ...\nmagento_deploy_bucket_secret_access_key: ...\nterraform_storage_access_key: ...\nterraform_storage_secret_key: ...\nterraform_storage_bucket_name: magento-terraform-remote-state\nterraform_storage_bucket_path: magento/($ environment $)\naws_access_key: ...\naws_secret_key: ...\naws_default_region: eu-west-1\n\nansible_vault_password: ...\nbastion_url: admin@bastion.server.com\nbastion_private_key_pair: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\ncatalog_magento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\nmagento_git_repository: git@github.com:myuser/code-magento.git\nmagento_git_branch: master\nmagento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\n\nmagento_config_git_repository: git@github.com:myuser/config-magento.git\nmagento_config_git_branch: master\nmagento_config_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n"
                    }
                  },
                  ansible: {
                    magento: {
                      path: "ansible/environments/front.yml.sample",
                      destination: "ansible/environments/($ environment $)-front.yml",
                      content: "# In this file you could override any variables present in default_front.yaml file\n\n# Usually you might want to override those variables :\n# magento_backend_frontname: admin\n# magento_admin_firstname: admin\n# magento_admin_lastname: admin\n# magento_admin_email: root@localhost.local\n# magento_admin_user: admin\n\n# magento_admin_password: 4Bigs3cr3t\n\n# In case you want to use vault to encrypt this password use the following command to generate the ansible vault var :\n# echo -n \"4Bigs3cr3t\" | ansible-vault encrypt_string --stdin-name=magento_admin_password\n#>> magento_admin_password: !vault |\n#>>           $ANSIBLE_VAULT;1.1;AES256\n#>>           37363232383334316164366337366430316535636130376134323366313565356365363662653539\n#>>           3161303331303565643831383839626263653362636466660a316530613935393464366536383839\n#>>           30303836326138306339623431356234333239343435623333343333623938633761636132303662\n#>>           3135343861383531660a393934316237363961663865393939313966373838653339326565353263\n#>>           6238\n"
                    }
                  },
                  terraform: {
                    magento: {
                      path: "terraform/magento.tf.sample",
                      destination: "terraform/magento/($ environment $)/magento.tf",
                      content: "variable \"rds_password\" {\n    default = \"ChangeMePls\"\n}\n\nmodule \"magento\" {\n  source = \"module-magento\"\n\n  env                      = \"($ environment $)\"\n  vpc_id                   = \"<vpc-id>\"\n  private_subnets_ids      = [\"private-subnets\"]\n  magento_ssl_cert         = \"<ssl-cert-arn>\"\n  bastion_sg_allow         = \"<bastion-sg>\"\n  public_subnets_ids       = [\"<public-subnets>\"]\n\n  rds_password             = \"${var.rds_password}\"\n\n  # project = \"magento\"\n\n  # FIXME optimized false : should be changes with the instance type ?\n\n  # rds_database         = \"magento\"\n  # rds_disk_size        = 10\n  # rds_multiaz          = false\n  # rds_storage_type     = \"gp2\"\n  # rds_subnet           = \"<rds-subnet-id>\"\n  # rds_type             = \"db.t2.small\"\n  # rds_username         = \"magento\"\n  # rds_engine           = \"\"mysql\"\n  # rds_engine_version   = \"5.7.16\"\n  # rds_backup_retention = 7\n  # rds_parameters       = \"\"\n\n  # cache_subnet                     = \"cache-subnet-id\"\n  # elasticache_type                 = \"cache.t2.micro\"\n  # elasticache_nodes                = \"1\n  # elasticache_parameter_group_name = \"default.redis3.2\"\n  # elasticache_engine               = \"redis\"\n  # elasticache_port                 = \"6379\"\n  # front_count           = \"1\"\n  # front_disk_size       = \"60\"\n  # front_disk_type       = \"gp2\"\n  # front_type            = \"t2.small\"\n\n}\n"
                    }
                  },
                  forms: {
                    pipeline: {
                      group1: [
                        {
                          widget: "text_area",
                          default: "nobucket",
                          type: "string",
                          description: "Bucket used to store magento code",
                          key: "magento_deploy_bucket_name",
                          name: "The bucket used"
                        },
                        {
                          widget: "text_area",
                          type: "string",
                          description: "Doesn't matter",
                          key: "no-exist",
                          name: "Some imaginary var"
                        }
                      ]
                    },
                    terraform: {
                      group2: [
                        {
                          widget: "simple_text",
                          type: "array",
                          description: "List of public network IDs",
                          key: "public_subnets_ids",
                          name: "Pub nets"
                        },
                        {
                          widget: "text_area",
                          type: "string",
                          description: "The VPC ID to run the project",
                          key: "vpc_id",
                          name: "VPC ID"
                        }
                      ]
                    }
                  }
                },
                second-usecase: {
                  pipeline: {
                    pipeline: {
                      path: "pipeline/magento.yml",
                      content: "groups:\n\n- name: magento-((env))\n  jobs:\n  - magento-((env))-build\n  - full-deploy-front-magento-((env))\n  - app-deploy-front-magento-((env))\n  - terraform-plan-magento-((env))\n  - terraform-apply-magento-((env))\n  - magento-((env))-unittests\n  - magento-((env))-functional-tests\n\nresource_types:\n\n- name: terraform\n  type: docker-image\n  source:\n    repository: ljfranklin/terraform-resource\n\nresources:\n\n- name: terraform-magento-((env))\n  type: terraform\n  source:\n    storage:\n      bucket: ((terraform_storage_bucket_name))\n      bucket_path: ((terraform_storage_bucket_path))\n      region_name: ((aws_default_region))\n      access_key_id: \"((terraform_storage_access_key))\"\n      secret_access_key: \"((terraform_storage_secret_key))\"\n    vars:\n      access_key: ((aws_access_key))\n      secret_key: ((aws_secret_key))\n    env:\n      AWS_ACCESS_KEY_ID: ((aws_access_key))\n      AWS_DEFAULT_REGION: ((aws_default_region))\n      AWS_SECRET_ACCESS_KEY: ((aws_secret_key))\n"
                    },
                    variables: {
                      path: "pipeline/variables.sample.yml",
                      destination: "pipeline/($ environment $)-variables.yml",
                      content: "env: ($ environment $)\nmagento_deploy_bucket_name: magento-deploy\nmagento_deploy_bucket_object_path: /catalog-magento/($ environment $)/magento.tar.gz\nmagento_deploy_bucket_region: eu-west-1\nmagento_deploy_bucket_access_key: ...\nmagento_deploy_bucket_secret_access_key: ...\nterraform_storage_access_key: ...\nterraform_storage_secret_key: ...\nterraform_storage_bucket_name: magento-terraform-remote-state\nterraform_storage_bucket_path: magento/($ environment $)\naws_access_key: ...\naws_secret_key: ...\naws_default_region: eu-west-1\n\nansible_vault_password: ...\nbastion_url: admin@bastion.server.com\nbastion_private_key_pair: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\ncatalog_magento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\nmagento_git_repository: git@github.com:myuser/code-magento.git\nmagento_git_branch: master\nmagento_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n\n\nmagento_config_git_repository: git@github.com:myuser/config-magento.git\nmagento_config_git_branch: master\nmagento_config_git_private_key: |-\n  -----BEGIN RSA PRIVATE KEY-----\n  -----END RSA PRIVATE KEY-----\n"
                    }
                  },
                  ansible: {
                    magento: {
                      path: "ansible/environments/front.yml.sample",
                      destination: "ansible/environments/($ environment $)-front.yml",
                      content: "# In this file you could override any variables present in default_front.yaml file\n\n# Usually you might want to override those variables :\n# magento_backend_frontname: admin\n# magento_admin_firstname: admin\n# magento_admin_lastname: admin\n# magento_admin_email: root@localhost.local\n# magento_admin_user: admin\n\n# magento_admin_password: 4Bigs3cr3t\n\n# In case you want to use vault to encrypt this password use the following command to generate the ansible vault var :\n# echo -n \"4Bigs3cr3t\" | ansible-vault encrypt_string --stdin-name=magento_admin_password\n#>> magento_admin_password: !vault |\n#>>           $ANSIBLE_VAULT;1.1;AES256\n#>>           37363232383334316164366337366430316535636130376134323366313565356365363662653539\n#>>           3161303331303565643831383839626263653362636466660a316530613935393464366536383839\n#>>           30303836326138306339623431356234333239343435623333343333623938633761636132303662\n#>>           3135343861383531660a393934316237363961663865393939313966373838653339326565353263\n#>>           6238\n"
                    }
                  },
                  terraform: {
                    magento: {
                      path: "terraform/magento.tf.sample",
                      destination: "terraform/magento/($ environment $)/magento.tf",
                      content: "variable \"rds_password\" {\n    default = \"ChangeMePls\"\n}\n\nmodule \"magento\" {\n  source = \"module-magento\"\n\n  env                      = \"($ environment $)\"\n  vpc_id                   = \"<vpc-id>\"\n  private_subnets_ids      = [\"private-subnets\"]\n  magento_ssl_cert         = \"<ssl-cert-arn>\"\n  bastion_sg_allow         = \"<bastion-sg>\"\n  public_subnets_ids       = [\"<public-subnets>\"]\n\n  rds_password             = \"${var.rds_password}\"\n\n  # project = \"magento\"\n\n  # FIXME optimized false : should be changes with the instance type ?\n\n  # rds_database         = \"magento\"\n  # rds_disk_size        = 10\n  # rds_multiaz          = false\n  # rds_storage_type     = \"gp2\"\n  # rds_subnet           = \"<rds-subnet-id>\"\n  # rds_type             = \"db.t2.small\"\n  # rds_username         = \"magento\"\n  # rds_engine           = \"\"mysql\"\n  # rds_engine_version   = \"5.7.16\"\n  # rds_backup_retention = 7\n  # rds_parameters       = \"\"\n\n  # cache_subnet                     = \"cache-subnet-id\"\n  # elasticache_type                 = \"cache.t2.micro\"\n  # elasticache_nodes                = \"1\n  # elasticache_parameter_group_name = \"default.redis3.2\"\n  # elasticache_engine               = \"redis\"\n  # elasticache_port                 = \"6379\"\n  # front_count           = \"1\"\n  # front_disk_size       = \"60\"\n  # front_disk_type       = \"gp2\"\n  # front_type            = \"t2.small\"\n\n}\n"
                    }
                  },
                  forms: {
                    pipeline: {
                      group1: [
                        {
                          widget: "text_area",
                          default: "nobucket",
                          type: "string",
                          description: "Bucket used to store magento code",
                          key: "magento_deploy_bucket_name",
                          name: "The bucket used"
                        },
                        {
                          widget: "text_area",
                          type: "string",
                          description: "Doesn't matter",
                          key: "no-exist",
                          name: "Some imaginary var"
                        }
                      ]
                    },
                    terraform: {
                      group2: [
                        {
                          widget: "simple_text",
                          type: "array",
                          description: "List of public network IDs",
                          key: "public_subnets_ids",
                          name: "Pub nets"
                        },
                        {
                          widget: "text_area",
                          type: "string",
                          description: "The VPC ID to run the project",
                          key: "vpc_id",
                          name: "VPC ID"
                        }
                      ]
                    }
                  }
                }
              }
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
    get:
      tags:
        - Service catalogs
      description: Get the information of the service catalog
      operationId: getServiceCatalog
      responses:
        '200':
          description: The information of the service catalog.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalog'
          examples:
            application/json:
              data:
                id: 1
                name: stack-magento
                author: Cycloid
                canonical: stack-magento
                image: 'http://via.placeholder.com/150x150'
                description: Super magento stack
                trusted: true
                keywords:
                  - stack
                  - php
                visibility: local
                ref: "cycloidio:stack-magento"
                directory: "/"
                technologies:
                  - technology: nginx
                    version: "1.15"
                  - technology: debian
                    version: "9.1"
                  - technology: magento
                    version: "2.2"
                  - technology: Php
                    version: "7.2"
                  - technology: Redis
                    version: "2.4"
                  - technology: Elasticsearch
                    version: "6.2"
                service_catalog_source_canonical: "scscan"
                created_at: 1503225026
                updated_at: 1503335026
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Service catalogs
      description: Update the information of the service catalog
      operationId: updateServiceCatalog
      parameters:
        - in: body
          name: body
          description: The information of the ServiceCatalog Terraform.
          required: true
          schema:
            $ref: '#/definitions/UpdateServiceCatalog'
      responses:
        '200':
          description: >-
            Updated the Service Catalog
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalog'
          examples:
            application/json:
              data:
                id: 1
                name: stack-magento
                author: Cycloid
                canonical: stack-magento
                image: 'http://via.placeholder.com/150x150'
                description: Super magento stack
                type: stack
                trusted: true
                keywords:
                  - stack
                  - php
                ref: "cycloidio:stack-magento"
                directory: "/"
                visibility: local
                technologies:
                  - technology: nginx
                    version: "1.15"
                  - technology: debian
                    version: "9.1"
                  - technology: magento
                    version: "2.2"
                  - technology: Php
                    version: "7.2"
                  - technology: Redis
                    version: "2.4"
                  - technology: Elasticsearch
                    version: "6.2"
                created_at: 1503225026
                updated_at: 1503335026
                service_catalog_source_canonical: "scscan"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - Service catalogs
      description: Delete the service catalog.
      operationId: deleteServiceCatalog
      responses:
        '204':
          description: Service Catalog has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '409':
          description: Service Catalog deletion has internal conflict
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/template':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
    post:
      tags:
        - Service catalogs
      description: |
        Create a new Service Catalog using the ref and use case passed as template
      operationId: createServiceCatalogFromTemplate
      parameters:
        - in: body
          name: body
          description: The information of the ServiceCatalog.
          required: true
          schema:
            $ref: '#/definitions/NewServiceCatalogFromTemplate'
      responses:
        '200':
          description: The information of the service catalog.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalog'
          examples:
            application/json:
              data:
                name: bootstrap-stack
                author: Cycloid
                canonical: bootstrap-stack
                service_catalog_source_canonical: "scscan"
                use_case: "aws-ec2"
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/{use_case_canonical}/terraform':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
      - $ref: '#/parameters/use_case_canonical'
    get:
      tags:
        - Service catalogs
      description: Get the information of the service catalog Terraform config
      operationId: getServiceCatalogTerraform
      responses:
        '200':
          description: The information of Terraform
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformJSONConfig'
          examples:
            application/json:
              data:
                config:
                  data:
                    aws_ami:
                      debian_jessie_latest:
                        most_recent: true
                  resource:
                    aws_elb:
                      front:
                        name: "${var.project}-front-${var.env}"
                        tags:
                          name: some name
                  variable:
                    front_disk_size:
                      default: 60
                  provider:
                    aws:
                      access_key: "${var.access_key}"
                  locals:
                    codecommit_repository_name: something
                  output:
                    sensitive:
                      sensitive: true
                      value: VALUE
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Service catalogs
      description: Update/Create the information of the service catalog Terraform config
      operationId: updateServiceCatalogTerraform
      parameters:
        - in: body
          name: body
          description: The information of the ServiceCatalog Terraform.
          required: true
          schema:
            $ref: '#/definitions/TerraformJSONConfig'
      responses:
        '204':
          description: Configuration has been updated
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/terraform/diagram':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
    get:
      tags:
        - Service catalogs
      description: Get the information of the service catalog Terraform diagram
      operationId: getServiceCatalogTerraformDiagram
      responses:
        '200':
          description: The information of Terraform Diagram
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformJSONDiagram'
              created_at:
                type: integer
                format: uint64
                minimum: 0
              updated_at:
                type: integer
                format: uint64
                minimum: 0
          examples:
            application/json:
              data:
                random:
                  data: true
              created_at: 1503225026
              updated_at: 1503335026  
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Service catalogs
      description: Update/Create the information of the service catalog Terraform diagram
      operationId: updateServiceCatalogTerraformDiagram
      parameters:
        - in: body
          name: body
          description: The information of the ServiceCatalog Terraform Diagram
          required: true
          schema:
            $ref: '#/definitions/TerraformJSONDiagram'
      responses:
        '204':
          description: Configuration has been updated
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/terraform/diagram/image':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
    get:
      tags:
        - Service catalogs
      description: Get the SC TF Image
      operationId: getServiceCatalogTerraformImage
      responses:
        '200':
          description: The SC TF Image
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/TerraformImage'
        '403':
          $ref: '#/responses/not_enough_permissions'
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - Service catalogs
      description: Update/Create the Image for the SC TF Image
      operationId: updateServiceCatalogTerraformImage
      parameters:
        - in: body
          name: body
          description: The information of the ServiceCatalog Terraform Diagram
          required: true
          schema:
            $ref: '#/definitions/TerraformImage'
      responses:
        '204':
          description: Configuration has been updated
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/organizations/{organization_canonical}/service_catalogs/{service_catalog_ref}/dependencies/validate':
    parameters:
      - $ref: '#/parameters/organization_canonical'
      - $ref: '#/parameters/service_catalog_ref'
    get:
      tags:
        - Service catalogs
      description: Validates the dependencies of a Service Catalog
      operationId: validateServiceCatalogDependencies
      responses:
        '200':
          description: The result of the service catalog's dependencies validation
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/ServiceCatalogDependenciesValidationResult'
          examples:
            application/json:
              data:
                errors:
                  - dependency 'abc' is required to deploy the stack
                warnings:
                  - dependency 'dep' is recommended to deploy the stack
        '403':
          $ref: '#/responses/not_enough_permissions'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/user/email/verification':
    post:
      tags:
        - User
      description: Re-send the verification user's email to the indicated address.
      operationId: emailVerificationResend
      security: []
      parameters:
        - in: body
          name: body
          description: >-
            The email address to re-send the verification email.
            This endpoint doesn't return any error status code if the email
            doesn't exist nor it's already verified for avoiding that an attacker
            could find registered users email address.
          required: true
          schema:
            $ref: '#/definitions/UserEmail'
      responses:
        '204':
          description: The email verification has been re-sent.
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/user/email/verification/{verification_token}':
    put:
      parameters:
        - $ref: '#/parameters/verification_token'
      tags:
        - User
      description: >-
        Verify that the email address is own by the user.
      operationId: emailVerification
      security: []
      responses:
        '204':
          description: Email address has been verified.
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/user/email/authentication/{authentication_token}':
    put:
      parameters:
        - $ref: '#/parameters/authentication_token'
      tags:
        - User
      description: >-
        Verify that the email address is own by the user.
      operationId: emailAuthenticationVerification
      security: []
      responses:
        '200':
          description: The token which represents the session of the user.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/UserSession'
          examples:
            application/json:
              data:
                owns:
                  - "organization:seraf:team:teamcan"
                permissions:
                  "organization:team:create":
                    id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
                token: >-
                  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9fX0.v6BuWwO6vN6PNW9d-Eqdoy7GHfUXKQ7byRbqwKRwHlA
        '401':
          $ref: '#/responses/unauthenticated'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  /user/guide:
    put:
      tags:
        - User
      description:
        Update user's guide progress.
      operationId: updateUserGuide
      security: []
      parameters:
        - in: body
          name: body
          description: The guide's progress JSON schema
          schema:
            $ref: '#/definitions/UserGuide'
      responses:
        '204':
          description: The guide progress has been updated.
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  /user/login:
    post:
      tags:
        - User
      description: Authenticate a user and return a new JWT token.
      operationId: login
      security: []
      parameters:
        - in: body
          name: body
          description: The user content
          required: true
          schema:
            $ref: '#/definitions/UserLogin'
      responses:
        '200':
          description: The token which represents the session of the user.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/UserSession'
          examples:
            application/json:
              data:
                owns:
                  - "organization:seraf:team:teamcan"
                permissions:
                  "organization:team:create":
                    id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
                token: >-
                  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9fX0.v6BuWwO6vN6PNW9d-Eqdoy7GHfUXKQ7byRbqwKRwHlA
        '401':
          $ref: '#/responses/unauthenticated'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  '/user/{social_type}/oauth':
    parameters:
      - $ref: '#/parameters/social_type'
    get:
      parameters:
        - $ref: '#/parameters/oauth_code'
      tags:
        - User
      description: >-
        Used to know if a user from the platform exists on that 'social_type'.
        If it exists we'll return the JWT 'token', if it does not we'll return
        the data of that user on the 'user' so it can be confirmed and created
      operationId: getOAuthUser
      security: []
      responses:
        '200':
          description: Used to know if a user from the platform exists on that 'social_type'.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/UserOAuth'
          examples:
            application/json:
              data:
                user:
                  email: "some@email.com"
                  given_name: "some name"
                  username: "some-name"
                  picture_url: "https://via.placeholder.com/150?text=cycloid.io"
                  social_id: "some-random-id"
        '401':
          $ref: '#/responses/unauthenticated'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - User
      description: >-
        Create a user from the OAuth 'social_type'
      operationId: createOAuthUser
      security: []
      parameters:
        - in: body
          name: body
          description: The user content
          required: true
          schema:
            $ref: '#/definitions/NewOAuthUser'
      responses:
        '200':
          description: Create a user from the OAuth 'social_type'
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/UserSession'
          examples:
            application/json:
              data:
                token: >-
                  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9LCJvcmdhbml6YXRpb24iOnsiaWQiOjIsImNhbm9uaWNhbCI6Im9yZzIiLCJuYW1lIjoiT3JnIDIifSwicGVybWlzc2lvbnMiOnsib3JnYW5pemF0aW9uOmRlbGV0ZSI6WyIxIl0sIm9yZ2FuaXphdGlvbjp1cGRhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpyZWFkIjpbXSwib3JnYW5pemF0aW9uOnRlYW06ZGVsZXRlIjpbIjIiXSwib3JnYW5pemF0aW9uOm1lbWJlcjpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOnJlYWQiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOmRlbGV0ZSI6W10sIm9yZ2FuaXphdGlvbjpwcm9qZWN0OnJlYWQiOltdfX19.CHA3146UEHwVW6nYkDgYeSukGeZIH55mi4O0LsemenA
        '401':
          $ref: '#/responses/unauthenticated'
        default:
          $ref: '#/responses/unexpected_error'
  '/user/refresh_token':
    parameters:
      - $ref: '#/parameters/organization_canonical_query'
      - $ref: '#/parameters/child_canonical_query'
    get:
      tags:
        - User
      description: >-
        Refresh the user JWT and returns a new one if the previous is valid. The 'organization_canonical_query' has
        to be of an organization in which the user belongs to, and the 'child_canonical_query' of a child of the
        'organization_canonical_query' in any level (could be of a grand child).
      operationId: refreshToken
      responses:
        '200':
          description: The token which represents the session of the user.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/UserSession'
          examples:
            application/json:
              data:
                owns:
                  - "organization:seraf:team:teamcan"
                permissions:
                  "organization:team:create":
                    id: 21
                    effect: "allow"
                    action: 'organization:team:read'
                    resources: ["organization:org-can:team:team-can"]
                token: >-
                  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0YjdiZjZlLTE1NmYtNDYxMy05NmFiLWIwMzg5NzdiMWRkMSJ9.eyJpc3MiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJzdWIiOiJodHRwczovL2N5Y2xvaWQuaW8iLCJhdWQiOiJjdXN0b21lciIsIm5iZiI6MTUwMzQ3NDg2NywiaWF0IjoxNTAzNDc0ODY3LCJqdGkiOiJjNDU5ODgwMS04YWQzLTRhMDctODIwZC02MzRmN2RkMWQ2MDgiLCJjeWNsb2lkIjp7InVzZXIiOnsiaWQiOjEsInVzZXJuYW1lIjoidXNlci0xIiwiZ2l2ZW5fbmFtZSI6Ik1hcmlhbm8iLCJmYW1pbHlfbmFtZSI6IkppbWVuZXoiLCJwaWN0dXJlX3VybCI6Imh0dHBzOi8vYXZhdGFyczIuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTQ1NzkyMTAiLCJsb2NhbGUiOiJlbiJ9LCJvcmdhbml6YXRpb24iOnsiaWQiOjIsImNhbm9uaWNhbCI6Im9yZzIiLCJuYW1lIjoiT3JnIDIifSwicGVybWlzc2lvbnMiOnsib3JnYW5pemF0aW9uOmRlbGV0ZSI6WyIxIl0sIm9yZ2FuaXphdGlvbjp1cGRhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246dGVhbTpyZWFkIjpbXSwib3JnYW5pemF0aW9uOnRlYW06ZGVsZXRlIjpbIjIiXSwib3JnYW5pemF0aW9uOm1lbWJlcjpjcmVhdGUiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOnJlYWQiOltdLCJvcmdhbml6YXRpb246bWVtYmVyOmRlbGV0ZSI6W10sIm9yZ2FuaXphdGlvbjpwcm9qZWN0OnJlYWQiOltdfX19.CHA3146UEHwVW6nYkDgYeSukGeZIH55mi4O0LsemenA
        '401':
          $ref: '#/responses/unauthenticated'
        default:
          $ref: '#/responses/unexpected_error'
  '/user/reset_password':
    post:
      tags:
        - User
      description: >-
        Request to reset the password.
        Due to security reasons, this endpoint doesn't return Not Found (404)
        when the email doesn't exist or belongs to a user primary email.
      operationId: passwordResetReq
      security: []
      parameters:
        - in: body
          name: body
          description: The reset password payload
          required: true
          schema:
            $ref: '#/definitions/UserPasswordResetReq'
      responses:
        '204':
          description: The password has been changed.
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - User
      description: >-
        Reset the user password when it has been forgotten.
        Due to security reasons, the endpoint doesn't return a Unprocessable
        Entity (422) when the token is invalid.
        404 Status code is returned if the user has been deleted of the system
        between the user password request and this request.
      operationId: passwordResetUpdate
      security: []
      parameters:
        - in: body
          name: body
          description: The reset password payload
          required: true
          schema:
            $ref: '#/definitions/UserPasswordResetUpdate'
      responses:
        '204':
          description: The password has been changed.
        '404':
          $ref: '#/responses/not_found_entity_in_path'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
  /user:
    get:
      tags:
        - User
      description: Get the information of the account of the authenticated user.
      operationId: getUserAccount
      responses:
        '200':
          description: The user account information.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/UserAccount'
          examples:
            application/json:
              data:
                created_at: 1503225026
                updated_at: 1503335026
                last_login: 1503413020
                emails:
                  - email: mariano@jimenez.com
                    verified: true
                    purpose: primary
                username: user-1
                given_name: Mariano
                family_name: Jimenez
                picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                locale: en
                country: 
                  code: "GB"
                  name: "United Kingdom"
                guide:
                  tutorial:
                    welcome: false
                    letsgo: false
                    credentials: false
                    createProject: false
                    selectStack: false
                    configEnv: false
                    customEnvConfig: false
                    reviewDeploy: false
                    deployed: false
                    tasksDetails: false
                    finish: false
                  presentation: false
        default:
          $ref: '#/responses/unexpected_error'
    put:
      tags:
        - User
      description: Update the information of the account of the authenticated user.
      operationId: updateUserAccount
      parameters:
        - in: body
          name: body
          description: The user content
          required: true
          schema:
            $ref: '#/definitions/UpdateUserAccount'
      responses:
        '200':
          description: The updated user profile information.
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/definitions/UserAccount'
          examples:
            application/json:
              data:
                created_at: 1503225026
                updated_at: 1503335026
                last_login: 1503413020
                emails:
                  - email: mariano@jimenez.com
                    verified: true
                    purpose: primary
                username: user-1
                given_name: Mariano
                family_name: Jimenez
                picture_url: 'https://avatars2.githubusercontent.com/u/14579210'
                locale: en
                country_code: UK
        '409':
          description: Trying setting an unverified email as the primary
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        '503':
          $ref: '#/responses/retry_operation'
        default:
          $ref: '#/responses/unexpected_error'
    post:
      tags:
        - User
      description: Create a new User (sign-up).
      operationId: signUp
      security: []
      parameters:
        - in: body
          name: body
          description: The user content
          required: true
          schema:
            $ref: '#/definitions/NewUserAccount'
      responses:
        '204':
          description: >-
            Account created. The account MUST be verified through the link sent
            to the email address.
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
    delete:
      tags:
        - User
      description: The authenticated user delete itself from the system.
      operationId: deleteUserAccount
      responses:
        '204':
          description: User account has been deleted.
        '403':
          $ref: '#/responses/not_enough_permissions'
        default:
          $ref: '#/responses/unexpected_error'
  /user/aws_marketplace/entitlement:
    post:
      tags:
        - User
      description: |
        This endpoint handles redirections from AWS Marketplace to our system.
        If user doesn't exist, he'll be redirected to registration page.
        If user exist, he'll be redirected to login page.
      operationId: handleAWSMarketplaceUserEntitlement
      security: []
      consumes:
        - application/x-www-form-urlencoded
      responses:
        '301':
          description: The user is redirected based on his account state.
          headers:
            Location:
              type: "string"
        default:
          $ref: '#/responses/unexpected_error'
  /user/aws_marketplace:
    post:
      tags:
        - User
      description: Create a new AWS Marketplace User.
      operationId: signUpAWSMarketplace
      security: []
      parameters:
        - in: body
          name: body
          description: The user content
          required: true
          schema:
            $ref: '#/definitions/NewAWSMarketplaceUserAccount'
      responses:
        '204':
          description: >-
            Account created. The account MUST be verified through the link sent
            to the email address.
        '411':
          $ref: '#/responses/required_content_length_header'
        '422':
          $ref: '#/responses/unprocessable_entity'
        default:
          $ref: '#/responses/unexpected_error'
