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.

pydantic model enconnect.reddit.models.RedditListing[source]#

Bases: BaseModel

Contains information returned from the upstream response.

Show JSON schema
{
   "title": "RedditListing",
   "description": "Contains information returned from the upstream response.",
   "type": "object",
   "properties": {
      "name": {
         "description": "Value from the server response",
         "title": "Name",
         "type": "string"
      },
      "id": {
         "description": "Value from the server response",
         "title": "Id",
         "type": "string"
      },
      "created": {
         "description": "Value from the server response",
         "title": "Created",
         "type": "integer"
      },
      "title": {
         "description": "Value from the server response",
         "title": "Title",
         "type": "string"
      },
      "selftext": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value from the server response",
         "title": "Selftext"
      },
      "author": {
         "description": "Value from the server response",
         "title": "Author",
         "type": "string"
      },
      "url": {
         "description": "Value from the server response",
         "title": "Url",
         "type": "string"
      },
      "permalink": {
         "description": "Value from the server response",
         "title": "Permalink",
         "type": "string"
      },
      "thumbnail": {
         "description": "Value from the server response",
         "title": "Thumbnail",
         "type": "string"
      },
      "url_dest": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value from the server response",
         "title": "Url Dest"
      },
      "domain": {
         "description": "Value from the server response",
         "title": "Domain",
         "type": "string"
      },
      "medias": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value from the server response",
         "title": "Medias"
      },
      "pinned": {
         "description": "Value from the server response",
         "title": "Pinned",
         "type": "boolean"
      },
      "edited": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "number"
            }
         ],
         "description": "Value from the server response",
         "title": "Edited"
      },
      "stickied": {
         "description": "Value from the server response",
         "title": "Stickied",
         "type": "boolean"
      },
      "archived": {
         "description": "Value from the server response",
         "title": "Archived",
         "type": "boolean"
      },
      "vote_downs": {
         "description": "Value from the server response",
         "title": "Vote Downs",
         "type": "integer"
      },
      "vote_ups": {
         "description": "Value from the server response",
         "title": "Vote Ups",
         "type": "integer"
      },
      "score": {
         "description": "Value from the server response",
         "title": "Score",
         "type": "integer"
      }
   },
   "required": [
      "name",
      "id",
      "created",
      "title",
      "author",
      "url",
      "permalink",
      "thumbnail",
      "domain",
      "pinned",
      "edited",
      "stickied",
      "archived",
      "vote_downs",
      "vote_ups",
      "score"
   ]
}

Config:
  • extra: str = ignore

Fields:
field archived: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field created: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field domain: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field edited: Annotated[bool | float, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field medias: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')] = None#

Value from the server response

field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

Value from the server response

field pinned: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field score: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field selftext: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')] = None#

Value from the server response

field stickied: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field thumbnail: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field url: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field url_dest: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')] = None#

Value from the server response

field vote_downs: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field vote_ups: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

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.

pydantic model enconnect.reddit.params.RedditParams[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

Show JSON schema
{
   "title": "RedditParams",
   "description": "Process and validate the class configuration parameters.",
   "type": "object",
   "properties": {
      "timeout": {
         "default": 30,
         "description": "Timeout connecting to server",
         "maximum": 300,
         "minimum": 1,
         "title": "Timeout",
         "type": "integer"
      },
      "username": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Username",
         "type": "string"
      },
      "password": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Password",
         "type": "string"
      },
      "client": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Client",
         "type": "string"
      },
      "secret": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Secret",
         "type": "string"
      },
      "useragent": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Useragent",
         "type": "string"
      },
      "ssl_verify": {
         "default": true,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Verify",
         "type": "boolean"
      },
      "ssl_capem": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Capem"
      }
   },
   "additionalProperties": false,
   "required": [
      "username",
      "password",
      "client",
      "secret",
      "useragent"
   ]
}

Config:
  • extra: str = forbid

Fields:
field client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field secret: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])] = None#

Verify the ceritifcate valid

Constraints:
  • min_length = 1

field ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')] = True#

Verify the ceritifcate valid

field timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])] = 30#

Timeout connecting to server

Constraints:
  • ge = 1

  • le = 300

field useragent: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • 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.

