pluralkit-api 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +136 -0
  4. data/Rakefile +10 -0
  5. data/docs/AccountsApi.md +72 -0
  6. data/docs/FullSwitch.md +20 -0
  7. data/docs/Member.md +58 -0
  8. data/docs/MembersApi.md +353 -0
  9. data/docs/Message.md +30 -0
  10. data/docs/PrivacySetting.md +15 -0
  11. data/docs/ProxyTag.md +20 -0
  12. data/docs/ProxyingApi.md +70 -0
  13. data/docs/Switch.md +20 -0
  14. data/docs/SwitchesApi.md +208 -0
  15. data/docs/System.md +40 -0
  16. data/docs/SystemsApi.md +475 -0
  17. data/git_push.sh +58 -0
  18. data/lib/pluralkit-api.rb +51 -0
  19. data/lib/pluralkit-api/api/accounts_api.rb +98 -0
  20. data/lib/pluralkit-api/api/members_api.rb +389 -0
  21. data/lib/pluralkit-api/api/proxying_api.rb +96 -0
  22. data/lib/pluralkit-api/api/switches_api.rb +236 -0
  23. data/lib/pluralkit-api/api/systems_api.rb +525 -0
  24. data/lib/pluralkit-api/api_client.rb +390 -0
  25. data/lib/pluralkit-api/api_error.rb +57 -0
  26. data/lib/pluralkit-api/configuration.rb +277 -0
  27. data/lib/pluralkit-api/models/full_switch.rb +231 -0
  28. data/lib/pluralkit-api/models/member.rb +568 -0
  29. data/lib/pluralkit-api/models/message.rb +274 -0
  30. data/lib/pluralkit-api/models/privacy_setting.rb +37 -0
  31. data/lib/pluralkit-api/models/proxy_tag.rb +262 -0
  32. data/lib/pluralkit-api/models/switch.rb +231 -0
  33. data/lib/pluralkit-api/models/system.rb +417 -0
  34. data/lib/pluralkit-api/version.rb +15 -0
  35. data/pluralkit-api.gemspec +38 -0
  36. data/spec/api/accounts_api_spec.rb +47 -0
  37. data/spec/api/members_api_spec.rb +92 -0
  38. data/spec/api/proxying_api_spec.rb +46 -0
  39. data/spec/api/switches_api_spec.rb +70 -0
  40. data/spec/api/systems_api_spec.rb +118 -0
  41. data/spec/api_client_spec.rb +226 -0
  42. data/spec/configuration_spec.rb +42 -0
  43. data/spec/models/full_switch_spec.rb +40 -0
  44. data/spec/models/member_spec.rb +154 -0
  45. data/spec/models/message_spec.rb +70 -0
  46. data/spec/models/privacy_setting_spec.rb +28 -0
  47. data/spec/models/proxy_tag_spec.rb +40 -0
  48. data/spec/models/switch_spec.rb +40 -0
  49. data/spec/models/system_spec.rb +94 -0
  50. data/spec/spec_helper.rb +111 -0
  51. metadata +147 -0
