-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add create/update card request fields; SFTPSettings (#16)
Co-authored-by: ProcessOut Fountain <[email protected]>
- Loading branch information
1 parent
013f43e
commit 2462860
Showing
6 changed files
with
137 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,106 @@ | ||
try: | ||
from urllib.parse import quote_plus | ||
except ImportError: | ||
from urllib import quote_plus | ||
|
||
import processout | ||
import json | ||
|
||
from processout.networking.request import Request | ||
from processout.networking.response import Response | ||
|
||
# The content of this file was automatically generated | ||
|
||
|
||
class ProjectSFTPSettingsPublic(object): | ||
def __init__(self, client, prefill=None): | ||
self._client = client | ||
|
||
self._enabled = None | ||
self._endpoint = None | ||
self._username = None | ||
if prefill is not None: | ||
self.fill_with_data(prefill) | ||
|
||
@property | ||
def enabled(self): | ||
"""Get enabled""" | ||
return self._enabled | ||
|
||
@enabled.setter | ||
def enabled(self, val): | ||
"""Set enabled | ||
Keyword argument: | ||
val -- New enabled value""" | ||
self._enabled = val | ||
return self | ||
|
||
@property | ||
def endpoint(self): | ||
"""Get endpoint""" | ||
return self._endpoint | ||
|
||
@endpoint.setter | ||
def endpoint(self, val): | ||
"""Set endpoint | ||
Keyword argument: | ||
val -- New endpoint value""" | ||
self._endpoint = val | ||
return self | ||
|
||
@property | ||
def username(self): | ||
"""Get username""" | ||
return self._username | ||
|
||
@username.setter | ||
def username(self, val): | ||
"""Set username | ||
Keyword argument: | ||
val -- New username value""" | ||
self._username = val | ||
return self | ||
|
||
def fill_with_data(self, data): | ||
"""Fill the current object with the new values pulled from data | ||
Keyword argument: | ||
data -- The data from which to pull the new values""" | ||
if "enabled" in data.keys(): | ||
self.enabled = data["enabled"] | ||
if "endpoint" in data.keys(): | ||
self.endpoint = data["endpoint"] | ||
if "username" in data.keys(): | ||
self.username = data["username"] | ||
|
||
return self | ||
|
||
def to_json(self): | ||
return { | ||
"enabled": self.enabled, | ||
"endpoint": self.endpoint, | ||
"username": self.username, | ||
} | ||
|
||
def fetch_sftp_settings(self, id, options={}): | ||
"""Fetch the SFTP settings for the project. | ||
Keyword argument: | ||
id -- ID of the project | ||
options -- Options for the request""" | ||
self.fill_with_data(options) | ||
|
||
request = Request(self._client) | ||
path = "/projects/" + quote_plus(id) + "/sftp-settings" | ||
data = { | ||
|
||
} | ||
|
||
response = Response(request.get(path, data, options)) | ||
return_values = [] | ||
|
||
body = response.body | ||
body = body["sftp_settings"] | ||
|
||
obj = processout.ProjectSFTPSettingsPublic(self._client) | ||
return_values.append(obj.fill_with_data(body)) | ||
|
||
return return_values[0] |
This file contains 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 |
---|---|---|
|
@@ -3,12 +3,12 @@ | |
setup( | ||
name = 'processout', | ||
packages = ['processout', 'processout.errors', 'processout.networking'], | ||
version = '6.33.0', | ||
version = '6.34.0', | ||
description = 'ProcessOut API bindings.', | ||
author = 'ProcessOut', | ||
author_email = '[email protected]', | ||
url = 'https://github.com/processout/processout-python', | ||
download_url = 'https://github.com/processout/processout-python/tarball/6.33.0', | ||
download_url = 'https://github.com/processout/processout-python/tarball/6.34.0', | ||
keywords = ['ProcessOut', 'api', 'bindings'], | ||
classifiers = [], | ||
) |