Subscriber¶
-
class
smartcloudadmin.models.subscriber.
Subscriber
(environment: str, *, customer_id: int = 0, org_name: str = '', owner: str = 0, modified: datetime.datetime = '01/01/1970 00:00:00', is_guest: bool = False, created: datetime.datetime = '01/01/1970 00:00:00', subscriber_state: str = '', party_role_type=None, deleted: datetime.datetime = '01/01/1970 00:00:00', role_set=None, id: int = 0, email: str = '', given_name: str = '', family_name: str = '', name_prefix: str = '', name_suffix: str = '', security_realm: smartcloudadmin.enums.State = '', employee_number: str = '')¶ Bases:
object
Represents an Subscriber used within IBM Social Cloud. Contains details about the physical location of the Organization headquarters.
- environment : str
- Environment/Datacenter the Organization resides on.
- email : str
- Subscriber’s email address.
- given_name : str
- First name of subscriber.
- family_name : str
- Surname of subscriber.
- id : int
- Subscriber id
- org_name : str
- Name of Organization to which subscriber belongs to.
- owner : int
- Owner id of Organization.
- created : Datetime
- Time of subscriber creation.
- modified : enumerate
- Time of subscriber was last modified.
- is_guest : bool
- Whether the subscriber is a guest of the Organization or not.
- state : str
- Current user activity state.
- party_role_type : str
- State where Organization resides.
- deleted : bool
- Is the subscriber deleted.
- customer_id : str
- Organization id
- role_set : str
- List of permissions the user has. E.G. User, Application Developer, Administrator.
- name_prefix : str
- Honorary Subscriber prefix. I.E. Dr.
- name_suffix : str
- Name Suffic, I.E. Jr.
- security_realm : enumerate
- Subscriber’s federation type.
- employee_number : str
- Organization’s number for subscriber
- seat_set : [Seat]
- List of Seat objects which subscriber occupies.
- entitlements : [int]
- List of subscription id’s to which subscriber has a seat.
-
activate
() → None¶ Activates the user on smartcloud. :return: None
-
assign_role
(valid_role) → None¶ Assigns a role to a subscriber. :param valid_role:
-
change_password
(current_password, password) → None¶ Changes the subscriber’s password. Need to know current password in order to change. Could be used in conjunction with set_one_time_password to initially set and then change a password. :param current_password: Subscriber’s current password :param password: New password for the subscriber.
-
classmethod
create
(environment, organization_id, org_name, *, email_address, given_name, family_name, **kwargs) → smartcloudadmin.models.subscriber.Subscriber¶ Creates a subscriber object.
See also Organzation.add_subscriber() Required ——– :param environment: Datacenter to create the Organization on. :param organization_id: ID of subscribers organiation :param org_name: Name of subscribers organisation. :param email_address: Subscriber’s Email address Optional ——– :param given_name: Subscriber’s first name, default : “” :param family_name: Subscriber’s surname,default : “” :param role_set: Role Subscriber should be granted on creation, defaults to User. :param name_prefix: default : “” :param name_suffix: default : “” :param employee_number: default : “” :param language_preference: Defaults to English :param work_phone: default : “” :param mobile_phone: default : “” :param home_phone: default : “” :param fax: default : “” :param job_title: default : “” :param website_address: default : “” :param time_zone: Defaults to GMT :param photo: default : “”
Returns: Subscriber
-
delete
(*, soft_delete=True) → None¶ Delete subscriber. :param soft_delete: Should the subscriber be soft deleted or hard deleted. By default the user is soft deleted. :type bool:
-
entitle
(subscription_id) → None¶ Entitles a subscriber with a subscription from the organization. :param subscription_id: subscription id to entitle user with.
-
classmethod
from_json
(environment, json_body) → smartcloudadmin.models.subscriber.Subscriber¶
-
classmethod
get
(environment, *, subscriber_id=None, email_address=None) → smartcloudadmin.models.subscriber.Subscriber¶
-
get_role_list
()¶
-
get_roles
() → [<class 'str'>]¶ The Roles currently held by subscriber. :return: he current roles groups a subscriber is a member of.
-
name
¶ Returns: Subscriber’s full formal name.
-
reset_password
() → None¶
-
restore
() → None¶ Restore a user from a soft deleted state.
-
revoke
(subscription_id) → None¶ Revokes a subcribers enttilement to a subscription. :param subscription_id:w
-
set_one_time_password
(password) → None¶ Sets a one time password for the subscriber which they will then be prompted to change on login. :param password:
-
set_password
(password) → None¶ Sets subscribers password. :param password: Password to set.
-
show_as_row
() → str¶ Returns: Basic details relevent about a user.
-
show_as_summary
() → str¶
-
suspend
() → None¶ Suspends a subscriber.
-
unassign_role
(valid_role) → None¶ Removes a role from a subscriber. :param valid_role:
-
unsuspend
() → None¶ Unsuspends a subscriber.