Class: ZeusSdk::V1::Auth

Inherits:
Object
  • Object
show all
Includes:
HTTParty, ServiceBase
Defined in:
lib/zeus_sdk/v1/auth.rb

Constant Summary collapse

SUBDOMAIN =
"auth"
LOCAL_PORT =
3003

Instance Attribute Summary

Attributes included from ServiceBase

#env, #environment_id, #project_id, #public_key, #scope, #secret_key, #zeus_auth_key

Instance Method Summary collapse

Methods included from ServiceBase

#create_project_environment, #destroy_project_environment, #get_headers, #get_project_environment, #get_project_environments, included, #initialize, #update_project_environment

Instance Method Details

#create_permission(permission) ⇒ Object



214
215
216
217
218
219
# File 'lib/zeus_sdk/v1/auth.rb', line 214

def create_permission(permission)
    body = {permission: permission}
    resp = self.class.post("/api/v1/permissions/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#create_role(attributes) ⇒ Object



146
147
148
149
150
151
# File 'lib/zeus_sdk/v1/auth.rb', line 146

def create_role(attributes)
    body = {role: attributes}
    resp = self.class.post("/api/v1/roles/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#create_role_user(attributes) ⇒ Object



180
181
182
183
184
185
# File 'lib/zeus_sdk/v1/auth.rb', line 180

def create_role_user(attributes)
    body = {role_user: attributes}
    resp = self.class.post("/api/v1/role_users/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#create_user(attributes) ⇒ Object



44
45
46
47
48
49
# File 'lib/zeus_sdk/v1/auth.rb', line 44

def create_user(attributes)
    body = {user: attributes}
    resp = self.class.post("/api/v1/users", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#create_waiting_list(waiting_list) ⇒ Object



78
79
80
81
82
83
# File 'lib/zeus_sdk/v1/auth.rb', line 78

def create_waiting_list(waiting_list)
    body = {waiting_list: waiting_list}
    resp = self.class.post("/api/v1/waiting_lists/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#create_waiting_list_email(waiting_list_email) ⇒ Object



112
113
114
115
116
117
# File 'lib/zeus_sdk/v1/auth.rb', line 112

def create_waiting_list_email(waiting_list_email)
    body = {waiting_list_email: waiting_list_email}
    resp = self.class.post("/api/v1/waiting_list_emails/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#destroy_permission(id) ⇒ Object



228
229
230
231
232
# File 'lib/zeus_sdk/v1/auth.rb', line 228

def destroy_permission(id)
    resp = self.class.delete("/api/v1/permissions/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#destroy_role(id) ⇒ Object



160
161
162
163
164
# File 'lib/zeus_sdk/v1/auth.rb', line 160

def destroy_role(id)
    resp = self.class.delete("/api/v1/roles/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#destroy_role_user(id) ⇒ Object



194
195
196
197
198
# File 'lib/zeus_sdk/v1/auth.rb', line 194

def destroy_role_user(id)
    resp = self.class.delete("/api/v1/role_users/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#destroy_user(id) ⇒ Object



58
59
60
61
62
# File 'lib/zeus_sdk/v1/auth.rb', line 58

def destroy_user(id)
    resp = self.class.delete("/api/v1/users/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#destroy_waiting_list(id) ⇒ Object



92
93
94
95
96
# File 'lib/zeus_sdk/v1/auth.rb', line 92

def destroy_waiting_list(id)
    resp = self.class.delete("/api/v1/waiting_lists/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#destroy_waiting_list_email(id) ⇒ Object



126
127
128
129
130
# File 'lib/zeus_sdk/v1/auth.rb', line 126

def destroy_waiting_list_email(id)
    resp = self.class.delete("/api/v1/waiting_list_emails/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#get_permission(id) ⇒ Object



208
209
210
211
212
# File 'lib/zeus_sdk/v1/auth.rb', line 208

def get_permission(id)
    resp = self.class.get("/api/v1/permissions/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#get_permissions(query) ⇒ Object



202
203
204
205
206
# File 'lib/zeus_sdk/v1/auth.rb', line 202

def get_permissions(query)
    resp = self.class.get("/api/v1/permissions", query: query, headers: self.get_headers).parsed_response

    return resp
end

#get_role(id) ⇒ Object



140
141
142
143
144
# File 'lib/zeus_sdk/v1/auth.rb', line 140

def get_role(id)
    resp = self.class.get("/api/v1/roles/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#get_role_user(id) ⇒ Object



174
175
176
177
178
# File 'lib/zeus_sdk/v1/auth.rb', line 174

def get_role_user(id)
    resp = self.class.get("/api/v1/role_users/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#get_role_users(query) ⇒ Object



168
169
170
171
172
# File 'lib/zeus_sdk/v1/auth.rb', line 168

def get_role_users(query)
    resp = self.class.get("/api/v1/role_users", query: query, headers: self.get_headers).parsed_response

    return resp
end

#get_roles(query) ⇒ Object



134
135
136
137
138
# File 'lib/zeus_sdk/v1/auth.rb', line 134

def get_roles(query)
    resp = self.class.get("/api/v1/roles", query: query, headers: self.get_headers).parsed_response

    return resp
end

#get_user(id) ⇒ Object



38
39
40
41
42
# File 'lib/zeus_sdk/v1/auth.rb', line 38

def get_user(id)
    resp = self.class.get("/api/v1/users/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#get_users(query) ⇒ Object



32
33
34
35
36
# File 'lib/zeus_sdk/v1/auth.rb', line 32

def get_users(query)
    resp = self.class.get("/api/v1/users", query: query, headers: self.get_headers).parsed_response

    return resp
end

#get_waiting_list(id) ⇒ Object



72
73
74
75
76
# File 'lib/zeus_sdk/v1/auth.rb', line 72

def get_waiting_list(id)
    resp = self.class.get("/api/v1/waiting_lists/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#get_waiting_list_email(id) ⇒ Object



106
107
108
109
110
# File 'lib/zeus_sdk/v1/auth.rb', line 106

def get_waiting_list_email(id)
    resp = self.class.get("/api/v1/waiting_list_emails/#{id}", headers: self.get_headers).parsed_response

    return resp
end

#get_waiting_list_emails(query) ⇒ Object



100
101
102
103
104
# File 'lib/zeus_sdk/v1/auth.rb', line 100

def get_waiting_list_emails(query)
    resp = self.class.get("/api/v1/waiting_list_emails", query: query, headers: self.get_headers).parsed_response

    return resp
end

#get_waiting_lists(query) ⇒ Object



66
67
68
69
70
# File 'lib/zeus_sdk/v1/auth.rb', line 66

def get_waiting_lists(query)
    resp = self.class.get("/api/v1/waiting_lists", query: query, headers: self.get_headers).parsed_response

    return resp
end

#list_users(query) ⇒ Object



12
13
14
15
16
# File 'lib/zeus_sdk/v1/auth.rb', line 12

def list_users(query)
    resp = self.class.get("/api/v1/users", query: query, headers: self.get_headers).parsed_response

    return resp
end

#login_with_email_password(session) ⇒ Object



18
19
20
21
22
23
# File 'lib/zeus_sdk/v1/auth.rb', line 18

def (session)
    body = {session: session}
    resp = self.class.post("/api/v1/sessions", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#signup_with_email_password(user) ⇒ Object



25
26
27
28
29
30
# File 'lib/zeus_sdk/v1/auth.rb', line 25

def (user)
    body = {user: user}
    resp = self.class.post("/api/v1/users", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#update_permission(id, attributes) ⇒ Object



221
222
223
224
225
226
# File 'lib/zeus_sdk/v1/auth.rb', line 221

def update_permission(id, attributes)
    body = {permission: attributes}
    resp = self.class.put("/api/v1/permissions/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#update_role(id, attributes) ⇒ Object



153
154
155
156
157
158
# File 'lib/zeus_sdk/v1/auth.rb', line 153

def update_role(id, attributes)
    body = {role: attributes}
    resp = self.class.put("/api/v1/roles/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#update_role_user(id, attributes) ⇒ Object



187
188
189
190
191
192
# File 'lib/zeus_sdk/v1/auth.rb', line 187

def update_role_user(id, attributes)
    body = {role_user: attributes}
    resp = self.class.put("/api/v1/role_users/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#update_user(id, attributes) ⇒ Object



51
52
53
54
55
56
# File 'lib/zeus_sdk/v1/auth.rb', line 51

def update_user(id, attributes)
    body = {user: attributes}
    resp = self.class.put("/api/v1/users/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
    
    return resp
end

#update_waiting_list(id, attributes) ⇒ Object



85
86
87
88
89
90
# File 'lib/zeus_sdk/v1/auth.rb', line 85

def update_waiting_list(id, attributes)
    body = {waiting_list: attributes}
    resp = self.class.put("/api/v1/waiting_lists/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end

#update_waiting_list_email(id, attributes) ⇒ Object



119
120
121
122
123
124
# File 'lib/zeus_sdk/v1/auth.rb', line 119

def update_waiting_list_email(id, attributes)
    body = {waiting_list_email: attributes}
    resp = self.class.put("/api/v1/waiting_list_emails/#{id}", body: body.to_json, headers: self.get_headers).parsed_response

    return resp
end