# access-server-connector
Mentortools service for Access Packages with lazy access resolution

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.1.0
- Package version: 1.0.0+2647093479
- Generator version: 7.23.0
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen

## Requirements.

Python 3.7+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import access_server_connector
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import access_server_connector
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import time
import access_server_connector
from access_server_connector.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = access_server_connector.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: Bearer Authorization
configuration = access_server_connector.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Configure API key authorization: ServerName Authorization
configuration.api_key['ServerName Authorization'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ServerName Authorization'] = 'Bearer'


# Enter a context with an instance of the API client
async with access_server_connector.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = access_server_connector.AccessApi(api_client)
    check_in = access_server_connector.CheckIn() # CheckIn | 
    origin = 'origin_example' # str |  (optional)
    referer = 'referer_example' # str |  (optional)
    portal_id = 56 # int |  (optional)

    try:
        # Check a single resource
        api_response = await api_instance.check_v1_access_check_post(check_in, origin=origin, referer=referer, portal_id=portal_id)
        print("The response of AccessApi->check_v1_access_check_post:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccessApi->check_v1_access_check_post: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AccessApi* | [**check_v1_access_check_post**](docs/AccessApi.md#check_v1_access_check_post) | **POST** /v1/access/check | Check a single resource
*AccessApi* | [**courses_summary_v1_access_members_member_id_courses_get**](docs/AccessApi.md#courses_summary_v1_access_members_member_id_courses_get) | **GET** /v1/access/members/{member_id}/courses | List a member&#39;s course access summary
*AccessApi* | [**resolve_v1_access_resolve_post**](docs/AccessApi.md#resolve_v1_access_resolve_post) | **POST** /v1/access/resolve | Resolve a resource tree
*AccessApi* | [**tree_v1_access_members_member_id_courses_course_id_tree_post**](docs/AccessApi.md#tree_v1_access_members_member_id_courses_course_id_tree_post) | **POST** /v1/access/members/{member_id}/courses/{course_id}/tree | Resolve a course access tree
*AdminApi* | [**consume_v1_admin_consume_post**](docs/AdminApi.md#consume_v1_admin_consume_post) | **POST** /v1/admin/consume | Apply an access.order-events payload
*AdminApi* | [**health_health_get**](docs/AdminApi.md#health_health_get) | **GET** /health | Health check
*IndividualApi* | [**batch_overrides_v1_individual_overrides_post**](docs/IndividualApi.md#batch_overrides_v1_individual_overrides_post) | **POST** /v1/individual/overrides | Batch-write per-member access overrides
*IndividualApi* | [**member_overrides_v1_individual_members_member_id_overrides_get**](docs/IndividualApi.md#member_overrides_v1_individual_members_member_id_overrides_get) | **GET** /v1/individual/members/{member_id}/overrides | List a member&#39;s effective overrides (latest-wins)
*OwnershipApi* | [**deactivate_v1_ownership_reasons_reason_id_deactivate_post**](docs/OwnershipApi.md#deactivate_v1_ownership_reasons_reason_id_deactivate_post) | **POST** /v1/ownership/reasons/{reason_id}/deactivate | Deactivate (revoke) an ownership reason
*OwnershipApi* | [**grant_v1_ownership_grant_post**](docs/OwnershipApi.md#grant_v1_ownership_grant_post) | **POST** /v1/ownership/grant | Manually grant an access package
*OwnershipApi* | [**member_packages_count_v1_ownership_members_member_id_packages_count_get**](docs/OwnershipApi.md#member_packages_count_v1_ownership_members_member_id_packages_count_get) | **GET** /v1/ownership/members/{member_id}/packages/count | Count the access packages a member owns
*OwnershipApi* | [**member_packages_v1_ownership_members_member_id_packages_get**](docs/OwnershipApi.md#member_packages_v1_ownership_members_member_id_packages_get) | **GET** /v1/ownership/members/{member_id}/packages | List the access packages a member owns (paginated)
*OwnershipApi* | [**ownership_list_v1_ownership_members_member_id_reasons_get**](docs/OwnershipApi.md#ownership_list_v1_ownership_members_member_id_reasons_get) | **GET** /v1/ownership/members/{member_id}/reasons | List a member&#39;s ownership reasons
*PackagesApi* | [**count_members_v1_packages_access_package_id_members_count_get**](docs/PackagesApi.md#count_members_v1_packages_access_package_id_members_count_get) | **GET** /v1/packages/{access_package_id}/members/count | Count members who have access to this package
*PackagesApi* | [**count_packages_v1_packages_count_get**](docs/PackagesApi.md#count_packages_v1_packages_count_get) | **GET** /v1/packages/count | Count a portal&#39;s access packages
*PackagesApi* | [**create_package_v1_packages_post**](docs/PackagesApi.md#create_package_v1_packages_post) | **POST** /v1/packages | Create an access package
*PackagesApi* | [**delete_package_v1_packages_access_package_id_delete**](docs/PackagesApi.md#delete_package_v1_packages_access_package_id_delete) | **DELETE** /v1/packages/{access_package_id} | Delete an access package
*PackagesApi* | [**delete_rule_v1_packages_access_package_id_rules_rule_id_delete**](docs/PackagesApi.md#delete_rule_v1_packages_access_package_id_rules_rule_id_delete) | **DELETE** /v1/packages/{access_package_id}/rules/{rule_id} | Remove an access rule from a package
*PackagesApi* | [**get_package_by_slug_v1_packages_by_slug_slug_get**](docs/PackagesApi.md#get_package_by_slug_v1_packages_by_slug_slug_get) | **GET** /v1/packages/by-slug/{slug} | Get public package data by its direct-link slug (unauthenticated)
*PackagesApi* | [**get_package_v1_packages_access_package_id_get**](docs/PackagesApi.md#get_package_v1_packages_access_package_id_get) | **GET** /v1/packages/{access_package_id} | Get a single access package (with its rules)
*PackagesApi* | [**get_rules_v1_packages_access_package_id_rules_get**](docs/PackagesApi.md#get_rules_v1_packages_access_package_id_rules_get) | **GET** /v1/packages/{access_package_id}/rules | List a package&#39;s access rules
*PackagesApi* | [**link_product_v1_packages_access_package_id_products_put**](docs/PackagesApi.md#link_product_v1_packages_access_package_id_products_put) | **PUT** /v1/packages/{access_package_id}/products | Link a marketplace product to a package
*PackagesApi* | [**list_members_v1_packages_access_package_id_members_get**](docs/PackagesApi.md#list_members_v1_packages_access_package_id_members_get) | **GET** /v1/packages/{access_package_id}/members | List members who have access to this package (paginated)
*PackagesApi* | [**list_packages_v1_packages_get**](docs/PackagesApi.md#list_packages_v1_packages_get) | **GET** /v1/packages | List a portal&#39;s access packages (paginated)
*PackagesApi* | [**list_product_links_v1_packages_access_package_id_products_get**](docs/PackagesApi.md#list_product_links_v1_packages_access_package_id_products_get) | **GET** /v1/packages/{access_package_id}/products | List the marketplace products linked to a package
*PackagesApi* | [**patch_package_v1_packages_access_package_id_patch**](docs/PackagesApi.md#patch_package_v1_packages_access_package_id_patch) | **PATCH** /v1/packages/{access_package_id} | Toggle is_active / is_locked
*PackagesApi* | [**set_rule_v1_packages_access_package_id_rules_put**](docs/PackagesApi.md#set_rule_v1_packages_access_package_id_rules_put) | **PUT** /v1/packages/{access_package_id}/rules | Set an access rule on a package
*PackagesApi* | [**unlink_product_v1_packages_access_package_id_products_link_id_delete**](docs/PackagesApi.md#unlink_product_v1_packages_access_package_id_products_link_id_delete) | **DELETE** /v1/packages/{access_package_id}/products/{link_id} | Unlink a marketplace product from a package


## Documentation For Models

 - [AccessMode](docs/AccessMode.md)
 - [AccessOrderEvent](docs/AccessOrderEvent.md)
 - [AccessResultOut](docs/AccessResultOut.md)
 - [Binding](docs/Binding.md)
 - [CheckIn](docs/CheckIn.md)
 - [ConsumeOut](docs/ConsumeOut.md)
 - [CourseStructure](docs/CourseStructure.md)
 - [CourseSummaryOut](docs/CourseSummaryOut.md)
 - [CourseTreeOut](docs/CourseTreeOut.md)
 - [DeactivateIn](docs/DeactivateIn.md)
 - [EventOrder](docs/EventOrder.md)
 - [EventProduct](docs/EventProduct.md)
 - [EventSubscription](docs/EventSubscription.md)
 - [ExpiryType](docs/ExpiryType.md)
 - [GrantIn](docs/GrantIn.md)
 - [HTTPValidationError](docs/HTTPValidationError.md)
 - [HealthOut](docs/HealthOut.md)
 - [IdOut](docs/IdOut.md)
 - [LessonStructure](docs/LessonStructure.md)
 - [LocationInner](docs/LocationInner.md)
 - [LockReason](docs/LockReason.md)
 - [MemberOwnershipOut](docs/MemberOwnershipOut.md)
 - [ModuleStructure](docs/ModuleStructure.md)
 - [ModuleTreeOut](docs/ModuleTreeOut.md)
 - [NodeAccessOut](docs/NodeAccessOut.md)
 - [OverrideBatchIn](docs/OverrideBatchIn.md)
 - [OverrideItem](docs/OverrideItem.md)
 - [OverrideOut](docs/OverrideOut.md)
 - [OwnedPackageOut](docs/OwnedPackageOut.md)
 - [OwnershipReasonOut](docs/OwnershipReasonOut.md)
 - [PackageDetailOut](docs/PackageDetailOut.md)
 - [PackageIn](docs/PackageIn.md)
 - [PackageOut](docs/PackageOut.md)
 - [PackagePatchIn](docs/PackagePatchIn.md)
 - [PackageRuleIn](docs/PackageRuleIn.md)
 - [ProductLinkIn](docs/ProductLinkIn.md)
 - [ProductLinkOut](docs/ProductLinkOut.md)
 - [PublicPackageOut](docs/PublicPackageOut.md)
 - [ReasonKind](docs/ReasonKind.md)
 - [ReasonStatus](docs/ReasonStatus.md)
 - [ResolveIn](docs/ResolveIn.md)
 - [ResolveOut](docs/ResolveOut.md)
 - [ResourceNodeIn](docs/ResourceNodeIn.md)
 - [ResourceType](docs/ResourceType.md)
 - [RuleBody](docs/RuleBody.md)
 - [RuleBodyOut](docs/RuleBodyOut.md)
 - [RuleOut](docs/RuleOut.md)
 - [State](docs/State.md)
 - [TreeIn](docs/TreeIn.md)
 - [UnlockSpec](docs/UnlockSpec.md)
 - [UnlockType](docs/UnlockType.md)
 - [ValidationError](docs/ValidationError.md)
 - [WinningLayer](docs/WinningLayer.md)
 - [WrappedResponseAccessResultOut](docs/WrappedResponseAccessResultOut.md)
 - [WrappedResponseConsumeOut](docs/WrappedResponseConsumeOut.md)
 - [WrappedResponseCourseTreeOut](docs/WrappedResponseCourseTreeOut.md)
 - [WrappedResponseHealthOut](docs/WrappedResponseHealthOut.md)
 - [WrappedResponseIdOut](docs/WrappedResponseIdOut.md)
 - [WrappedResponseInt](docs/WrappedResponseInt.md)
 - [WrappedResponseListCourseSummaryOut](docs/WrappedResponseListCourseSummaryOut.md)
 - [WrappedResponseListMemberOwnershipOut](docs/WrappedResponseListMemberOwnershipOut.md)
 - [WrappedResponseListOverrideOut](docs/WrappedResponseListOverrideOut.md)
 - [WrappedResponseListOwnedPackageOut](docs/WrappedResponseListOwnedPackageOut.md)
 - [WrappedResponseListOwnershipReasonOut](docs/WrappedResponseListOwnershipReasonOut.md)
 - [WrappedResponseListPackageOut](docs/WrappedResponseListPackageOut.md)
 - [WrappedResponseListProductLinkOut](docs/WrappedResponseListProductLinkOut.md)
 - [WrappedResponseListRuleOut](docs/WrappedResponseListRuleOut.md)
 - [WrappedResponsePackageDetailOut](docs/WrappedResponsePackageDetailOut.md)
 - [WrappedResponsePublicPackageOut](docs/WrappedResponsePublicPackageOut.md)
 - [WrappedResponseResolveOut](docs/WrappedResponseResolveOut.md)
 - [WrappedResponseWrittenOut](docs/WrappedResponseWrittenOut.md)
 - [WrittenOut](docs/WrittenOut.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="ServerName Authorization"></a>
### ServerName Authorization

- **Type**: API key
- **API key parameter name**: server_name
- **Location**: HTTP header

<a id="Bearer Authorization"></a>
### Bearer Authorization

- **Type**: Bearer authentication


## Author




