Qovery / scaleway-api-rs

Rust lib for Scaleway API
GNU General Public License v3.0
9 stars 1 forks source link

add `iot` open API specs #5

Closed benjaminch closed 3 years ago

benjaminch commented 3 years ago

Seems iot open API specs is not valid from openAPI generator stand point:

https://developers.scaleway.com/static/db0705c3936ee4c1f242eeded486d866/scaleway.iot.v1.Api.yml

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 4, Warning count: 0
Errors:
        -attribute components.schemas.scaleway.std.TimeSeries.Point.items is missing
        -attribute paths.'/iot/v1/regions/{region}/devices/{device_id}/metrics'(get).parameters.[start_date].schemas.default=`hour` is not of type `date-time`
        -attribute components.schemas.scaleway.std.TimeSeries.Point.items is not of type `object`
        -attribute paths.'/iot/v1/regions/{region}/hubs/{hub_id}/metrics'(get).parameters.[start_date].schemas.default=`hour` is not of type `date-time`

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:546)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:573)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:433)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
remyleone commented 3 years ago

Try this one:

openapi: 3.0.0
info:
  title: IoT API
  description: |
    # Introduction

    Scaleway IoT Hub is a PaaS enabling device-to-device and device-to-Scaleway communication, you can see it as a managed message broker.

    Main features:

    - Pub/Sub architecture
    - MQTT protocol, with or without TLS, with or without WebSockets
    - Mutual authentication available on TLS connections
    - High Availability and Scalability
    - Routes to Scaleway's ecosystem for data ingestion
    - Multiple other IoT Networks such as SigFox or LoRa
    - Usage metrics

    We have planned a lot of other exciting features, do not hesitate to reach out to us and say what you would like to see next!

    # Where to reach us ?

    We are available on [Scaleway Community Slack](http://slack.scaleway.com) on the `#iot-hub` channel.

    ## Current Technical Limitations

    - A single region is supported, your hub will be located in Paris, France (`fr-par`).

    # Online documentation

    Please refer to our [online documentation](https://www.scaleway.com/en/docs/scaleway-iothub/) to get more information.

    ## Getting started with IoT Hub API

    - [How to use IoT API with curl](https://www.scaleway.com/en/docs/scaleway-iothub-howto-curl/)
  version: v1
servers:
- url: https://api.scaleway.com
tags:
- name: IoT Hubs
  description: Managed message brokers
- name: IoT Devices
  description: Devices allowed to connect to a Hub
- name: IoT Routes
  description: Managed routes
- name: IoT Networks
  description: Links to external IoT networks
components:
  schemas:
    google.protobuf.StringValue:
      type: string
      nullable: true
    google.protobuf.UInt32Value:
      type: number
      nullable: true
    scaleway.iot.v1.CreateDeviceResponse:
      type: object
      properties:
        device:
          type: object
          description: Created device information
          properties:
            id:
              type: string
              description: Device ID, also used as MQTT Client ID or Username
            name:
              type: string
              description: Device name
            description:
              type: string
              description: Device description
            status:
              type: string
              description: Device status
              enum:
              - unknown
              - error
              - enabled
              - disabled
              default: unknown
            hub_id:
              type: string
              description: Hub ID
            last_activity_at:
              type: string
              description: Device last connection/activity date
              format: date-time
            is_connected:
              type: boolean
              description: Whether the device is connected to the Hub or not
            allow_insecure:
              type: boolean
              description: Whether to allow device to connect without TLS mutual authentication
            allow_multiple_connections:
              type: boolean
              description: Whether to allow multiple physical devices to connect with
                this device's credentials
            message_filters:
              type: object
              description: Filter-sets to restrict the topics the device can publish/subscribe
                to
              properties:
                publish:
                  type: object
                  description: Filtering rule to restrict topics the device can publish
                    to
                  properties:
                    policy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                    topics:
                      $ref: '#/components/schemas/scaleway.std.StringsValue'
                  x-properties-order:
                  - policy
                  - topics
                subscribe:
                  type: object
                  description: Filtering rule to restrict topics the device can subscribe
                    to
                  properties:
                    policy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                    topics:
                      $ref: '#/components/schemas/scaleway.std.StringsValue'
                  x-properties-order:
                  - policy
                  - topics
              x-properties-order:
              - publish
              - subscribe
            has_custom_certificate:
              type: boolean
              description: Assigning a custom certificate allows a device to authenticate
                using that specific certificate without checking the hub's CA certificate.
            created_at:
              type: string
              description: Device add date
              format: date-time
            updated_at:
              type: string
              description: Device last modification date
              format: date-time
          x-properties-order:
          - id
          - name
          - description
          - status
          - hub_id
          - last_activity_at
          - is_connected
          - allow_insecure
          - allow_multiple_connections
          - message_filters
          - has_custom_certificate
          - created_at
          - updated_at
        certificate:
          type: object
          description: Device certificate
          properties:
            crt:
              type: string
            key:
              type: string
          x-properties-order:
          - crt
          - key
      x-properties-order:
      - device
      - certificate
    scaleway.iot.v1.CreateNetworkResponse:
      type: object
      properties:
        network:
          type: object
          description: Created network
          properties:
            id:
              type: string
              description: Network ID
            name:
              type: string
              description: Network name
            type:
              type: string
              description: Type of network to connect with
              enum:
              - unknown
              - sigfox
              - rest
              default: unknown
            endpoint:
              type: string
              description: Endpoint to use for interacting with the network
            hub_id:
              type: string
              description: Hub ID to connect the Network to
            created_at:
              type: string
              description: Network creation date
              format: date-time
            topic_prefix:
              type: string
              description: This prefix will be prepended to all topics for this Network.
          x-properties-order:
          - id
          - name
          - type
          - endpoint
          - hub_id
          - created_at
          - topic_prefix
        secret:
          type: string
          description: Endpoint Key to keep secret. This cannot be retrieved later
      x-properties-order:
      - network
      - secret
    scaleway.iot.v1.Device:
      type: object
      properties:
        id:
          type: string
          description: Device ID, also used as MQTT Client ID or Username
        name:
          type: string
          description: Device name
        description:
          type: string
          description: Device description
        status:
          type: string
          description: Device status
          enum:
          - unknown
          - error
          - enabled
          - disabled
          default: unknown
        hub_id:
          type: string
          description: Hub ID
        last_activity_at:
          type: string
          description: Device last connection/activity date
          format: date-time
        is_connected:
          type: boolean
          description: Whether the device is connected to the Hub or not
        allow_insecure:
          type: boolean
          description: Whether to allow device to connect without TLS mutual authentication
        allow_multiple_connections:
          type: boolean
          description: Whether to allow multiple physical devices to connect with
            this device's credentials
        message_filters:
          type: object
          description: Filter-sets to restrict the topics the device can publish/subscribe
            to
          properties:
            publish:
              type: object
              description: Filtering rule to restrict topics the device can publish
                to
              properties:
                policy:
                  $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                topics:
                  $ref: '#/components/schemas/scaleway.std.StringsValue'
              x-properties-order:
              - policy
              - topics
            subscribe:
              type: object
              description: Filtering rule to restrict topics the device can subscribe
                to
              properties:
                policy:
                  $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                topics:
                  $ref: '#/components/schemas/scaleway.std.StringsValue'
              x-properties-order:
              - policy
              - topics
          x-properties-order:
          - publish
          - subscribe
        has_custom_certificate:
          type: boolean
          description: Assigning a custom certificate allows a device to authenticate
            using that specific certificate without checking the hub's CA certificate.
        created_at:
          type: string
          description: Device add date
          format: date-time
        updated_at:
          type: string
          description: Device last modification date
          format: date-time
      x-properties-order:
      - id
      - name
      - description
      - status
      - hub_id
      - last_activity_at
      - is_connected
      - allow_insecure
      - allow_multiple_connections
      - message_filters
      - has_custom_certificate
      - created_at
      - updated_at
    scaleway.iot.v1.Device.MessageFilters.Rule.Policy:
      type: string
      enum:
      - unknown
      - accept
      - reject
      default: unknown
    scaleway.iot.v1.GetDeviceCertificateResponse:
      type: object
      properties:
        device:
          type: object
          description: Created device information
          properties:
            id:
              type: string
              description: Device ID, also used as MQTT Client ID or Username
            name:
              type: string
              description: Device name
            description:
              type: string
              description: Device description
            status:
              type: string
              description: Device status
              enum:
              - unknown
              - error
              - enabled
              - disabled
              default: unknown
            hub_id:
              type: string
              description: Hub ID
            last_activity_at:
              type: string
              description: Device last connection/activity date
              format: date-time
            is_connected:
              type: boolean
              description: Whether the device is connected to the Hub or not
            allow_insecure:
              type: boolean
              description: Whether to allow device to connect without TLS mutual authentication
            allow_multiple_connections:
              type: boolean
              description: Whether to allow multiple physical devices to connect with
                this device's credentials
            message_filters:
              type: object
              description: Filter-sets to restrict the topics the device can publish/subscribe
                to
              properties:
                publish:
                  type: object
                  description: Filtering rule to restrict topics the device can publish
                    to
                  properties:
                    policy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                    topics:
                      $ref: '#/components/schemas/scaleway.std.StringsValue'
                  x-properties-order:
                  - policy
                  - topics
                subscribe:
                  type: object
                  description: Filtering rule to restrict topics the device can subscribe
                    to
                  properties:
                    policy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                    topics:
                      $ref: '#/components/schemas/scaleway.std.StringsValue'
                  x-properties-order:
                  - policy
                  - topics
              x-properties-order:
              - publish
              - subscribe
            has_custom_certificate:
              type: boolean
              description: Assigning a custom certificate allows a device to authenticate
                using that specific certificate without checking the hub's CA certificate.
            created_at:
              type: string
              description: Device add date
              format: date-time
            updated_at:
              type: string
              description: Device last modification date
              format: date-time
          x-properties-order:
          - id
          - name
          - description
          - status
          - hub_id
          - last_activity_at
          - is_connected
          - allow_insecure
          - allow_multiple_connections
          - message_filters
          - has_custom_certificate
          - created_at
          - updated_at
        certificate_pem:
          type: string
          description: Device certificate
      x-properties-order:
      - device
      - certificate_pem
    scaleway.iot.v1.GetDeviceMetricsResponse:
      type: object
      properties:
        metrics:
          type: array
          description: Metrics for a device over the requested period
          items:
            $ref: '#/components/schemas/scaleway.std.TimeSeries'
      x-properties-order:
      - metrics
    scaleway.iot.v1.GetHubCAResponse:
      type: object
      properties:
        ca_cert_pem:
          type: string
      x-properties-order:
      - ca_cert_pem
    scaleway.iot.v1.GetHubMetricsResponse:
      type: object
      properties:
        metrics:
          type: array
          description: Metrics for a hub over the requested period
          items:
            $ref: '#/components/schemas/scaleway.std.TimeSeries'
      x-properties-order:
      - metrics
    scaleway.iot.v1.Hub:
      type: object
      properties:
        id:
          type: string
          description: Hub ID
        name:
          type: string
          description: Hub name
        status:
          type: string
          description: Current status of the Hub
          enum:
          - unknown
          - error
          - enabling
          - ready
          - disabling
          - disabled
          default: unknown
        product_plan:
          type: string
          description: Hub feature set
          enum:
          - plan_unknown
          - plan_shared
          - plan_dedicated
          - plan_ha
          default: plan_unknown
        enabled:
          type: boolean
          description: Whether the hub has been enabled
        device_count:
          type: number
          description: Number of registered devices
        connected_device_count:
          type: number
          description: Number of currently connected devices
        endpoint:
          type: string
          description: Devices should be connected to this host, port may be 1883
            (MQTT), 8883 (MQTT over TLS), 80 (MQTT over Websocket) or 443 (MQTT over
            Websocket over TLS).
        disable_events:
          type: boolean
          description: Disable Hub events
        events_topic_prefix:
          type: string
          description: Hub events topic prefix
        region:
          type: string
          description: Region of the Hub
        created_at:
          type: string
          description: Hub creation date
          format: date-time
        updated_at:
          type: string
          description: Hub last modification date
          format: date-time
        project_id:
          type: string
          description: Project owning the resource
        organization_id:
          type: string
          description: Organization owning the resource
        enable_device_auto_provisioning:
          type: boolean
          description: When an unknown device connects to your hub using a valid certificate
            chain, it will be automatically provisioned inside your hub. The hub uses
            the common name of the device certifcate to find out if a device with
            the same name already exists. This setting can only be enabled on a hub
            with a custom certificate authority.
        has_custom_ca:
          type: boolean
          description: After creating a hub, this flag is set to False as the hub
            certificates are managed by Scaleway. Once a custom certificate authority
            is installed, this flag will be set to true.
      x-properties-order:
      - id
      - name
      - status
      - product_plan
      - enabled
      - device_count
      - connected_device_count
      - endpoint
      - disable_events
      - events_topic_prefix
      - region
      - created_at
      - updated_at
      - project_id
      - organization_id
      - enable_device_auto_provisioning
      - has_custom_ca
    scaleway.iot.v1.ListDevicesResponse:
      type: object
      properties:
        total_count:
          type: number
          description: Total number of devices
        devices:
          type: array
          description: A page of devices
          items:
            $ref: '#/components/schemas/scaleway.iot.v1.Device'
      x-properties-order:
      - total_count
      - devices
    scaleway.iot.v1.ListHubsResponse:
      type: object
      properties:
        total_count:
          type: number
          description: Total number of hubs
        hubs:
          type: array
          description: A page of hubs
          items:
            $ref: '#/components/schemas/scaleway.iot.v1.Hub'
      x-properties-order:
      - total_count
      - hubs
    scaleway.iot.v1.ListNetworksResponse:
      type: object
      properties:
        total_count:
          type: number
          description: Total number of Networks
        networks:
          type: array
          description: A page of networks
          items:
            $ref: '#/components/schemas/scaleway.iot.v1.Network'
      x-properties-order:
      - total_count
      - networks
    scaleway.iot.v1.ListRoutesResponse:
      type: object
      properties:
        total_count:
          type: number
          description: Total number of routes
        routes:
          type: array
          description: A page of routes
          items:
            $ref: '#/components/schemas/scaleway.iot.v1.RouteSummary'
      x-properties-order:
      - total_count
      - routes
    scaleway.iot.v1.Network:
      type: object
      properties:
        id:
          type: string
          description: Network ID
        name:
          type: string
          description: Network name
        type:
          type: string
          description: Type of network to connect with
          enum:
          - unknown
          - sigfox
          - rest
          default: unknown
        endpoint:
          type: string
          description: Endpoint to use for interacting with the network
        hub_id:
          type: string
          description: Hub ID to connect the Network to
        created_at:
          type: string
          description: Network creation date
          format: date-time
        topic_prefix:
          type: string
          description: This prefix will be prepended to all topics for this Network.
      x-properties-order:
      - id
      - name
      - type
      - endpoint
      - hub_id
      - created_at
      - topic_prefix
    scaleway.iot.v1.RenewDeviceCertificateResponse:
      type: object
      properties:
        device:
          type: object
          description: Created device information
          properties:
            id:
              type: string
              description: Device ID, also used as MQTT Client ID or Username
            name:
              type: string
              description: Device name
            description:
              type: string
              description: Device description
            status:
              type: string
              description: Device status
              enum:
              - unknown
              - error
              - enabled
              - disabled
              default: unknown
            hub_id:
              type: string
              description: Hub ID
            last_activity_at:
              type: string
              description: Device last connection/activity date
              format: date-time
            is_connected:
              type: boolean
              description: Whether the device is connected to the Hub or not
            allow_insecure:
              type: boolean
              description: Whether to allow device to connect without TLS mutual authentication
            allow_multiple_connections:
              type: boolean
              description: Whether to allow multiple physical devices to connect with
                this device's credentials
            message_filters:
              type: object
              description: Filter-sets to restrict the topics the device can publish/subscribe
                to
              properties:
                publish:
                  type: object
                  description: Filtering rule to restrict topics the device can publish
                    to
                  properties:
                    policy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                    topics:
                      $ref: '#/components/schemas/scaleway.std.StringsValue'
                  x-properties-order:
                  - policy
                  - topics
                subscribe:
                  type: object
                  description: Filtering rule to restrict topics the device can subscribe
                    to
                  properties:
                    policy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                    topics:
                      $ref: '#/components/schemas/scaleway.std.StringsValue'
                  x-properties-order:
                  - policy
                  - topics
              x-properties-order:
              - publish
              - subscribe
            has_custom_certificate:
              type: boolean
              description: Assigning a custom certificate allows a device to authenticate
                using that specific certificate without checking the hub's CA certificate.
            created_at:
              type: string
              description: Device add date
              format: date-time
            updated_at:
              type: string
              description: Device last modification date
              format: date-time
          x-properties-order:
          - id
          - name
          - description
          - status
          - hub_id
          - last_activity_at
          - is_connected
          - allow_insecure
          - allow_multiple_connections
          - message_filters
          - has_custom_certificate
          - created_at
          - updated_at
        certificate:
          type: object
          description: Device certificate
          properties:
            crt:
              type: string
            key:
              type: string
          x-properties-order:
          - crt
          - key
      x-properties-order:
      - device
      - certificate
    scaleway.iot.v1.Route:
      type: object
      properties:
        id:
          type: string
          description: Route ID
        name:
          type: string
          description: Route name
        hub_id:
          type: string
          description: ID of the route's hub
        topic:
          type: string
          description: Topic the route subscribes to. It must be a valid MQTT topic
            and up to 65535 characters
        type:
          type: string
          description: Route type
          enum:
          - unknown
          - s3
          - database
          - rest
          default: unknown
        created_at:
          type: string
          description: Route creation date
          format: date-time
        s3_config:
          type: object
          description: When using S3 Route, S3-specific configuration fields
          properties:
            bucket_region:
              type: string
              description: Region of the S3 route's destination bucket (eg 'fr-par')
            bucket_name:
              type: string
              description: Name of the S3 route's destination bucket
            object_prefix:
              type: string
              description: Optional string to prefix object names with
            strategy:
              type: string
              description: 'How the S3 route''s objects will be created: one per topic
                or one per message'
              enum:
              - unknown
              - per_topic
              - per_message
              default: unknown
          x-properties-order:
          - bucket_region
          - bucket_name
          - object_prefix
          - strategy
          x-one-of: Config
        db_config:
          type: object
          description: When using Database Route, DB-specific configuration fields
          properties:
            engine:
              type: string
              description: Database engine the route will connect to. If not specified,
                will default to 'PostgreSQL'
              enum:
              - unknown
              - postgresql
              - mysql
              default: unknown
            host:
              type: string
              description: Database host
            port:
              type: number
              description: Database port
            dbname:
              type: string
              description: Database name
            username:
              type: string
              description: Database username. Make sure this account can execute the
                provided query
            password:
              type: string
              description: Database password
            query:
              type: string
              description: SQL query to be executed ($TOPIC and $PAYLOAD variables
                are available, see documentation)
          required:
          - host
          - port
          - dbname
          - username
          - password
          x-properties-order:
          - engine
          - host
          - port
          - dbname
          - username
          - password
          - query
          x-one-of: Config
        rest_config:
          type: object
          description: When using Rest Route, Rest-specific configuration fields
          properties:
            verb:
              type: string
              description: HTTP Verb used to call REST URI
              enum:
              - unknown
              - get
              - post
              - put
              - patch
              - delete
              default: unknown
            uri:
              type: string
              description: URI of the REST endpoint
            headers:
              type: object
              description: HTTP call extra headers
              properties:
                <headerKey>:
                  type: string
              additionalProperties: true
          x-properties-order:
          - verb
          - uri
          - headers
          x-one-of: Config
        updated_at:
          type: string
          description: Route last update date
          format: date-time
      x-properties-order:
      - id
      - name
      - hub_id
      - topic
      - type
      - created_at
      - s3_config
      - db_config
      - rest_config
      - updated_at
    scaleway.iot.v1.Route.DatabaseConfig.Engine:
      type: string
      enum:
      - unknown
      - postgresql
      - mysql
      default: unknown
    scaleway.iot.v1.Route.RestConfig.HttpVerb:
      type: string
      enum:
      - unknown
      - get
      - post
      - put
      - patch
      - delete
      default: unknown
    scaleway.iot.v1.Route.S3Config.S3Strategy:
      type: string
      enum:
      - unknown
      - per_topic
      - per_message
      default: unknown
    scaleway.iot.v1.RouteSummary:
      type: object
      properties:
        id:
          type: string
          description: Route ID
        name:
          type: string
          description: Route name
        hub_id:
          type: string
          description: ID of the route's hub
        topic:
          type: string
          description: Topic the route subscribes to. It must be a valid MQTT topic
            and up to 65535 characters
        type:
          type: string
          description: Route type
          enum:
          - unknown
          - s3
          - database
          - rest
          default: unknown
        created_at:
          type: string
          description: Route creation date
          format: date-time
        updated_at:
          type: string
          description: Route last update date
          format: date-time
      x-properties-order:
      - id
      - name
      - hub_id
      - topic
      - type
      - created_at
      - updated_at
    scaleway.iot.v1.SetDeviceCertificateResponse:
      type: object
      properties:
        device:
          $ref: '#/components/schemas/scaleway.iot.v1.Device'
        certificate_pem:
          type: string
      x-properties-order:
      - device
      - certificate_pem
    scaleway.std.MapStringStringValue:
      type: object
      properties:
        <key>:
          type: string
      nullable: true
    scaleway.std.StringsValue:
      type: array
      nullable: true
      items:
        type: string
    scaleway.std.TimeSeries:
      type: object
      properties:
        name:
          type: string
        points:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.std.TimeSeries.Point'
        metadata:
          type: object
          properties:
            <metadataKey>:
              type: string
          additionalProperties: true
      x-properties-order:
      - name
      - points
      - metadata
    scaleway.std.TimeSeries.Point:
      type: array
      items:
        oneOf:
        - type: string
          format: date-time
        - type: number
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /iot/v1/regions/{region}/devices:
    get:
      tags:
      - IoT Devices
      operationId: ListDevices
      summary: List devices
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: query
        name: page
        description: Page number
        schema:
          type: number
          description: Page number
          default: 1
      - in: query
        name: page_size
        description: Page size. The maximum value is 100
        schema:
          type: number
          description: Page size. The maximum value is 100
          default: 20
      - in: query
        name: order_by
        description: Ordering of requested devices
        schema:
          type: string
          description: Ordering of requested devices
          enum:
          - name_asc
          - name_desc
          - status_asc
          - status_desc
          - hub_id_asc
          - hub_id_desc
          - created_at_asc
          - created_at_desc
          - updated_at_asc
          - updated_at_desc
          - allow_insecure_asc
          - allow_insecure_desc
          default: name_asc
      - in: query
        name: name
        description: Filter on the name
        schema:
          type: string
          description: Filter on the name
          nullable: true
      - in: query
        name: hub_id
        description: Filter on the hub
        schema:
          type: string
          description: Filter on the hub
          nullable: true
      - in: query
        name: allow_insecure
        description: Filter on the allow_insecure flag
        schema:
          type: boolean
          description: Filter on the allow_insecure flag
          nullable: true
      - in: query
        name: status
        description: Device status (enabled, disabled, etc.)
        schema:
          type: string
          description: Device status (enabled, disabled, etc.)
          enum:
          - unknown
          - error
          - enabled
          - disabled
          default: unknown
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.ListDevicesResponse'
      security:
      - scaleway: []
    post:
      tags:
      - IoT Devices
      operationId: CreateDevice
      summary: Add a device
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.CreateDeviceResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Device name
                hub_id:
                  type: string
                  description: ID of the device's hub
                allow_insecure:
                  type: boolean
                  description: Allow plain and server-authenticated SSL connections
                    in addition to mutually-authenticated ones
                allow_multiple_connections:
                  type: boolean
                  description: Allow multiple physical devices to connect with this
                    device's credentials
                message_filters:
                  type: object
                  description: Filter-sets to authorize or deny the device to publish/subscribe
                    to specific topics
                  properties:
                    publish:
                      type: object
                      description: Filtering rule to restrict topics the device can
                        publish to
                      properties:
                        policy:
                          $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                        topics:
                          $ref: '#/components/schemas/scaleway.std.StringsValue'
                      x-properties-order:
                      - policy
                      - topics
                    subscribe:
                      type: object
                      description: Filtering rule to restrict topics the device can
                        subscribe to
                      properties:
                        policy:
                          $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                        topics:
                          $ref: '#/components/schemas/scaleway.std.StringsValue'
                      x-properties-order:
                      - policy
                      - topics
                  x-properties-order:
                  - publish
                  - subscribe
                description:
                  type: string
                  description: Device description
                  nullable: true
              required:
              - name
              - hub_id
              x-properties-order:
              - name
              - hub_id
              - allow_insecure
              - allow_multiple_connections
              - message_filters
              - description
      security:
      - scaleway: []
  /iot/v1/regions/{region}/devices/{device_id}:
    get:
      tags:
      - IoT Devices
      operationId: GetDevice
      summary: Get a device
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Device'
      security:
      - scaleway: []
    patch:
      tags:
      - IoT Devices
      operationId: UpdateDevice
      summary: Update a device
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Device'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                  description: Device description
                  nullable: true
                allow_insecure:
                  type: boolean
                  description: Allow plain and server-authenticated SSL connections
                    in addition to mutually-authenticated ones
                  nullable: true
                allow_multiple_connections:
                  type: boolean
                  description: Allow multiple physical devices to connect with this
                    device's credentials
                  nullable: true
                message_filters:
                  type: object
                  description: Filter-sets to restrict the topics the device can publish/subscribe
                    to
                  properties:
                    publish:
                      type: object
                      description: Filtering rule to restrict topics the device can
                        publish to
                      properties:
                        policy:
                          $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                        topics:
                          $ref: '#/components/schemas/scaleway.std.StringsValue'
                      x-properties-order:
                      - policy
                      - topics
                    subscribe:
                      type: object
                      description: Filtering rule to restrict topics the device can
                        subscribe to
                      properties:
                        policy:
                          $ref: '#/components/schemas/scaleway.iot.v1.Device.MessageFilters.Rule.Policy'
                        topics:
                          $ref: '#/components/schemas/scaleway.std.StringsValue'
                      x-properties-order:
                      - policy
                      - topics
                  x-properties-order:
                  - publish
                  - subscribe
                hub_id:
                  type: string
                  description: Change Hub for this device, additional fees may apply,
                    see IoT Hub pricing
                  nullable: true
              x-properties-order:
              - description
              - allow_insecure
              - allow_multiple_connections
              - message_filters
              - hub_id
      security:
      - scaleway: []
    delete:
      tags:
      - IoT Devices
      operationId: DeleteDevice
      summary: Remove a device
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
  /iot/v1/regions/{region}/devices/{device_id}/certificate:
    get:
      tags:
      - IoT Devices
      operationId: GetDeviceCertificate
      summary: Get a device's certificate
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.GetDeviceCertificateResponse'
      security:
      - scaleway: []
    put:
      tags:
      - IoT Devices
      operationId: SetDeviceCertificate
      summary: Set a custom certificate on a device
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.SetDeviceCertificateResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                certificate_pem:
                  type: string
                  description: The PEM-encoded custom certificate
              required:
              - certificate_pem
              x-properties-order:
              - certificate_pem
      security:
      - scaleway: []
  /iot/v1/regions/{region}/devices/{device_id}/disable:
    post:
      tags:
      - IoT Devices
      operationId: DisableDevice
      summary: Disable a device
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Device'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
  /iot/v1/regions/{region}/devices/{device_id}/enable:
    post:
      tags:
      - IoT Devices
      operationId: EnableDevice
      summary: Enable a device
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Device'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
  /iot/v1/regions/{region}/devices/{device_id}/metrics:
    get:
      tags:
      - IoT Devices
      operationId: GetDeviceMetrics
      summary: Get a device's metrics
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      - in: query
        name: start_date
        description: Start date used to compute the best scale for the returned metrics
        required: true
        schema:
          type: string
          description: Start date used to compute the best scale for the returned
            metrics
          format: date-time
          default: hour
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.GetDeviceMetricsResponse'
      security:
      - scaleway: []
  /iot/v1/regions/{region}/devices/{device_id}/renew-certificate:
    post:
      tags:
      - IoT Devices
      operationId: RenewDeviceCertificate
      summary: Renew a device certificate
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: device_id
        description: Device ID
        required: true
        schema:
          type: string
          description: Device ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.RenewDeviceCertificateResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
  /iot/v1/regions/{region}/hubs:
    get:
      tags:
      - IoT Hubs
      operationId: ListHubs
      summary: List hubs
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: query
        name: page
        description: Page number
        schema:
          type: number
          description: Page number
          default: 1
      - in: query
        name: page_size
        description: Page size. The maximum value is 100
        schema:
          type: number
          description: Page size. The maximum value is 100
          default: 20
      - in: query
        name: order_by
        description: Ordering of requested hub
        schema:
          type: string
          description: Ordering of requested hub
          enum:
          - name_asc
          - name_desc
          - status_asc
          - status_desc
          - product_plan_asc
          - product_plan_desc
          - created_at_asc
          - created_at_desc
          - updated_at_asc
          - updated_at_desc
          default: name_asc
      - in: query
        name: project_id
        description: Filter on project
        schema:
          type: string
          description: Filter on project
          nullable: true
      - in: query
        name: organization_id
        description: Filter on the organization
        schema:
          type: string
          description: Filter on the organization
          nullable: true
      - in: query
        name: name
        description: Filter on the name
        schema:
          type: string
          description: Filter on the name
          nullable: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.ListHubsResponse'
      security:
      - scaleway: []
    post:
      tags:
      - IoT Hubs
      operationId: CreateHub
      summary: Create a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Hub'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Hub name (up to 255 characters)
                project_id:
                  type: string
                  description: Organization/project owning the resource
                product_plan:
                  type: string
                  description: Hub feature set
                  enum:
                  - plan_unknown
                  - plan_shared
                  - plan_dedicated
                  - plan_ha
                  default: plan_shared
                disable_events:
                  type: boolean
                  description: Disable Hub events
                  nullable: true
                events_topic_prefix:
                  type: string
                  description: Hub events topic prefix (default '$SCW/events')
                  nullable: true
              required:
              - name
              - project_id
              - product_plan
              x-properties-order:
              - name
              - project_id
              - product_plan
              - disable_events
              - events_topic_prefix
      security:
      - scaleway: []
  /iot/v1/regions/{region}/hubs/{hub_id}:
    get:
      tags:
      - IoT Hubs
      operationId: GetHub
      summary: Get a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        description: Hub ID
        required: true
        schema:
          type: string
          description: Hub ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Hub'
      security:
      - scaleway: []
    patch:
      tags:
      - IoT Hubs
      operationId: UpdateHub
      summary: Update a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        description: Hub ID
        required: true
        schema:
          type: string
          description: Hub ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Hub'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Hub name (up to 255 characters)
                  nullable: true
                product_plan:
                  type: string
                  description: Hub feature set
                  enum:
                  - plan_unknown
                  - plan_shared
                  - plan_dedicated
                  - plan_ha
                  default: plan_unknown
                disable_events:
                  type: boolean
                  description: Disable Hub events
                  nullable: true
                events_topic_prefix:
                  type: string
                  description: Hub events topic prefix
                  nullable: true
                enable_device_auto_provisioning:
                  type: boolean
                  description: Enable device auto provisioning
                  nullable: true
              x-properties-order:
              - name
              - product_plan
              - disable_events
              - events_topic_prefix
              - enable_device_auto_provisioning
      security:
      - scaleway: []
    delete:
      tags:
      - IoT Hubs
      operationId: DeleteHub
      summary: Delete a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        description: Hub ID
        required: true
        schema:
          type: string
          description: Hub ID
      - in: query
        name: delete_devices
        description: Force deletion of devices added to this hub instead of rejecting
          operation
        schema:
          type: boolean
          description: Force deletion of devices added to this hub instead of rejecting
            operation
          nullable: true
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
  /iot/v1/regions/{region}/hubs/{hub_id}/ca:
    get:
      tags:
      - IoT Hubs
      operationId: GetHubCA
      summary: Get the certificate authority of a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.GetHubCAResponse'
      security:
      - scaleway: []
    post:
      tags:
      - IoT Hubs
      operationId: SetHubCA
      summary: Set the certificate authority of a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        description: Hub ID
        required: true
        schema:
          type: string
          description: Hub ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Hub'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ca_cert_pem:
                  type: string
                  description: The CA's PEM-encoded certificate
                challenge_cert_pem:
                  type: string
                  description: The challenge is a PEM-encoded certificate to prove
                    the possession of the CA. It must be signed by the CA, and have
                    a Common Name equal to the Hub ID.
              required:
              - ca_cert_pem
              - challenge_cert_pem
              x-properties-order:
              - ca_cert_pem
              - challenge_cert_pem
      security:
      - scaleway: []
  /iot/v1/regions/{region}/hubs/{hub_id}/disable:
    post:
      tags:
      - IoT Hubs
      operationId: DisableHub
      summary: Disable a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        description: Hub ID
        required: true
        schema:
          type: string
          description: Hub ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Hub'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
  /iot/v1/regions/{region}/hubs/{hub_id}/enable:
    post:
      tags:
      - IoT Hubs
      operationId: EnableHub
      summary: Enable a hub
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        description: Hub ID
        required: true
        schema:
          type: string
          description: Hub ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Hub'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
  /iot/v1/regions/{region}/hubs/{hub_id}/metrics:
    get:
      tags:
      - IoT Hubs
      operationId: GetHubMetrics
      summary: Get a hub's metrics
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: hub_id
        description: Hub ID
        required: true
        schema:
          type: string
          description: Hub ID
      - in: query
        name: start_date
        description: Start date used to compute the best scale for the returned metrics
        required: true
        schema:
          type: string
          description: Start date used to compute the best scale for the returned
            metrics
          format: date-time
          default: hour
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.GetHubMetricsResponse'
      security:
      - scaleway: []
  /iot/v1/regions/{region}/networks:
    get:
      tags:
      - IoT Networks
      operationId: ListNetworks
      summary: List the Networks
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: query
        name: page
        description: Page number
        schema:
          type: number
          description: Page number
          default: 1
      - in: query
        name: page_size
        description: Page size. The maximum value is 100
        schema:
          type: number
          description: Page size. The maximum value is 100
          default: 20
      - in: query
        name: order_by
        description: Ordering of requested routes
        schema:
          type: string
          description: Ordering of requested routes
          enum:
          - name_asc
          - name_desc
          - type_asc
          - type_desc
          - created_at_asc
          - created_at_desc
          default: name_asc
      - in: query
        name: name
        description: Filter on Network name
        schema:
          type: string
          description: Filter on Network name
          nullable: true
      - in: query
        name: hub_id
        description: Filter on the hub
        schema:
          type: string
          description: Filter on the hub
          nullable: true
      - in: query
        name: topic_prefix
        description: Filter on the topic prefix
        schema:
          type: string
          description: Filter on the topic prefix
          nullable: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.ListNetworksResponse'
      security:
      - scaleway: []
    post:
      tags:
      - IoT Networks
      operationId: CreateNetwork
      summary: Create a new Network
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.CreateNetworkResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Network name
                type:
                  type: string
                  description: Type of network to connect with
                  enum:
                  - unknown
                  - sigfox
                  - rest
                  default: unknown
                hub_id:
                  type: string
                  description: Hub ID to connect the Network to
                topic_prefix:
                  type: string
                  description: Topic prefix for the Network
              required:
              - name
              - type
              - hub_id
              - topic_prefix
              x-properties-order:
              - name
              - type
              - hub_id
              - topic_prefix
      security:
      - scaleway: []
  /iot/v1/regions/{region}/networks/{network_id}:
    get:
      tags:
      - IoT Networks
      operationId: GetNetwork
      summary: Retrieve a specific Network
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: network_id
        description: Network ID
        required: true
        schema:
          type: string
          description: Network ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Network'
      security:
      - scaleway: []
    delete:
      tags:
      - IoT Networks
      operationId: DeleteNetwork
      summary: Delete a Network
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: network_id
        description: Network ID
        required: true
        schema:
          type: string
          description: Network ID
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
  /iot/v1/regions/{region}/routes:
    get:
      tags:
      - IoT Routes
      operationId: ListRoutes
      summary: List routes
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: query
        name: page
        description: Page number
        schema:
          type: number
          description: Page number
          default: 1
      - in: query
        name: page_size
        description: Page size. The maximum value is 100
        schema:
          type: number
          description: Page size. The maximum value is 100
          default: 20
      - in: query
        name: order_by
        description: Ordering of requested routes
        schema:
          type: string
          description: Ordering of requested routes
          enum:
          - name_asc
          - name_desc
          - hub_id_asc
          - hub_id_desc
          - type_asc
          - type_desc
          - created_at_asc
          - created_at_desc
          default: name_asc
      - in: query
        name: hub_id
        description: Filter on the hub
        schema:
          type: string
          description: Filter on the hub
          nullable: true
      - in: query
        name: name
        description: Filter on route's name
        schema:
          type: string
          description: Filter on route's name
          nullable: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.ListRoutesResponse'
      security:
      - scaleway: []
    post:
      tags:
      - IoT Routes
      operationId: CreateRoute
      summary: Create a route
      description: |
        Multiple route kinds can be created:
        - Database Route.
          Create a route that will record subscribed MQTT messages into your database.
          <b>You need to manage the database by yourself</b>.
        - REST Route.
          Create a route that will call a REST API on received subscribed MQTT messages.
        - S3 Routes.
          Create a route that will put subscribed MQTT messages into an S3 bucket.
          You need to create the bucket yourself and grant us write access.
          The grant can be done with s3cmd (`s3cmd setacl s3://<my-bucket> --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`).
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Route'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Route name
                hub_id:
                  type: string
                  description: ID of the route's hub
                topic:
                  type: string
                  description: Topic the route subscribes to. It must be a valid MQTT
                    topic and up to 65535 characters
                s3_config:
                  type: object
                  description: If creating S3 Route, S3-specific configuration fields
                  properties:
                    bucket_region:
                      type: string
                    bucket_name:
                      type: string
                    object_prefix:
                      type: string
                    strategy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Route.S3Config.S3Strategy'
                  x-properties-order:
                  - bucket_region
                  - bucket_name
                  - object_prefix
                  - strategy
                  x-one-of: Config
                db_config:
                  type: object
                  description: If creating Database Route, DB-specific configuration
                    fields
                  properties:
                    host:
                      type: string
                    port:
                      type: number
                    dbname:
                      type: string
                    username:
                      type: string
                    password:
                      type: string
                    query:
                      type: string
                    engine:
                      $ref: '#/components/schemas/scaleway.iot.v1.Route.DatabaseConfig.Engine'
                  x-properties-order:
                  - host
                  - port
                  - dbname
                  - username
                  - password
                  - query
                  - engine
                  x-one-of: Config
                rest_config:
                  type: object
                  description: If creating Rest Route, Rest-specific configuration
                    fields
                  properties:
                    verb:
                      $ref: '#/components/schemas/scaleway.iot.v1.Route.RestConfig.HttpVerb'
                    uri:
                      type: string
                    headers:
                      type: object
                      properties:
                        <headerKey>:
                          type: string
                      additionalProperties: true
                  x-properties-order:
                  - verb
                  - uri
                  - headers
                  x-one-of: Config
              x-properties-order:
              - name
              - hub_id
              - topic
              - s3_config
              - db_config
              - rest_config
      security:
      - scaleway: []
  /iot/v1/regions/{region}/routes/{route_id}:
    get:
      tags:
      - IoT Routes
      operationId: GetRoute
      summary: Get a route
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: route_id
        description: Route ID
        required: true
        schema:
          type: string
          description: Route ID
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Route'
      security:
      - scaleway: []
    patch:
      tags:
      - IoT Routes
      operationId: UpdateRoute
      summary: Update a route
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: route_id
        description: Route id
        required: true
        schema:
          type: string
          description: Route id
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.iot.v1.Route'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Route name
                  nullable: true
                topic:
                  type: string
                  description: Topic the route subscribes to. It must be a valid MQTT
                    topic and up to 65535 characters
                  nullable: true
                s3_config:
                  type: object
                  description: When updating S3 Route, S3-specific configuration fields
                  properties:
                    bucket_region:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    bucket_name:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    object_prefix:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    strategy:
                      $ref: '#/components/schemas/scaleway.iot.v1.Route.S3Config.S3Strategy'
                  x-properties-order:
                  - bucket_region
                  - bucket_name
                  - object_prefix
                  - strategy
                  x-one-of: Config
                db_config:
                  type: object
                  description: When updating Database Route, DB-specific configuration
                    fields
                  properties:
                    host:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    port:
                      $ref: '#/components/schemas/google.protobuf.UInt32Value'
                    dbname:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    username:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    password:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    query:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    engine:
                      $ref: '#/components/schemas/scaleway.iot.v1.Route.DatabaseConfig.Engine'
                  x-properties-order:
                  - host
                  - port
                  - dbname
                  - username
                  - password
                  - query
                  - engine
                  x-one-of: Config
                rest_config:
                  type: object
                  description: When updating Rest Route, Rest-specific configuration
                    fields
                  properties:
                    verb:
                      $ref: '#/components/schemas/scaleway.iot.v1.Route.RestConfig.HttpVerb'
                    uri:
                      $ref: '#/components/schemas/google.protobuf.StringValue'
                    headers:
                      $ref: '#/components/schemas/scaleway.std.MapStringStringValue'
                  x-properties-order:
                  - verb
                  - uri
                  - headers
                  x-one-of: Config
              x-properties-order:
              - name
              - topic
              - s3_config
              - db_config
              - rest_config
      security:
      - scaleway: []
    delete:
      tags:
      - IoT Routes
      operationId: DeleteRoute
      summary: Delete a route
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
      - in: path
        name: route_id
        description: Route ID
        required: true
        schema:
          type: string
          description: Route ID
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
benjaminch commented 3 years ago

Trying to use specs accessible online, there is still an issue:

spectral lint https://developers.scaleway.com/static/a1a1cf33a2ae2e5c96a1196728b25f5d/scaleway.iot.v1.Api.yml

https://developers.scaleway.com/static/a1a1cf33a2ae2e5c96a1196728b25f5d/scaleway.iot.v1.Api.yml
   2:6    warning  info-contact               Info object must have "contact" object.                        info
  1133:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices.get
 1224:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices.post
  1316:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}.get
 1347:11  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}.patch
 1442:12  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}.delete
  1470:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}/certificate.get
  1501:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}/certificate.put
 1547:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}/disable.post
 1585:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}/enable.post
  1623:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}/metrics.get
 1654:20    error  oas3-valid-schema-example  "default" property must match format "date-time"               paths./iot/v1/regions/{region}/devices/{device_id}/metrics.get.parameters[2].schema.default
 1665:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/devices/{device_id}/renew-certificate.post
  1703:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs.get
 1780:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs.post
  1855:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}.get
 1886:11  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}.patch
 1965:12  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}.delete
  2002:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}/ca.get
 2031:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}/ca.post
 2084:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}/disable.post
 2122:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}/enable.post
  2160:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/hubs/{hub_id}/metrics.get
 2191:20    error  oas3-valid-schema-example  "default" property must match format "date-time"               paths./iot/v1/regions/{region}/hubs/{hub_id}/metrics.get.parameters[2].schema.default
  2202:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/networks.get
 2275:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/networks.post
  2334:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/networks/{network_id}.get
 2365:12  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/networks/{network_id}.delete
  2393:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/routes.get
  2587:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/routes/{route_id}.get
 2618:11  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/routes/{route_id}.patch
 2733:12  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/routes/{route_id}.delete
  2761:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/twins/{twin_id}.get
 2792:12  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/twins/{twin_id}.delete
  2820:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/twins/{twin_id}/documents/{document_name}.get
  2858:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/twins/{twin_id}/documents/{document_name}.put
 2924:11  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/twins/{twin_id}/documents/{document_name}.patch
 2995:12  warning  operation-description      Operation "description" must be present and non-empty string.  paths./iot/v1/regions/{region}/twins/{twin_id}/documents/{document_name}.delete

✖ 38 problems (2 errors, 36 warnings, 0 infos, 0 hints)
remyleone commented 3 years ago

@benjaminch could you retry for the IoT product ? :)

benjaminch commented 3 years ago

@remyleone confirm it seems to work ! :)

i'll update it ASAP and let you know, thanks a lot