Skip to content
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

add incoming message log flag to application model #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/plivo/resources/applications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def initialize(client, options = nil)
# @option options [Boolean] :default_number_app - If set to true, this parameter ensures that newly created numbers, which don't have an app_id, point to this application.
# @option options [Boolean] :default_endpoint_app - If set to true, this parameter ensures that newly created endpoints, which don't have an app_id, point to this application.
# @option options [String] :subaccount - Id of the subaccount, in case only subaccount applications are needed.
# @option options [Boolean] :log_incoming_message - controls the incoming message logs.
# @return [Application] Application
def update(options = nil)
return perform_update({}) if options.nil?
Expand Down Expand Up @@ -79,7 +80,8 @@ def to_s
public_uri: @public_uri,
resource_uri: @resource_uri,
sip_uri: @sip_uri,
sub_account: @sub_account
sub_account: @sub_account,
log_incoming_message: @log_incoming_message
}.to_s
end
end
Expand Down Expand Up @@ -115,6 +117,7 @@ def get(app_id)
# @option options [Boolean] :default_number_app - If set to true, this parameter ensures that newly created numbers, which don't have an app_id, point to this application.
# @option options [Boolean] :default_endpoint_app - If set to true, this parameter ensures that newly created endpoints, which don't have an app_id, point to this application.
# @option options [String] :subaccount - Id of the subaccount, in case only subaccount applications are needed.
# @option options [Boolean] :log_incoming_message - controls the incoming message logs.
# @return [Application] Application
def create(app_name, options = nil)
valid_param?(:app_name, app_name, [String, Symbol], true)
Expand Down Expand Up @@ -213,6 +216,7 @@ def each
# @option options [Boolean] :default_number_app - If set to true, this parameter ensures that newly created numbers, which don't have an app_id, point to this application.
# @option options [Boolean] :default_endpoint_app - If set to true, this parameter ensures that newly created endpoints, which don't have an app_id, point to this application.
# @option options [String] :subaccount - Id of the subaccount, in case only subaccount applications are needed.
# @option options [Boolean] :log_incoming_message - controls the incoming message logs.
# @return [Application] Application
def update(app_id, options = nil)
valid_param?(:app_id, app_id, [String, Symbol], true)
Expand Down
5 changes: 3 additions & 2 deletions spec/mocks/applicationGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/20468599130939380/",
"sip_uri": "sip:[email protected]",
"sub_account": null
}
"sub_account": null,
"log_incoming_message": true
}
26 changes: 17 additions & 9 deletions spec/mocks/applicationListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/20468599130939380/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": true
},
{
"answer_method": "POST",
Expand All @@ -44,7 +45,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/13094892674577059/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": true
},
{
"answer_method": "POST",
Expand All @@ -63,7 +65,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/64529074997228907/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": false
},
{
"answer_method": "GET",
Expand All @@ -82,7 +85,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/30042999414609341/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": true
},
{
"answer_method": "GET",
Expand All @@ -101,7 +105,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/30042349822904887/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": true
},
{
"answer_method": "GET",
Expand All @@ -120,7 +125,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/30041373335801898/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": true
},
{
"answer_method": "POST",
Expand All @@ -139,7 +145,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/30040535577211472/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": true
},
{
"answer_method": "GET",
Expand All @@ -158,7 +165,8 @@
"public_uri": false,
"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/30039778631346811/",
"sip_uri": "sip:[email protected]",
"sub_account": null
"sub_account": null,
"log_incoming_message": true
}
]
}
}
3 changes: 2 additions & 1 deletion spec/resource_applications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def to_json(application)
public_uri: application.public_uri,
resource_uri: application.resource_uri,
sip_uri: application.sip_uri,
sub_account: application.sub_account
sub_account: application.sub_account,
log_incoming_message: application.log_incoming_message
}.to_json
end

Expand Down