openapi: 3.0.1
info:
  title: Mock Oauth Access Token
  description: Common mock used to simulate Oauth connection
  contact:
    name: API team
    email: difapiteam@michelin.com
  version: '1.0'
servers:
  - url: https://indus.api.michelin.com/mock-common-oauth-salesforce
    description: Server url
security: []
tags:
  - name: POST
    description: API Operation to generate token
paths:
  /services/oauth2/clientcreds/token:
    post:
      operationId: createAccessToken
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                  enum: [client_credentials]
                  example: client_credentials
                client_secret:
                  type: string
                  example: THISISAFAKESECRET
                client_id:
                  type: string
                  example: FAKECLINETID

      responses:
        '200':
          description: Successful response with access token
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    example: 0000000000000
                  signature:
                    type: string
                    example: 000000000000=
                  scope:
                    type: string
                    example: openid id
                  instance_url:
                    type: string
                    example: "0"
                  id:
                    type: string
                    example: https://test.xyz.com/id/00D1j000000GC1WEAW/0051i000003OCFxAAO
                  token_type:
                    type: string
                    example: Bearer
                  issued_at:
                    type: string
                    example: ""
        '400':
          description: Invalid request
        '401':
          description: Unauthorized - Invalid credentials
        '500':
          description: Server error
  

components:
  schemas:
    AccessTokenResponse:
      type: object
      required:
        - issued_at
        - status
        - refresh_count
        - refresh_token_expires_in
        - expires_in
        - client_id
        - access_token
      properties:
        issued_at:
          type: integer
          format: int32
        status:
          type: string
        refresh_count:
          type: integer
          format: int32
        refresh_token_expires_in:
          type: integer
          format: int32
        expires_in:
          type: integer
          format: int32
        client_id:
          type: string
        access_token:
          type: string
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string


        appointmentDateTime:
          type: string
          description: New appointment date and time