data/docs/Message.md ADDED
@@ -0,0 +1,30 @@
1
+ # PluralKitAPI::Message
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **timestamp** | **Time** | The time the message was proxied. | [optional][readonly] |
8
+ | **id** | **String** | | [optional] |
9
+ | **original** | **String** | | [optional] |
10
+ | **sender** | **String** | | [optional] |
11
+ | **channel** | **String** | | [optional] |
12
+ | **system** | [**System**](System.md) | | [optional] |
13
+ | **member** | [**Member**](Member.md) | | [optional] |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'pluralkit-api'
19
+
20
+ instance = PluralKitAPI::Message.new(
21
+ timestamp: null,
22
+ id: null,
23
+ original: null,
24
+ sender: null,
25
+ channel: null,
26
+ system: null,
27
+ member: null
28
+ )
29
+ ```
30
+
@@ -0,0 +1,15 @@
1
+ # PluralKitAPI::PrivacySetting
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'pluralkit-api'
12
+
13
+ instance = PluralKitAPI::PrivacySetting.new()
14
+ ```
15
+
data/docs/ProxyTag.md ADDED
@@ -0,0 +1,20 @@
1
+ # PluralKitAPI::ProxyTag
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **prefix** | **String** | The proxy tag prefix. This is the string that goes *before* the inner text. An empty prefix is represented as `null` and an empty string will be converted as such. | [optional] |
8
+ | **suffix** | **String** | The proxy tag suffix. This is the string that goes *after* the inner text. An empty suffix is represented as `null` and an empty string will be converted as such. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'pluralkit-api'
14
+
15
+ instance = PluralKitAPI::ProxyTag.new(
16
+ prefix: {{,
17
+ suffix: }}
18
+ )
19
+ ```
20
+
@@ -0,0 +1,70 @@
1
+ # PluralKitAPI::ProxyingApi
2
+
3
+ All URIs are relative to *https://api.pluralkit.me/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**msg_id_get**](ProxyingApi.md#msg_id_get) | **GET** /msg/{id} | Gets information about a proxied message by its message ID. |
8
+
9
+
10
+ ## msg_id_get
11
+
12
+ > <Message> msg_id_get(id)
13
+
14
+ Gets information about a proxied message by its message ID.
15
+
16
+ ### Examples
17
+
18
+ ```ruby
19
+ require 'time'
20
+ require 'pluralkit-api'
21
+
22
+ api_instance = PluralKitAPI::ProxyingApi.new
23
+ id = 'id_example' # String | A Discord message ID. This may refer to either the original \"trigger message\" posted by the user, or to the resulting webhook message posted by PluralKit. The former may be useful for eg. logging bot integration.
24
+
25
+ begin
26
+ # Gets information about a proxied message by its message ID.
27
+ result = api_instance.msg_id_get(id)
28
+ p result
29
+ rescue PluralKitAPI::ApiError => e
30
+ puts "Error when calling ProxyingApi->msg_id_get: #{e}"
31
+ end
32
+ ```
33
+
34
+ #### Using the msg_id_get_with_http_info variant
35
+
36
+ This returns an Array which contains the response data, status code and headers.
37
+
38
+ > <Array(<Message>, Integer, Hash)> msg_id_get_with_http_info(id)
39
+
40
+ ```ruby
41
+ begin
42
+ # Gets information about a proxied message by its message ID.
43
+ data, status_code, headers = api_instance.msg_id_get_with_http_info(id)
44
+ p status_code # => 2xx
45
+ p headers # => { ... }
46
+ p data # => <Message>
47
+ rescue PluralKitAPI::ApiError => e
48
+ puts "Error when calling ProxyingApi->msg_id_get_with_http_info: #{e}"
49
+ end
50
+ ```
51
+
52
+ ### Parameters
53
+
54
+ | Name | Type | Description | Notes |
55
+ | ---- | ---- | ----------- | ----- |
56
+ | **id** | **String** | A Discord message ID. This may refer to either the original \&quot;trigger message\&quot; posted by the user, or to the resulting webhook message posted by PluralKit. The former may be useful for eg. logging bot integration. | |
57
+
58
+ ### Return type
59
+
60
+ [**Message**](Message.md)
61
+
62
+ ### Authorization
63
+
64
+ No authorization required
65
+
66
+ ### HTTP request headers
67
+
68
+ - **Content-Type**: Not defined
69
+ - **Accept**: application/json
70
+
data/docs/Switch.md ADDED
@@ -0,0 +1,20 @@
1
+ # PluralKitAPI::Switch
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **timestamp** | **Time** | The timestamp the switch was logged. | [optional][readonly] |
8
+ | **members** | **Array&lt;String&gt;** | A list of the IDs of the members in this switch. The order is significant. It is valid for the switch to have no members at all. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'pluralkit-api'
14
+
15
+ instance = PluralKitAPI::Switch.new(
16
+ timestamp: null,
17
+ members: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,208 @@
1
+ # PluralKitAPI::SwitchesApi
2
+
3
+ All URIs are relative to *https://api.pluralkit.me/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_system_fronters**](SwitchesApi.md#get_system_fronters) | **GET** /s/{id}/fronters | Gets a system&#39;s current fronters. |
8
+ | [**get_system_switches**](SwitchesApi.md#get_system_switches) | **GET** /s/{id}/switches | Gets a system&#39;s switch history. |
9
+ | [**register_switch**](SwitchesApi.md#register_switch) | **POST** /s/switches | Registers a new switch. |
10
+
11
+
12
+ ## get_system_fronters
13
+
14
+ > <FullSwitch> get_system_fronters(id)
15
+
16
+ Gets a system's current fronters.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'pluralkit-api'
23
+
24
+ api_instance = PluralKitAPI::SwitchesApi.new
25
+ id = 'id_example' # String | The ID of the system in question.
26
+
27
+ begin
28
+ # Gets a system's current fronters.
29
+ result = api_instance.get_system_fronters(id)
30
+ p result
31
+ rescue PluralKitAPI::ApiError => e
32
+ puts "Error when calling SwitchesApi->get_system_fronters: #{e}"
33
+ end
34
+ ```
35
+
36
+ #### Using the get_system_fronters_with_http_info variant
37
+
38
+ This returns an Array which contains the response data, status code and headers.
39
+
40
+ > <Array(<FullSwitch>, Integer, Hash)> get_system_fronters_with_http_info(id)
41
+
42
+ ```ruby
43
+ begin
44
+ # Gets a system's current fronters.
45
+ data, status_code, headers = api_instance.get_system_fronters_with_http_info(id)
46
+ p status_code # => 2xx
47
+ p headers # => { ... }
48
+ p data # => <FullSwitch>
49
+ rescue PluralKitAPI::ApiError => e
50
+ puts "Error when calling SwitchesApi->get_system_fronters_with_http_info: #{e}"
51
+ end
52
+ ```
53
+
54
+ ### Parameters
55
+
56
+ | Name | Type | Description | Notes |
57
+ | ---- | ---- | ----------- | ----- |
58
+ | **id** | **String** | The ID of the system in question. | |
59
+
60
+ ### Return type
61
+
62
+ [**FullSwitch**](FullSwitch.md)
63
+
64
+ ### Authorization
65
+
66
+ No authorization required
67
+
68
+ ### HTTP request headers
69
+
70
+ - **Content-Type**: Not defined
71
+ - **Accept**: application/json
72
+
73
+
74
+ ## get_system_switches
75
+
76
+ > <Array<Switch>> get_system_switches(id, opts)
77
+
78
+ Gets a system's switch history.
79
+
80
+ Will return the system's switch history, up to 100 entries at a time, in reverse-chronological (latest first) order. For pagination, see the `before` query parameter.
81
+
82
+ ### Examples
83
+
84
+ ```ruby
85
+ require 'time'
86
+ require 'pluralkit-api'
87
+
88
+ api_instance = PluralKitAPI::SwitchesApi.new
89
+ id = 'id_example' # String | The ID of the system in question.
90
+ opts = {
91
+ before: Time.parse('2013-10-20T19:20:30+01:00') # Time | If provided, will only return switches that happened *before* (and not including) this timestamp. This can be used for pagination by calling the endpoint again with the timestamp of the last switch of the previous response.
92
+ }
93
+
94
+ begin
95
+ # Gets a system's switch history.
96
+ result = api_instance.get_system_switches(id, opts)
97
+ p result
98
+ rescue PluralKitAPI::ApiError => e
99
+ puts "Error when calling SwitchesApi->get_system_switches: #{e}"
100
+ end
101
+ ```
102
+
103
+ #### Using the get_system_switches_with_http_info variant
104
+
105
+ This returns an Array which contains the response data, status code and headers.
106
+
107
+ > <Array(<Array<Switch>>, Integer, Hash)> get_system_switches_with_http_info(id, opts)
108
+
109
+ ```ruby
110
+ begin
111
+ # Gets a system's switch history.
112
+ data, status_code, headers = api_instance.get_system_switches_with_http_info(id, opts)
113
+ p status_code # => 2xx
114
+ p headers # => { ... }
115
+ p data # => <Array<Switch>>
116
+ rescue PluralKitAPI::ApiError => e
117
+ puts "Error when calling SwitchesApi->get_system_switches_with_http_info: #{e}"
118
+ end
119
+ ```
120
+
121
+ ### Parameters
122
+
123
+ | Name | Type | Description | Notes |
124
+ | ---- | ---- | ----------- | ----- |
125
+ | **id** | **String** | The ID of the system in question. | |
126
+ | **before** | **Time** | If provided, will only return switches that happened *before* (and not including) this timestamp. This can be used for pagination by calling the endpoint again with the timestamp of the last switch of the previous response. | [optional] |
127
+
128
+ ### Return type
129
+
130
+ [**Array&lt;Switch&gt;**](Switch.md)
131
+
132
+ ### Authorization
133
+
134
+ No authorization required
135
+
136
+ ### HTTP request headers
137
+
138
+ - **Content-Type**: Not defined
139
+ - **Accept**: application/json
140
+
141
+
142
+ ## register_switch
143
+
144
+ > register_switch(switch)
145
+
146
+ Registers a new switch.
147
+
148
+ ### Examples
149
+
150
+ ```ruby
151
+ require 'time'
152
+ require 'pluralkit-api'
153
+ # setup authorization
154
+ PluralKitAPI.configure do |config|
155
+ # Configure API key authorization: TokenAuth
156
+ config.api_key['TokenAuth'] = 'YOUR API KEY'
157
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
158
+ # config.api_key_prefix['TokenAuth'] = 'Bearer'
159
+ end
160
+
161
+ api_instance = PluralKitAPI::SwitchesApi.new
162
+ switch = PluralKitAPI::Switch.new # Switch |
163
+
164
+ begin
165
+ # Registers a new switch.
166
+ api_instance.register_switch(switch)
167
+ rescue PluralKitAPI::ApiError => e
168
+ puts "Error when calling SwitchesApi->register_switch: #{e}"
169
+ end
170
+ ```
171
+
172
+ #### Using the register_switch_with_http_info variant
173
+
174
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
175
+
176
+ > <Array(nil, Integer, Hash)> register_switch_with_http_info(switch)
177
+
178
+ ```ruby
179
+ begin
180
+ # Registers a new switch.
181
+ data, status_code, headers = api_instance.register_switch_with_http_info(switch)
182
+ p status_code # => 2xx
183
+ p headers # => { ... }
184
+ p data # => nil
185
+ rescue PluralKitAPI::ApiError => e
186
+ puts "Error when calling SwitchesApi->register_switch_with_http_info: #{e}"
187
+ end
188
+ ```
189
+
190
+ ### Parameters
191
+
192
+ | Name | Type | Description | Notes |
193
+ | ---- | ---- | ----------- | ----- |
194
+ | **switch** | [**Switch**](Switch.md) | | |
195
+
196
+ ### Return type
197
+
198
+ nil (empty response body)
199
+
200
+ ### Authorization
201
+
202
+ [TokenAuth](../README.md#TokenAuth)
203
+
204
+ ### HTTP request headers
205
+
206
+ - **Content-Type**: application/json
207
+ - **Accept**: Not defined
208
+
data/docs/System.md ADDED
@@ -0,0 +1,40 @@
1
+ # PluralKitAPI::System
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | A unique identifier for a system or a member, as a randomly generated string of five lowercase letters. These IDs are guaranteed to be globally unique for the given model type (a system can have the same ID as a member, but two systems or two members can never share an ID). The IDs can on rare occasions change - eg. if a profane word is generated and later regenerated, or as a potential future Patreon perk. However, it&#39;s still reasonable to assume that the IDs are constant, and that tey won&#39;t change without the user&#39;s knowledge, so it&#39;s safe to store in things like settings menus and config files. | [optional][readonly] |
8
+ | **name** | **String** | The user-provided name of the system. | [optional] |
9
+ | **description** | **String** | The user-provided system description. May contain rich text in Markdown, including standard Markdown-formatted links, or Discord-formatted emoji/user/channel references. | [optional] |
10
+ | **tag** | **String** | The system tag, which is appended to the names (or display names, if set) of members when proxying through the bot. A space will automatically be inserted between the name and the tag, so no need to include one at the start. The character limit here is 78, as Discord&#39;s name length limit for webhooks is 80 characters. A 78-character system tag is thus the longest tag that can still accomodate a single-letter member name and the separating space. | [optional] |
11
+ | **avatar_url** | **String** | A link to the avatar/icon of the system. If used for proxying, the image must be at most 1000 pixels in width *and* height, and at most 1 MiB in size. This restriction is on Discord&#39;s end and is not verified through the API (it&#39;s simply stored as a string). | [optional] |
12
+ | **tz** | **String** | The system&#39;s registered time zone as an Olson time zone ID. This is used in the bot to convert various time stamps in commands on behalf of this system. | [optional][default to &#39;UTC&#39;] |
13
+ | **created** | **Time** | The creation timestamp of the system. | [optional][readonly] |
14
+ | **description_privacy** | [**PrivacySetting**](PrivacySetting.md) | | [optional] |
15
+ | **member_list_privacy** | [**PrivacySetting**](PrivacySetting.md) | | [optional] |
16
+ | **front_privacy** | [**PrivacySetting**](PrivacySetting.md) | | [optional] |
17
+ | **front_history_privacy** | [**PrivacySetting**](PrivacySetting.md) | | [optional] |
18
+
19
+ ## Example
20
+
21
+ ```ruby
22
+ require 'pluralkit-api'
23
+
24
+ instance = PluralKitAPI::System.new(
25
+ id: abcde,
26
+ name: Boxes of Foxes,
27
+ description: This system is very cool.
28
+
29
+ It has cool people.,
30
+ tag: | BoF,
31
+ avatar_url: https://i.imgur.com/Abcdefg.png,
32
+ tz: America/New_York,
33
+ created: null,
34
+ description_privacy: null,
35
+ member_list_privacy: null,
36
+ front_privacy: null,
37
+ front_history_privacy: null
38
+ )
39
+ ```
40
+
@@ -0,0 +1,475 @@
1
+ # PluralKitAPI::SystemsApi
2
+
3
+ All URIs are relative to *https://api.pluralkit.me/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**a_id_get**](SystemsApi.md#a_id_get) | **GET** /a/{id} | Gets a system by (one of) its associated Discord accounts. |
8
+ | [**get_own_system**](SystemsApi.md#get_own_system) | **GET** /s | Returns your own system. |
9
+ | [**get_system**](SystemsApi.md#get_system) | **GET** /s/{id} | Gets a system by its ID. |
10
+ | [**get_system_fronters**](SystemsApi.md#get_system_fronters) | **GET** /s/{id}/fronters | Gets a system&#39;s current fronters. |
11
+ | [**get_system_members**](SystemsApi.md#get_system_members) | **GET** /s/{id}/members | Gets a system&#39;s members. |
12
+ | [**get_system_switches**](SystemsApi.md#get_system_switches) | **GET** /s/{id}/switches | Gets a system&#39;s switch history. |
13
+ | [**update_system**](SystemsApi.md#update_system) | **PATCH** /s | Updates an existing system. |
14
+
15
+
16
+ ## a_id_get
17
+
18
+ > <System> a_id_get(id)
19
+
20
+ Gets a system by (one of) its associated Discord accounts.
21
+
22
+ Note that it's currently not possible to get a system's registered accounts given a system ID through the API. Consider this endpoint \"one-way\".
23
+
24
+ ### Examples
25
+
26
+ ```ruby
27
+ require 'time'
28
+ require 'pluralkit-api'
29
+
30
+ api_instance = PluralKitAPI::SystemsApi.new
31
+ id = 'id_example' # String | A Discord user ID.
32
+
33
+ begin
34
+ # Gets a system by (one of) its associated Discord accounts.
35
+ result = api_instance.a_id_get(id)
36
+ p result
37
+ rescue PluralKitAPI::ApiError => e
38
+ puts "Error when calling SystemsApi->a_id_get: #{e}"
39
+ end
40
+ ```
41
+
42
+ #### Using the a_id_get_with_http_info variant
43
+
44
+ This returns an Array which contains the response data, status code and headers.
45
+
46
+ > <Array(<System>, Integer, Hash)> a_id_get_with_http_info(id)
47
+
48
+ ```ruby
49
+ begin
50
+ # Gets a system by (one of) its associated Discord accounts.
51
+ data, status_code, headers = api_instance.a_id_get_with_http_info(id)
52
+ p status_code # => 2xx
53
+ p headers # => { ... }
54
+ p data # => <System>
55
+ rescue PluralKitAPI::ApiError => e
56
+ puts "Error when calling SystemsApi->a_id_get_with_http_info: #{e}"
57
+ end
58
+ ```
59
+
60
+ ### Parameters
61
+
62
+ | Name | Type | Description | Notes |
63
+ | ---- | ---- | ----------- | ----- |
64
+ | **id** | **String** | A Discord user ID. | |
65
+
66
+ ### Return type
67
+
68
+ [**System**](System.md)
69
+
70
+ ### Authorization
71
+
72
+ No authorization required
73
+
74
+ ### HTTP request headers
75
+
76
+ - **Content-Type**: Not defined
77
+ - **Accept**: application/json
78
+
79
+
80
+ ## get_own_system
81
+
82
+ > <System> get_own_system
83
+
84
+ Returns your own system.
85
+
86
+ Requires authentication, and will returns the system the token belongs to.
87
+
88
+ ### Examples
89
+
90
+ ```ruby
91
+ require 'time'
92
+ require 'pluralkit-api'
93
+ # setup authorization
94
+ PluralKitAPI.configure do |config|
95
+ # Configure API key authorization: TokenAuth
96
+ config.api_key['TokenAuth'] = 'YOUR API KEY'
97
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
98
+ # config.api_key_prefix['TokenAuth'] = 'Bearer'
99
+ end
100
+
101
+ api_instance = PluralKitAPI::SystemsApi.new
102
+
103
+ begin
104
+ # Returns your own system.
105
+ result = api_instance.get_own_system
106
+ p result
107
+ rescue PluralKitAPI::ApiError => e
108
+ puts "Error when calling SystemsApi->get_own_system: #{e}"
109
+ end
110
+ ```
111
+
112
+ #### Using the get_own_system_with_http_info variant
113
+
114
+ This returns an Array which contains the response data, status code and headers.
115
+
116
+ > <Array(<System>, Integer, Hash)> get_own_system_with_http_info
117
+
118
+ ```ruby
119
+ begin
120
+ # Returns your own system.
121
+ data, status_code, headers = api_instance.get_own_system_with_http_info
122
+ p status_code # => 2xx
123
+ p headers # => { ... }
124
+ p data # => <System>
125
+ rescue PluralKitAPI::ApiError => e
126
+ puts "Error when calling SystemsApi->get_own_system_with_http_info: #{e}"
127
+ end
128
+ ```
129
+
130
+ ### Parameters
131
+
132
+ This endpoint does not need any parameter.
133
+
134
+ ### Return type
135
+
136
+ [**System**](System.md)
137
+
138
+ ### Authorization
139
+
140
+ [TokenAuth](../README.md#TokenAuth)
141
+
142
+ ### HTTP request headers
143
+
144
+ - **Content-Type**: Not defined
145
+ - **Accept**: application/json
146
+
147
+
148
+ ## get_system
149
+
150
+ > <System> get_system(id)
151
+
152
+ Gets a system by its ID.
153
+
154
+ Partial information may be returned if not authenticated with this system's token.
155
+
156
+ ### Examples
157
+
158
+ ```ruby
159
+ require 'time'
160
+ require 'pluralkit-api'
161
+
162
+ api_instance = PluralKitAPI::SystemsApi.new
163
+ id = 'id_example' # String | The ID of the system in question.
164
+
165
+ begin
166
+ # Gets a system by its ID.
167
+ result = api_instance.get_system(id)
168
+ p result
169
+ rescue PluralKitAPI::ApiError => e
170
+ puts "Error when calling SystemsApi->get_system: #{e}"
171
+ end
172
+ ```
173
+
174
+ #### Using the get_system_with_http_info variant
175
+
176
+ This returns an Array which contains the response data, status code and headers.
177
+
178
+ > <Array(<System>, Integer, Hash)> get_system_with_http_info(id)
179
+
180
+ ```ruby
181
+ begin
182
+ # Gets a system by its ID.
183
+ data, status_code, headers = api_instance.get_system_with_http_info(id)
184
+ p status_code # => 2xx
185
+ p headers # => { ... }
186
+ p data # => <System>
187
+ rescue PluralKitAPI::ApiError => e
188
+ puts "Error when calling SystemsApi->get_system_with_http_info: #{e}"
189
+ end
190
+ ```
191
+
192
+ ### Parameters
193
+
194
+ | Name | Type | Description | Notes |
195
+ | ---- | ---- | ----------- | ----- |
196
+ | **id** | **String** | The ID of the system in question. | |
197
+
198
+ ### Return type
199
+
200
+ [**System**](System.md)
201
+
202
+ ### Authorization
203
+
204
+ No authorization required
205
+
206
+ ### HTTP request headers
207
+
208
+ - **Content-Type**: Not defined
209
+ - **Accept**: application/json
210
+
211
+
212
+ ## get_system_fronters
213
+
214
+ > <FullSwitch> get_system_fronters(id)
215
+
216
+ Gets a system's current fronters.
217
+
218
+ ### Examples
219
+
220
+ ```ruby
221
+ require 'time'
222
+ require 'pluralkit-api'
223
+
224
+ api_instance = PluralKitAPI::SystemsApi.new
225
+ id = 'id_example' # String | The ID of the system in question.
226
+
227
+ begin
228
+ # Gets a system's current fronters.
229
+ result = api_instance.get_system_fronters(id)
230
+ p result
231
+ rescue PluralKitAPI::ApiError => e
232
+ puts "Error when calling SystemsApi->get_system_fronters: #{e}"
233
+ end
234
+ ```
235
+
236
+ #### Using the get_system_fronters_with_http_info variant
237
+
238
+ This returns an Array which contains the response data, status code and headers.
239
+
240
+ > <Array(<FullSwitch>, Integer, Hash)> get_system_fronters_with_http_info(id)
241
+
242
+ ```ruby
243
+ begin
244
+ # Gets a system's current fronters.
245
+ data, status_code, headers = api_instance.get_system_fronters_with_http_info(id)
246
+ p status_code # => 2xx
247
+ p headers # => { ... }
248
+ p data # => <FullSwitch>
249
+ rescue PluralKitAPI::ApiError => e
250
+ puts "Error when calling SystemsApi->get_system_fronters_with_http_info: #{e}"
251
+ end
252
+ ```
253
+
254
+ ### Parameters
255
+
256
+ | Name | Type | Description | Notes |
257
+ | ---- | ---- | ----------- | ----- |
258
+ | **id** | **String** | The ID of the system in question. | |
259
+
260
+ ### Return type
261
+
262
+ [**FullSwitch**](FullSwitch.md)
263
+
264
+ ### Authorization
265
+
266
+ No authorization required
267
+
268
+ ### HTTP request headers
269
+
270
+ - **Content-Type**: Not defined
271
+ - **Accept**: application/json
272
+
273
+
274
+ ## get_system_members
275
+
276
+ > <Array<System>> get_system_members(id)
277
+
278
+ Gets a system's members.
279
+
280
+ If the API token does not belong to this system, this list may exclude any private members in the system.
281
+
282
+ ### Examples
283
+
284
+ ```ruby
285
+ require 'time'
286
+ require 'pluralkit-api'
287
+
288
+ api_instance = PluralKitAPI::SystemsApi.new
289
+ id = 'id_example' # String | The ID of the system in question.
290
+
291
+ begin
292
+ # Gets a system's members.
293
+ result = api_instance.get_system_members(id)
294
+ p result
295
+ rescue PluralKitAPI::ApiError => e
296
+ puts "Error when calling SystemsApi->get_system_members: #{e}"
297
+ end
298
+ ```
299
+
300
+ #### Using the get_system_members_with_http_info variant
301
+
302
+ This returns an Array which contains the response data, status code and headers.
303
+
304
+ > <Array(<Array<System>>, Integer, Hash)> get_system_members_with_http_info(id)
305
+
306
+ ```ruby
307
+ begin
308
+ # Gets a system's members.
309
+ data, status_code, headers = api_instance.get_system_members_with_http_info(id)
310
+ p status_code # => 2xx
311
+ p headers # => { ... }
312
+ p data # => <Array<System>>
313
+ rescue PluralKitAPI::ApiError => e
314
+ puts "Error when calling SystemsApi->get_system_members_with_http_info: #{e}"
315
+ end
316
+ ```
317
+
318
+ ### Parameters
319
+
320
+ | Name | Type | Description | Notes |
321
+ | ---- | ---- | ----------- | ----- |
322
+ | **id** | **String** | The ID of the system in question. | |
323
+
324
+ ### Return type
325
+
326
+ [**Array&lt;System&gt;**](System.md)
327
+
328
+ ### Authorization
329
+
330
+ No authorization required
331
+
332
+ ### HTTP request headers
333
+
334
+ - **Content-Type**: Not defined
335
+ - **Accept**: application/json
336
+
337
+
338
+ ## get_system_switches
339
+
340
+ > <Array<Switch>> get_system_switches(id, opts)
341
+
342
+ Gets a system's switch history.
343
+
344
+ Will return the system's switch history, up to 100 entries at a time, in reverse-chronological (latest first) order. For pagination, see the `before` query parameter.
345
+
346
+ ### Examples
347
+
348
+ ```ruby
349
+ require 'time'
350
+ require 'pluralkit-api'
351
+
352
+ api_instance = PluralKitAPI::SystemsApi.new
353
+ id = 'id_example' # String | The ID of the system in question.
354
+ opts = {
355
+ before: Time.parse('2013-10-20T19:20:30+01:00') # Time | If provided, will only return switches that happened *before* (and not including) this timestamp. This can be used for pagination by calling the endpoint again with the timestamp of the last switch of the previous response.
356
+ }
357
+
358
+ begin
359
+ # Gets a system's switch history.
360
+ result = api_instance.get_system_switches(id, opts)
361
+ p result
362
+ rescue PluralKitAPI::ApiError => e
363
+ puts "Error when calling SystemsApi->get_system_switches: #{e}"
364
+ end
365
+ ```
366
+
367
+ #### Using the get_system_switches_with_http_info variant
368
+
369
+ This returns an Array which contains the response data, status code and headers.
370
+
371
+ > <Array(<Array<Switch>>, Integer, Hash)> get_system_switches_with_http_info(id, opts)
372
+
373
+ ```ruby
374
+ begin
375
+ # Gets a system's switch history.
376
+ data, status_code, headers = api_instance.get_system_switches_with_http_info(id, opts)
377
+ p status_code # => 2xx
378
+ p headers # => { ... }
379
+ p data # => <Array<Switch>>
380
+ rescue PluralKitAPI::ApiError => e
381
+ puts "Error when calling SystemsApi->get_system_switches_with_http_info: #{e}"
382
+ end
383
+ ```
384
+
385
+ ### Parameters
386
+
387
+ | Name | Type | Description | Notes |
388
+ | ---- | ---- | ----------- | ----- |
389
+ | **id** | **String** | The ID of the system in question. | |
390
+ | **before** | **Time** | If provided, will only return switches that happened *before* (and not including) this timestamp. This can be used for pagination by calling the endpoint again with the timestamp of the last switch of the previous response. | [optional] |
391
+
392
+ ### Return type
393
+
394
+ [**Array&lt;Switch&gt;**](Switch.md)
395
+
396
+ ### Authorization
397
+
398
+ No authorization required
399
+
400
+ ### HTTP request headers
401
+
402
+ - **Content-Type**: Not defined
403
+ - **Accept**: application/json
404
+
405
+
406
+ ## update_system
407
+
408
+ > <System> update_system(system)
409
+
410
+ Updates an existing system.
411
+
412
+ Requires authentication, and will update the system the token belongs to.
413
+
414
+ ### Examples
415
+
416
+ ```ruby
417
+ require 'time'
418
+ require 'pluralkit-api'
419
+ # setup authorization
420
+ PluralKitAPI.configure do |config|
421
+ # Configure API key authorization: TokenAuth
422
+ config.api_key['TokenAuth'] = 'YOUR API KEY'
423
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
424
+ # config.api_key_prefix['TokenAuth'] = 'Bearer'
425
+ end
426
+
427
+ api_instance = PluralKitAPI::SystemsApi.new
428
+ system = PluralKitAPI::System.new # System |
429
+
430
+ begin
431
+ # Updates an existing system.
432
+ result = api_instance.update_system(system)
433
+ p result
434
+ rescue PluralKitAPI::ApiError => e
435
+ puts "Error when calling SystemsApi->update_system: #{e}"
436
+ end
437
+ ```
438
+
439
+ #### Using the update_system_with_http_info variant
440
+
441
+ This returns an Array which contains the response data, status code and headers.
442
+
443
+ > <Array(<System>, Integer, Hash)> update_system_with_http_info(system)
444
+
445
+ ```ruby
446
+ begin
447
+ # Updates an existing system.
448
+ data, status_code, headers = api_instance.update_system_with_http_info(system)
449
+ p status_code # => 2xx
450
+ p headers # => { ... }
451
+ p data # => <System>
452
+ rescue PluralKitAPI::ApiError => e
453
+ puts "Error when calling SystemsApi->update_system_with_http_info: #{e}"
454
+ end
455
+ ```
456
+
457
+ ### Parameters
458
+
459
+ | Name | Type | Description | Notes |
460
+ | ---- | ---- | ----------- | ----- |
461
+ | **system** | [**System**](System.md) | | |
462
+
463
+ ### Return type
464
+
465
+ [**System**](System.md)
466
+
467
+ ### Authorization
468
+
469
+ [TokenAuth](../README.md#TokenAuth)
470
+
471
+ ### HTTP request headers
472
+
473
+ - **Content-Type**: application/json
474
+ - **Accept**: application/json
475
+