1- #
21# The MIT License (MIT)
32#
43# Copyright (C) 2014 hellosign.com
2019# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2120# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2221# SOFTWARE.
23- #
2422
2523module HelloSign
2624 module Api
27- #
2825 # Contains all the API calls for the ApiApp resource.
29- # Take a look at our API Documentation for ApiApps (https://app.hellosign.com/api/reference#ApiApp)
26+ # Take a look at our API Documentation on ApiApps (https://app.hellosign.com/api/reference#ApiApp)
3027 # for more information about this.
3128 #
3229 # @author [hellosign]
33- #
30+
3431 module ApiApp
3532
36- #
37- # Retrieves information about a specific API App by a given ID
33+ # Retrieves an ApiApp with a given ID
3834 # @option opts [String] client_id The Client ID of the ApiApp.
3935 #
40- # @return [HelloSign::Resource::ApiApp] the ApiApp
36+ # @return [HelloSign::Resource::ApiApp]
4137 #
4238 # @example
43- # app = @client.get_api_app :client_id => 'fa5c8a0b0f492d768749333ad6fcc214c111e967'
44- #
39+ # app = @client.get_api_app client_id: 'fa5c8a0b0f492d768749333ad6fcc214c111e967'
4540 def get_api_app ( opts )
4641 HelloSign ::Resource ::ApiApp . new get ( "/api_app/#{ opts [ :client_id ] } " )
4742 end
4843
49- #
50- # Returns a list of ApiApps that you currently have access to on your account
44+ # Returns a list of ApiApps that your Account can access.
5145 # @option opts [Integer] page Sets the page number of the list to return. Defaults to 1. (optional)
5246 # @option opts [Integer] page_size Determines the number of ApiApps returned per page. Defaults to 20. (optional)
5347 #
5448 # @return [HelloSign::Resource::ResourceArray]
5549 #
5650 # @example
57- # apps = @client.get_api_apps :page => 1
58- #
51+ # apps = @client.get_api_apps page: 1
5952 def get_api_apps ( opts = { } )
6053 path = '/api_app/list'
6154 path += opts [ :page ] ? "?page=#{ opts [ :page ] } " : ''
6255 path += opts [ :page_size ] ? "&page_size=#{ opts [ :page_size ] } " : ''
6356 HelloSign ::Resource ::ResourceArray . new get ( path , opts ) , 'api_apps' , HelloSign ::Resource ::ApiApp
6457 end
6558
66- #
67- # Creates a new API Application on your account
59+ # Creates a new ApiApp on your Account
6860 # @option opts [String] name The name assigned to the ApiApp.
6961 # @option opts [String] domain The domain associated with the ApiApp.
7062 # @option opts [String] callback_url The URL that will receive callback events for the ApiApp. (optional)
@@ -74,16 +66,20 @@ def get_api_apps(opts={})
7466 # @option opts [String<Hash>] white_labeling_options Object with elements and values serialized to a string to customize the signer page, if available in the API subscription. (optional)
7567 # @option opts [Boolean] options[can_insert_everywhere] Determines if signers can "Insert Everywhere" when signing a document. (optional)
7668 #
77- # @return [HelloSign::Resource::ApiApp] newly created ApiApp object
69+ # @return [HelloSign::Resource::ApiApp] newly created ApiApp
7870 #
7971 # @example
80- # app = @client.create_api_app :name => 'My Production App', :domain => 'example.com', :'oauth[callback_url]' => 'https://example.com/oauth', 'oauth[scopes]' => 'basic_account_info,request_signature'
72+ # app = @client.create_api_app(
73+ # name: 'My Production App',
74+ # domain: 'example.com',
75+ # 'oauth[callback_url]': 'https://example.com/oauth',
76+ # 'oauth[scopes]': 'basic_account_info,request_signature'
77+ # )
8178 def create_api_app ( opts )
82- HelloSign ::Resource ::ApiApp . new post ( '/api_app' , : body => opts )
79+ HelloSign ::Resource ::ApiApp . new post ( '/api_app' , body : opts )
8380 end
8481
85- #
86- # Updates settings for a specific ApiApp on your account
82+ # Updates the ApiApp settings.
8783 # @option opts [String] client_id The Client ID of the ApiApp you want to update.
8884 # @option opts [String] name The name assigned to the ApiApp. (optional)
8985 # @option opts [String] domain The domain associated with the ApiApp. (optional)
@@ -97,19 +93,25 @@ def create_api_app(opts)
9793 # @return [HelloSign::Resource::ApiApp] an ApiApp object
9894 #
9995 # @example
100- # app = @client.update_api_app :name => 'My Newly Renamed App', :domain => 'example2.com', :'oauth[callback_url]' => 'https://example2.com/oauth', 'oauth[scopes]' => 'basic_account_info,request_signature'
96+ # app = @client.update_api_app(
97+ # name: 'My Newly Renamed App',
98+ # domain: 'example2.com',
99+ # 'oauth[callback_url]': 'https://example2.com/oauth',
100+ # 'oauth[scopes]': 'basic_account_info, request_signature'
101+ # )
101102 def update_api_app ( opts )
102103 id = opts . delete ( :client_id )
103104 path = '/api_app/' + id
104- HelloSign ::Resource ::ApiApp . new post ( path , : body => opts )
105+ HelloSign ::Resource ::ApiApp . new post ( path , body : opts )
105106 end
106107
107- #
108108 # Deletes an ApiApp. Only available for ApiApps you own.
109109 # @option opts [String] client_id The Client ID of the ApiApp you want to delete.
110110 #
111+ # @return [HTTP::Status] 204 No Content
112+ #
111113 # @example
112- # result = @client.delete_api_app : client_id => 'fa5c8a0b0f492d768749333ad6fcc214c111e967'
114+ # response = @client.delete_api_app client_id: 'fa5c8a0b0f492d768749333ad6fcc214c111e967'
113115 def delete_api_app ( opts )
114116 path = '/api_app/' + opts [ :client_id ]
115117 delete ( path )
0 commit comments