1
0
mirror of synced 2025-12-31 06:05:12 -05:00
Files
airbyte/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_option.py
Alexandre Girard 0a91a98370 Add descriptions and examples to component schema (#25117)
* Reference docs for backoff strategies

* Docs for most authentication mechansims

* Docs for CheckStream

* MinMaxDatetime

* DeclarativeStream

* DefaultErrorHandler

* CompositeErrorHandler

* update

* Update token expiry date description

* DPath extractor

* Add interpolation_context

* HttpResponseFilter

* RecordFilter

* RecordSelector

* DefaultPaginator

* CursorPagination

* OffsetIncrement

* Page Increment

* PrimaryKey

* HttpRequester

* request option and request path

* Schemas

* Spec

* Add field

* remove fields

* no auth and no pagination

* Delete deprecated comment

* Missing description

* Json Decoder

* OAuthConfigSpecification

* reorder

* add titles, examples, and descriptions for partition routers and datetime based cursor

* updates

* Update

* fix indentation

* Automated Commit - Formatting Changes

* Update as per feedback

* html tag

* generate models

* Update name

* do not use title as class name

* Update

* Add stream_interval and stream_partition to interpolation_context

* Automated Commit - Formatting Changes

* fix path

* format

---------

Co-authored-by: brianjlai <brian.lai@airbyte.io>
Co-authored-by: girarda <girarda@users.noreply.github.com>
2023-04-21 10:58:23 -07:00

34 lines
762 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from dataclasses import InitVar, dataclass
from enum import Enum
from typing import Any, Mapping
class RequestOptionType(Enum):
"""
Describes where to set a value on a request
"""
request_parameter = "request_parameter"
header = "header"
body_data = "body_data"
body_json = "body_json"
@dataclass
class RequestOption:
"""
Describes an option to set on a request
Attributes:
field_name (str): Describes the name of the parameter to inject
inject_into (RequestOptionType): Describes where in the HTTP request to inject the parameter
"""
field_name: str
inject_into: RequestOptionType
parameters: InitVar[Mapping[str, Any]]