openapi: 3.1.0
info:
  title: irkumo API
  version: 1.0.0
paths:
  /healthz:
    get:
      summary: Healthz
      operationId: healthz_healthz_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
                title: Response Healthz Healthz Get
  /v1/meta:
    get:
      summary: Get Meta
      operationId: get_meta_v1_meta_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Get Meta V1 Meta Get
  /v1/fields:
    get:
      summary: Get Fields
      operationId: get_fields_v1_fields_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Get Fields V1 Fields Get
  /v1/companies/{code}:
    get:
      summary: Get Company
      operationId: get_company_v1_companies__code__get
      parameters:
      - name: code
        in: path
        required: true
        schema:
          type: string
          title: Code
      - name: fields
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Fields
      - name: dry_run
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Dry Run
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Get Company V1 Companies  Code  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/companies:
    get:
      summary: List Companies
      operationId: list_companies_v1_companies_get
      parameters:
      - name: fields
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Fields
      - name: industry
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          title: Industry
      - name: fiscal_month
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 12
            minimum: 1
          - type: 'null'
          title: Fiscal Month
      - name: prefecture
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Prefecture
      - name: city
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: City
      - name: has_ir
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Has Ir
      - name: has_tanshin
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Has Tanshin
      - name: ir_seed
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          title: Ir Seed
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 10
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: dry_run
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Dry Run
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response List Companies V1 Companies Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/search:
    get:
      summary: Search
      description: >-
        結果の件数によらず1回1クレジット (0件は0)｡
        fields= に指定できるのは属性列のみ (ir_url等の指定は422 unknown_field)｡
      operationId: search_v1_search_get
      parameters:
      - name: q
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 100
          title: Q
      - name: fields
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Fields
      - name: industry
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          title: Industry
      - name: fiscal_month
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 12
            minimum: 1
          - type: 'null'
          title: Fiscal Month
      - name: prefecture
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Prefecture
      - name: city
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: City
      - name: has_ir
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Has Ir
      - name: has_tanshin
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Has Tanshin
      - name: ir_seed
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          title: Ir Seed
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 20
          minimum: 1
          default: 3
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: dry_run
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Dry Run
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Search V1 Search Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/changes:
    get:
      summary: Get Changes
      operationId: get_changes_v1_changes_get
      parameters:
      - name: since
        in: query
        required: true
        schema:
          type: string
          title: Since
      - name: column
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Column
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 1000
          minimum: 1
          default: 100
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: dry_run
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Dry Run
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Get Changes V1 Changes Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/snapshot:
    get:
      summary: Get Snapshot
      operationId: get_snapshot_v1_snapshot_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Get Snapshot V1 Snapshot Get
  /v1/account:
    get:
      summary: Get Account
      operationId: get_account_v1_account_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Get Account V1 Account Get
    delete:
      summary: Delete Account
      description: >-
        退会｡ヘッダ X-Confirm: delete が無ければ400｡残っているクレジットは失効し戻らない｡
        購入の記録は法令に基づき7年間保存する｡
      operationId: delete_account_v1_account_delete
      parameters:
      - name: X-Confirm
        in: header
        required: true
        schema:
          type: string
          title: X-Confirm
          example: delete
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Delete Account V1 Account Delete
        '400':
          description: X-Confirm ヘッダが無いか値が不正
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Delete Account V1 Account Delete 400
  /v1/account/usage:
    get:
      summary: Get Account Usage
      operationId: get_account_usage_v1_account_usage_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Get Account Usage V1 Account Usage Get
  /v1/account/keys:
    post:
      summary: Create Key
      operationId: create_key_v1_account_keys_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KeyCreateReq'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Create Key V1 Account Keys Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/account/keys/{prefix}:
    delete:
      summary: Delete Key
      operationId: delete_key_v1_account_keys__prefix__delete
      parameters:
      - name: prefix
        in: path
        required: true
        schema:
          type: string
          title: Prefix
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Delete Key V1 Account Keys  Prefix  Delete
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KeyCreateReq:
      properties:
        name:
          type: string
          title: Name
          default: default
      type: object
      title: KeyCreateReq
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
