-
Notifications
You must be signed in to change notification settings - Fork 69
Rework the account/settings endpoint #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Dorthu
merged 3 commits into
linode:develop
from
Dorthu:feature/rework-account-endpoint
Jan 22, 2018
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,21 +5,19 @@ description: > | |
Account endpoints provide a means of manipulating your account, including users, | ||
OAuth Clients and Tokens, and Events. | ||
endpoints: | ||
/account/settings: | ||
group: Settings | ||
/account: | ||
type: resource | ||
description: > | ||
Manage your account settings. | ||
Managed account contact and billing information. | ||
methods: | ||
GET: | ||
response: account | ||
description: > | ||
Returns your account settings. | ||
examples: | ||
curl: | | ||
curl https://$api_root/$version/account/settings | ||
python: | | ||
my_settings = client.account.get_settings() | ||
curl -H "Authorization: Bearer $TOKEN" \ | ||
https://$api_root/$version/account | ||
PUT: | ||
description: > | ||
Edits your account settings. | ||
|
@@ -36,23 +34,39 @@ endpoints: | |
"email": "[email protected]", | ||
"first_name": "John", | ||
"last_name": "Smith", | ||
"network_helper": true, | ||
"phone": "555-555-1212", | ||
"state": "PA", | ||
"zip": 19102, | ||
} | ||
}' \ | ||
https://$api_root/$version/account | ||
/account/settings: | ||
group: Settings | ||
type: resource | ||
description: > | ||
Manage default settings for your account. | ||
methods: | ||
GET: | ||
response: account_settings | ||
description: > | ||
Returns your current defaults. | ||
examples: | ||
curl: | | ||
curl -H "Authorization: Bearer $TOKEN" \ | ||
https://$api_root/$version/account/settings | ||
PUT: | ||
description: > | ||
Edits your account's defaults. | ||
examples: | ||
curl: | | ||
curl -H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $TOKEN" \ | ||
-X PUT -d '{ | ||
"network_helper": true, | ||
"longview_subscription": "longview-10" | ||
} | ||
}' \ | ||
https://$api_root/$version/account/settings | ||
python: | | ||
my_settings = client.account.get_settings() | ||
my_settings.address_1 = '123 Main St.' | ||
my_settings.address_2 = 'Suite 101' | ||
my_settings.city = 'Philadelphia' | ||
my_settings.company = 'My Company, LLC' | ||
my_settings.country = 'US' | ||
my_settings.email = '[email protected]' | ||
my_settings.save() | ||
/account/settings/managed-enable: | ||
group: Settings | ||
authenticated: true | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
# vim: set et ts=2 sw=2 tw=80 : | ||
name: Account | ||
prefix: account/settings | ||
prefix: account | ||
description: > | ||
A representation of account settings. | ||
Your account contact and billing information. | ||
schema: | ||
first_name: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing PUT output |
||
type: String | ||
description: This account holder's first name. | ||
value: John | ||
last_name: | ||
type: String | ||
description: This account holder's last name. | ||
value: Smith | ||
company: | ||
type: String | ||
description: This account's company name. | ||
value: My Company LLC | ||
address_1: | ||
type: String | ||
description: First line of this account's billing address. | ||
|
@@ -14,12 +25,18 @@ schema: | |
value: Suite 101 | ||
city: | ||
type: String | ||
description: City portion of this account's billing address. | ||
description: The city for this account's billing address. | ||
value: Philadelphia | ||
company: | ||
state: | ||
type: String | ||
description: This account's company name. | ||
value: My Company LLC | ||
description: > | ||
State portion of this account's billing address, or province if you | ||
are outside of the United States. | ||
value: PA | ||
zip: | ||
type: String | ||
description: The zip code for this account's billing address. | ||
value: 19102 | ||
country: | ||
type: String | ||
description: Country portion of this account's billing address. | ||
|
@@ -28,41 +45,17 @@ schema: | |
type: String | ||
description: Email address associated with the account. | ||
value: [email protected] | ||
first_name: | ||
type: String | ||
description: This account holder's first name. | ||
value: John | ||
last_name: | ||
type: String | ||
description: This account holder's last name. | ||
value: Smith | ||
network_helper: | ||
type: Boolean | ||
description: Enables network helper by default across all users. | ||
value: true | ||
phone: | ||
type: String | ||
description: Phone number associated with the account. Required format is 123-456-7890. | ||
value: 555-555-1212 | ||
state: | ||
type: String | ||
description: State (or province) portion of this account's billing address. | ||
value: PA | ||
zip: | ||
type: String | ||
description: Zip Code portion of this account's billing address. | ||
value: 19102 | ||
balance: | ||
type: Float | ||
description: This account's balance (in US Dollars). | ||
value: 0.00 | ||
longview_subscription: | ||
type: String | ||
description: The Longview Pro tier you are currently subscribed to. | ||
value: null | ||
vat_number: | ||
type: String | ||
value: null | ||
description: > | ||
Your VAT identification number, for tax calculations in some countries. If | ||
you do not live in a country that collects VAT, this should be null. | ||
balance: | ||
type: Float | ||
description: This account's balance (in US Dollars). | ||
value: 0.00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Account | ||
prefix: account/settings | ||
description: > | ||
A representation of account settings. | ||
schema: | ||
network_helper: | ||
type: Boolean | ||
description: Enables network helper by default across all users. | ||
value: true | ||
editable: true | ||
longview_subscription: | ||
type: String | ||
description: The Longview Pro tier you are currently subscribed to. | ||
value: null | ||
editable: true | ||
managed: | ||
type: Boolean | ||
description: | | ||
If this account subscribes to Linode Managed. To subscribe to managed, | ||
POST to /account/settings/managed-enable |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably include something like
is_managed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done