enconnect.reddit package#

Subpackages#

Submodules#

enconnect.reddit.models module#

Functions and routines associated with Enasis Network Remote Connect.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enconnect.reddit.models.RedditListing(*, name: str, id: str, created: int, title: str, selftext: str | None = None, author: str, url: str, permalink: str, thumbnail: str, url_dest: str | None = None, domain: str, medias: list[str] | None = None, pinned: bool, edited: bool | float, stickied: bool, archived: bool, vote_downs: int, vote_ups: int, score: int)[source]#

Bases: BaseModel

Contains information returned from the upstream response.

archived: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
created: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
domain: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
edited: Annotated[bool | float, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
medias: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
model_config = {'extra': 'ignore'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
pinned: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
score: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
selftext: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
stickied: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
thumbnail: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url_dest: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
vote_downs: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
vote_ups: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#

enconnect.reddit.params module#

Functions and routines associated with Enasis Network Remote Connect.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enconnect.reddit.params.RedditParams(*, timeout: Annotated[int, Ge(ge=1), Le(le=300)] = 30, username: Annotated[str, MinLen(min_length=1)], password: Annotated[str, MinLen(min_length=1)], client: Annotated[str, MinLen(min_length=1)], secret: Annotated[str, MinLen(min_length=1)], useragent: Annotated[str, MinLen(min_length=1)], ssl_verify: bool = True, ssl_capem: Annotated[str | None, MinLen(min_length=1)] = None)[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
secret: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
useragent: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#

enconnect.reddit.reddit module#

Functions and routines associated with Enasis Network Remote Connect.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enconnect.reddit.reddit.Reddit(params: RedditParams)[source]#

Bases: object

Interact with the cloud service API with various methods.

Parameters:

params – Parameters used to instantiate the class.

property client: HTTPClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

latest(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

async latest_async(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

latest_block(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

listing(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

async listing_async(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

listing_block(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

property params: RedditParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

async request_async(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

request_block(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

async request_token_async() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

request_token_block() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

property token: str | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

Module contents#

Functions and routines associated with Enasis Network Remote Connect.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enconnect.reddit.Reddit(params: RedditParams)[source]#

Bases: object

Interact with the cloud service API with various methods.

Parameters:

params – Parameters used to instantiate the class.

property client: HTTPClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

latest(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

async latest_async(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

latest_block(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#

Return the new items within the provided subreddit path.

Parameters:
  • subred – Path to subreddit containing the content.

  • params – Optional parameters included in request.

Returns:

New items within the provided subreddit path.

listing(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

async listing_async(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

listing_block(unique: str) RedditListing[source]#

Return the specific content within the social platform.

Parameters:

unique – Unique identifier within social platform.

Returns:

Specific content within the social platform.

property params: RedditParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

async request_async(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

request_block(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#

Return the response for upstream request to the server.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • data – Optional dict payload included in request.

  • httpauth – Optional information for authentication.

Returns:

Response from upstream request to the server.

async request_token_async() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

request_token_block() str[source]#

Establish new session obtaining token for authorization.

Returns:

Access token used with authenticated requests.

property token: str | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

class enconnect.reddit.RedditListing(*, name: str, id: str, created: int, title: str, selftext: str | None = None, author: str, url: str, permalink: str, thumbnail: str, url_dest: str | None = None, domain: str, medias: list[str] | None = None, pinned: bool, edited: bool | float, stickied: bool, archived: bool, vote_downs: int, vote_ups: int, score: int)[source]#

Bases: BaseModel

Contains information returned from the upstream response.

archived: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
created: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
domain: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
edited: Annotated[bool | float, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
medias: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
model_config = {'extra': 'ignore'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
pinned: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
score: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
selftext: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
stickied: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
thumbnail: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
url_dest: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
vote_downs: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
vote_ups: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
class enconnect.reddit.RedditParams(*, timeout: Annotated[int, Ge(ge=1), Le(le=300)] = 30, username: Annotated[str, MinLen(min_length=1)], password: Annotated[str, MinLen(min_length=1)], client: Annotated[str, MinLen(min_length=1)], secret: Annotated[str, MinLen(min_length=1)], useragent: Annotated[str, MinLen(min_length=1)], ssl_verify: bool = True, ssl_capem: Annotated[str | None, MinLen(min_length=1)] = None)[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
secret: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
useragent: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#