pydantic model enconnect.reddit.RedditListing[source]#

Bases: BaseModel

Contains information returned from the upstream response.

Show JSON schema
{
   "title": "RedditListing",
   "description": "Contains information returned from the upstream response.",
   "type": "object",
   "properties": {
      "name": {
         "description": "Value from the server response",
         "title": "Name",
         "type": "string"
      },
      "id": {
         "description": "Value from the server response",
         "title": "Id",
         "type": "string"
      },
      "created": {
         "description": "Value from the server response",
         "title": "Created",
         "type": "integer"
      },
      "title": {
         "description": "Value from the server response",
         "title": "Title",
         "type": "string"
      },
      "selftext": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value from the server response",
         "title": "Selftext"
      },
      "author": {
         "description": "Value from the server response",
         "title": "Author",
         "type": "string"
      },
      "url": {
         "description": "Value from the server response",
         "title": "Url",
         "type": "string"
      },
      "permalink": {
         "description": "Value from the server response",
         "title": "Permalink",
         "type": "string"
      },
      "thumbnail": {
         "description": "Value from the server response",
         "title": "Thumbnail",
         "type": "string"
      },
      "url_dest": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value from the server response",
         "title": "Url Dest"
      },
      "domain": {
         "description": "Value from the server response",
         "title": "Domain",
         "type": "string"
      },
      "medias": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value from the server response",
         "title": "Medias"
      },
      "pinned": {
         "description": "Value from the server response",
         "title": "Pinned",
         "type": "boolean"
      },
      "edited": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "number"
            }
         ],
         "description": "Value from the server response",
         "title": "Edited"
      },
      "stickied": {
         "description": "Value from the server response",
         "title": "Stickied",
         "type": "boolean"
      },
      "archived": {
         "description": "Value from the server response",
         "title": "Archived",
         "type": "boolean"
      },
      "vote_downs": {
         "description": "Value from the server response",
         "title": "Vote Downs",
         "type": "integer"
      },
      "vote_ups": {
         "description": "Value from the server response",
         "title": "Vote Ups",
         "type": "integer"
      },
      "score": {
         "description": "Value from the server response",
         "title": "Score",
         "type": "integer"
      }
   },
   "required": [
      "name",
      "id",
      "created",
      "title",
      "author",
      "url",
      "permalink",
      "thumbnail",
      "domain",
      "pinned",
      "edited",
      "stickied",
      "archived",
      "vote_downs",
      "vote_ups",
      "score"
   ]
}

Config:
  • extra: str = ignore

Fields:
field archived: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field created: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field domain: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field edited: Annotated[bool | float, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field medias: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')] = None#

Value from the server response

field name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

Value from the server response

field pinned: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field score: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field selftext: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')] = None#

Value from the server response

field stickied: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field thumbnail: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field url: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field url_dest: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')] = None#

Value from the server response

field vote_downs: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

field vote_ups: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')] [Required]#

Value from the server response

pydantic model enconnect.reddit.RedditParams[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

Show JSON schema
{
   "title": "RedditParams",
   "description": "Process and validate the class configuration parameters.",
   "type": "object",
   "properties": {
      "timeout": {
         "default": 30,
         "description": "Timeout connecting to server",
         "maximum": 300,
         "minimum": 1,
         "title": "Timeout",
         "type": "integer"
      },
      "username": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Username",
         "type": "string"
      },
      "password": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Password",
         "type": "string"
      },
      "client": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Client",
         "type": "string"
      },
      "secret": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Secret",
         "type": "string"
      },
      "useragent": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Useragent",
         "type": "string"
      },
      "ssl_verify": {
         "default": true,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Verify",
         "type": "boolean"
      },
      "ssl_capem": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Capem"
      }
   },
   "additionalProperties": false,
   "required": [
      "username",
      "password",
      "client",
      "secret",
      "useragent"
   ]
}

Config:
  • extra: str = forbid

Fields:
field client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field secret: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])] = None#

Verify the ceritifcate valid

Constraints:
  • min_length = 1

field ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')] = True#

Verify the ceritifcate valid

field timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])] = 30#

Timeout connecting to server

Constraints:
  • ge = 1

  • le = 300

field useragent: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1