Documentation
¶
Index ¶
- Constants
- type Akerun
- type AkerunGroup
- type AkerunGroupCreateParameter
- type AkerunGroupDetailed
- type AkerunGroupList
- type AkerunGroupUpdateParameter
- type AkerunList
- type AkerunListParameter
- type Client
- func (c *Client) AddAkerunToGroup(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) error
- func (c *Client) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
- func (c *Client) CreateAkerunGroup(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*AkerunGroup, error)
- func (c *Client) CreateKey(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*Key, error)
- func (c *Client) DeleteAkerunGroup(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) error
- func (c *Client) DeleteKey(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) error
- func (c *Client) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (c *Client) ExitUser(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) error
- func (c *Client) GetAkerunGroup(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*AkerunGroupDetailed, error)
- func (c *Client) GetAkerunGroups(ctx context.Context, oauth2Token *oauth2.Token, organizationId string) (*AkerunGroupList, error)
- func (c *Client) GetAkeruns(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*AkerunList, error)
- func (c *Client) GetKey(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*Key, error)
- func (c *Client) GetKeys(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*KeysList, error)
- func (c *Client) GetOrganization(ctx context.Context, oauth2Token *oauth2.Token, id string) (*Organization, error)
- func (c *Client) GetOrganizations(ctx context.Context, oauth2Token *oauth2.Token, params OrganizationsParameter) (*OrganizationList, error)
- func (c *Client) GetTokenInfo(ctx context.Context, token *oauth2.Token) (*TokenInfo, error)
- func (c *Client) GetUser(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*User, error)
- func (c *Client) GetUsers(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*UsersList, error)
- func (c *Client) InviteUser(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*User, error)
- func (c *Client) RefreshToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
- func (c *Client) RegisterUser(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*User, error)
- func (c *Client) RemoveAkerunFromGroup(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) error
- func (c *Client) Revoke(ctx context.Context, token *oauth2.Token) error
- func (c *Client) UpdateAkerunGroup(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*AkerunGroup, error)
- func (c *Client) UpdateKey(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*Key, error)
- func (c *Client) UpdateUser(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, ...) (*User, error)
- type Config
- type CreateKeyParameter
- type Error
- type InviteUserParameter
- type Key
- type KeyParameter
- type KeysList
- type KeysParameter
- type NFC
- type Organization
- type OrganizationList
- type OrganizationsParameter
- type RegisterUserParameter
- type TokenInfo
- type UpdateKeyParameter
- type UpdateUserParameter
- type User
- type UsersList
- type UsersParameter
Constants ¶
const ( APIUrl = "https://api.akerun.com" APIVerison = "/v3" Oauth2AuthURL = "https://api.akerun.com/oauth/authorize" Oauth2TokenURL = "https://api.akerun.com/oauth/token" )
Akerun API URLs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Akerun ¶
type Akerun struct { ID string `json:"id"` Name string `json:"name"` ImageURL string `json:"image_url"` OpenDoorAlert bool `json:"open_door_alert"` OpenDoorAlertSecond int `json:"open_door_alert_second"` PushButton bool `json:"push_button"` NormalSoundVolume int `json:"normal_sound_volume"` AlertSoundVolume int `json:"alert_sound_volume"` BatteryPercentage int `json:"battery_percentage"` Autolock bool `json:"autolock"` AutolockOffSchedule struct { StartTime string `json:"start_time"` EndTime string `json:"end_time"` DaysOfWeek []int `json:"days_of_week"` } `json:"autolock_off_schedule"` AkerunRemote struct { ID string `json:"id"` } `json:"akerun_remote"` NFCReaderInside struct { ID string `json:"id"` BatteryPercentage int `json:"battery_percentage"` } `json:"nfc_reader_inside"` NFCReaderOutside struct { ID string `json:"id"` BatteryPercentage int `json:"battery_percentage"` } `json:"nfc_reader_outside"` DoorSensor struct { ID string `json:"id"` BatteryPercentage int `json:"battery_percentage"` } `json:"door_sensor"` }
type AkerunGroup ¶
type AkerunGroupDetailed ¶
type AkerunGroupList ¶
type AkerunGroupList struct {
AkerunGroups []AkerunGroup `json:"akerun_groups"`
}
type AkerunList ¶
type AkerunList struct {
Akeruns []Akerun `json:"akeruns"`
}
type AkerunListParameter ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the Akerun client.
func (*Client) AddAkerunToGroup ¶
func (*Client) AuthCodeURL ¶
func (c *Client) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
AuthCodeURL returns a URL to OAuth 2.0 provider's consent page that asks for permissions for the required scopes explicitly.
func (*Client) CreateAkerunGroup ¶
func (c *Client) CreateAkerunGroup( ctx context.Context, oauth2Token *oauth2.Token, organizationId string, params AkerunGroupCreateParameter, ) (*AkerunGroup, error)
func (*Client) DeleteAkerunGroup ¶
func (*Client) Exchange ¶
func (c *Client) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
Exchange converts an authorization code into a token.
func (*Client) GetAkerunGroup ¶
func (*Client) GetAkerunGroups ¶
func (*Client) GetAkeruns ¶
func (c *Client) GetAkeruns(ctx context.Context, oauth2Token *oauth2.Token, organizationId string, params AkerunListParameter) (*AkerunList, error)
func (*Client) GetOrganization ¶
func (c *Client) GetOrganization(ctx context.Context, oauth2Token *oauth2.Token, id string) (*Organization, error)
GetOrganization retrieves the details of an organization with the specified ID.
func (*Client) GetOrganizations ¶
func (c *Client) GetOrganizations( ctx context.Context, oauth2Token *oauth2.Token, params OrganizationsParameter) (*OrganizationList, error)
GetOrganizations returns a list of organizations.
func (*Client) GetTokenInfo ¶
GetTokenInfo retrieves the token information for the given OAuth2 token.
func (*Client) InviteUser ¶
func (*Client) RefreshToken ¶
RefreshToken returns a new token that carries the same authorization as token, but with a renewed access token.
func (*Client) RegisterUser ¶
func (*Client) RemoveAkerunFromGroup ¶
func (*Client) UpdateAkerunGroup ¶
func (c *Client) UpdateAkerunGroup( ctx context.Context, oauth2Token *oauth2.Token, organizationId string, akerunGroupId string, params AkerunGroupUpdateParameter, ) (*AkerunGroup, error)
type CreateKeyParameter ¶
type CreateKeyParameter struct { ScheduleType string `url:"schedule_type,omitempty"` TemporarySchedule struct { StartDateTime string `url:"start_datetime,omitempty"` EndDateTime string `url:"end_datetime,omitempty"` } `url:"temporary_schedule,omitempty"` RecurringSchedule struct { DaysOfWeek []uint32 `url:"days_of_week,omitempty"` StartTime string `url:"start_time,omitempty"` EndTime string `url:"end_time,omitempty"` } `url:"recurring_schedule,omitempty"` EnableKeyUrl bool `url:"enable_key_url,omitempty"` KeyUrlPassword string `url:"key_url_password,omitempty"` Role string `url:"role,omitempty"` }
type InviteUserParameter ¶
type Key ¶
type Key struct { ID string `json:"id"` Role string `json:"role"` ScheduleType string `json:"schedule_type"` TemporarySchedule struct { StartDateTime string `json:"start_datetime"` EndDateTime string `json:"end_datetime"` } `json:"temporary_schedule"` RecurringSchedule struct { DaysOfWeek []uint32 `json:"days_of_week"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` } `json:"recurring_schedule"` Keys struct { KeyUrl string `json:"key_url"` PasswordProtected bool `json:"password_protected"` } `json:"keys"` Akerun struct { ID string `json:"id"` Name string `json:"name"` } `json:"akerun"` User struct { ID string `json:"id"` Name string `json:"name"` } }
type KeyParameter ¶
type KeyParameter struct {
KeyId string `url:"key_id,omitempty"`
}
type KeysParameter ¶
type Organization ¶
Organization represents the detailed information of an organization.
type OrganizationList ¶
type OrganizationList struct {
Organizations []id `json:"organizations"`
}
OrganizationList represents a list of organizations in Akerun API.
type OrganizationsParameter ¶
type OrganizationsParameter struct { Limit uint32 `url:"limit,omitempty"` IdAfter string `url:"id_after,omitempty"` IdBefore string `url:"id_before,omitempty"` }
OrganizationsParameter represents the parameters for GetOrganizations method.
type RegisterUserParameter ¶
type TokenInfo ¶
type TokenInfo struct { ApplicationName string `json:"application_name"` AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` CreatedAt string `json:"created_at"` ExpiresAt string `json:"expires_at"` }
TokenInfo represents the structure of the token information.
type UpdateKeyParameter ¶
type UpdateKeyParameter struct { TemporarySchedule struct { StartDateTime string `url:"start_datetime,omitempty"` EndDateTime string `url:"end_datetime,omitempty"` } `url:"temporary_schedule,omitempty"` RecurringSchedule struct { DaysOfWeek []uint32 `url:"days_of_week,omitempty"` StartTime string `url:"start_time,omitempty"` EndTime string `url:"end_time,omitempty"` } `url:"recurring_schedule,omitempty"` EnableKeyUrl bool `url:"enable_key_url,omitempty"` KeyUrlPassword string `url:"key_url_password,omitempty"` Role string `url:"role,omitempty"` }
type UpdateUserParameter ¶
type User ¶
type User struct { ID string `json:"id"` Name string `json:"name"` Mail string `json:"mail"` ImageUrl string `json:"image_url"` Authority string `json:"authority"` Code string `json:"code"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Nfcs []NFC `json:"nfcs"` }