Package
- class fabman.package.Package(requester: Requester, attributes: dict)
Handles all interaction with Package objects on the Fabman API
Initialize the Object. Stores the requester method to interact with the API for further calls
- Parameters:
requester (
Requester) – TheRequesterobject to make requests withattributes (dict) – The attributes to initialize this object with
- create_credit(**kwargs) PackageCredit
Create a credit for this package. Takes no arguments.
- Calls:
“POST /packages/{id}/credits” <https://fabman.io/api/v1/documentation#/packages/postPackagesIdCredits>
- Returns:
Object with information and methods of the new credit
- Return type:
- create_permission(**kwargs) PackagePermission
Create a new permission for this package. Gives new abilities to package hodlers.
- Calls:
“POST /packages/{id}/permissions” <https://fabman.io/api/v1/documentation#/packages/postPackagesIdPermissions>
- Returns:
Object with information and methods of the new permission
- Return type:
- delete(**kwargs) Response
Deletes the package. Takes no arguments. WARNINGL: This is irreversible.
- Calls:
“DELETE /packages/{id}” <https://fabman.io/api/v1/documentation#/packages/deletePackagesId>
- Returns:
response information of call
- Return type:
requests.Response
- get_credit(credit_id, **kwargs) PackageCredit
Return a credit for this package given a credit_id.
- Calls:
“GET /packages/{id}/credits/{creditId}” <https://fabman.io/api/v1/documentation#/packages/getPackagesIdCreditsCreditid>
- Parameters:
credit_id (int) – ID of the credit to retrieve
- Returns:
Object with information and methods of the credit
- Return type:
- get_credits(**kwargs) PaginatedList
Return a PaginatedList of credits for this package
Calls: “GET /packages/{id}/credits” Documentation: https://fabman.io/api/v1/documentation#/packages/getPackagesIdCredits
- Returns:
List of credits for this package
- Return type:
- get_permission(permission_id, **kwargs) PackagePermission
Return a permission for this package given a permission_id.
- Calls:
“GET /packages/{id}/permissions/{permissionId}” <https://fabman.io/api/v1/documentation#/packages/getPackagesIdPermissionsPermissionid>
- Returns:
Object with information and methods of the permission
- Return type:
- get_permissions(**kwargs) PaginatedList
Return a PaginatedList of permissions for the package.
- Calls:
“GET /packages/{id}/permissions” <https://fabman.io/api/v1/documentation#/packages/getPackagesIdPermissions>
- Returns:
List of permissions for the package
- Return type:
- update(**kwargs) None
Update information on the package. Note that many fields may be unalterable by the API key holder.
- Calls:
“PUT /packages/{id}” <https://fabman.io/api/v1/documentation#/packages/putPackagesId>
- Returns:
None – attributes are updated in place
- Return type:
None
PackageCredit
- class fabman.package.PackageCredit(requester: Requester, attributes: dict)
Simple Class to handle PackageCredits
Initialize the Object. Stores the requester method to interact with the API for further calls
- Parameters:
requester (
Requester) – TheRequesterobject to make requests withattributes (dict) – The attributes to initialize this object with
- delete(**kwargs) Response
Deletes a credit from a package. WARNING: This is irreversible.
- Calls:
“DELETE /packages/{packageId}/credits/{creditId}” <https://fabman.io/api/v1/documentation#/packages/deletePackagesIdCreditsCreditid>
- Returns:
response information of call
- Return type:
requests.Response
- update(**kwargs) None
Updates the credit. Attributes are updated in place with new information.
- Calls:
“PUT /packages/{packageId}/credits/{creditId}” <https://fabman.io/api/v1/documentation#/packages/putPackagesIdCreditsCreditid>
- Returns:
None – attributes are updated in place
- Return type:
None
PackagePermission
- class fabman.package.PackagePermission(requester: Requester, attributes: dict)
Simple Class to handle PackagePermissions
Initialize the Object. Stores the requester method to interact with the API for further calls
- Parameters:
requester (
Requester) – TheRequesterobject to make requests withattributes (dict) – The attributes to initialize this object with
- delete(**kwargs) Response
Deletes a permission from a package. WARNING: This is irreversible.
- Calls:
“DELETE /packages/{packageId}/permissions/{permissionId}” <https://fabman.io/api/v1/documentation#/packages/deletePackagesIdPermissionsPermissionid>
- Returns:
response information of call
- Return type:
requests.Response
- update(**kwargs) None
Updates the permission. Attributes are updated in place with new information.
- Calls:
“PUT /packages/{packageId}/permissions/{permissionId}” <https://fabman.io/api/v1/documentation#/packages/putPackagesIdPermissionsPermissionid>
- Returns:
None – attributes are updated in place
- Return type:
None