From 52cdeb73ca6b02b22a6a8a03547b360c54e10a36 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 14 Dec 2021 11:44:03 -0800 Subject: [PATCH 1/6] Branch commit From 4b147ba6650730ff86e4db2423c02b6b97d30dab Mon Sep 17 00:00:00 2001 From: Ayelen Sanchez Date: Fri, 7 Jan 2022 14:59:27 -0300 Subject: [PATCH 2/6] AUTO-784 | Adding references to new automation enrollments endpoints --- lib/api_spec.rb | 1 + lib/api_spec/specs/automation_enrollments.rb | 47 ++++++++++++++++ spec.json | 57 ++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 lib/api_spec/specs/automation_enrollments.rb diff --git a/lib/api_spec.rb b/lib/api_spec.rb index 023aed4..d4a4a45 100644 --- a/lib/api_spec.rb +++ b/lib/api_spec.rb @@ -4,6 +4,7 @@ module ApiSpec; end require 'generator' +require 'specs/automation_enrollments' require 'specs/basic_pages' require 'specs/blog_posts' require 'specs/blogs' diff --git a/lib/api_spec/specs/automation_enrollments.rb b/lib/api_spec/specs/automation_enrollments.rb new file mode 100644 index 0000000..b187eb0 --- /dev/null +++ b/lib/api_spec/specs/automation_enrollments.rb @@ -0,0 +1,47 @@ +class ApiSpec::Spec + + endpoint 'Automation Enrollments' do |automation_enrollment| + + automation_enrollment.method('Index') do |method| + method.synopsis = 'Shows the list of automation enrollments' + method.http_method = 'GET' + method.uri = '/v1/automation/:id/automation_enrollment/' + + method.parameter('id') do |p| + p.required = 'Y' + p.type = 'int' + p.description = 'The Automation ID that contains all automation enrollments requested' + end + end + + automation_enrollment.method('Create') do |method| + method.synopsis = 'Creates an automation enrollment with the provided data' + method.http_method = 'POST' + method.uri = '/v1/automation_enrollments' + + method.parameter('body') do |p| + p.required = 'Y' + p.type = 'json' + p.description = 'JSON representation of the new automation enrollment' + end + end + + automation_enrollment.method('Destroy') do |method| + method.synopsis = 'Destroy a specific Automation Enrollment based on the signup' + method.http_method = 'DELETE' + method.uri = '/v1/automation/:id/automation_enrollment/' + + method.parameter('signup_id') do |p| + p.required = 'Y' + p.type = 'int' + p.description = 'The Signup id of the automation enrollment' + end + + method.parameter('automation_id') do |p| + p.required = 'Y' + p.type = 'int' + p.description = 'The Automation id of the automation enrollment' + end + end + end +end diff --git a/spec.json b/spec.json index b46258b..cf1df8f 100644 --- a/spec.json +++ b/spec.json @@ -1,5 +1,62 @@ { "endpoints": [ + { + "name": "Automation Enrollments", + "methods": [ + { + "MethodName": "Index", + "Synopsis": "Shows the list of automation enrollments", + "HTTPMethod": "GET", + "URI": "/v1/automation/:id/automation_enrollment/", + "parameters": [ + { + "Name": "id", + "Required": "Y", + "Default": null, + "Type": "int", + "Description": "The Automation ID that contains all automation enrollments requested" + } + ] + }, + { + "MethodName": "Create", + "Synopsis": "Creates an automation enrollment with the provided data", + "HTTPMethod": "POST", + "URI": "/v1/automation_enrollments", + "parameters": [ + { + "Name": "body", + "Required": "Y", + "Default": null, + "Type": "json", + "Description": "JSON representation of the new automation enrollment" + } + ] + }, + { + "MethodName": "Destroy", + "Synopsis": "Destroy a specific Automation Enrollment based on the signup", + "HTTPMethod": "DELETE", + "URI": "/v1/automation/:id/automation_enrollment/", + "parameters": [ + { + "Name": "signup_id", + "Required": "Y", + "Default": null, + "Type": "int", + "Description": "The Signup id of the automation enrollment" + }, + { + "Name": "automation_id", + "Required": "Y", + "Default": null, + "Type": "int", + "Description": "The Automation id of the automation enrollment" + } + ] + } + ] + }, { "name": "Basic Pages", "methods": [ From d4df8fc3a05dbda50d2bda200a322b4291d1130e Mon Sep 17 00:00:00 2001 From: Ayelen Sanchez Date: Fri, 14 Jan 2022 12:15:05 -0300 Subject: [PATCH 3/6] AUTO-784 | modifying automation enrollment enpoints --- lib/api_spec/specs/automation_enrollments.rb | 12 ++++++------ spec.json | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/api_spec/specs/automation_enrollments.rb b/lib/api_spec/specs/automation_enrollments.rb index b187eb0..e92d60a 100644 --- a/lib/api_spec/specs/automation_enrollments.rb +++ b/lib/api_spec/specs/automation_enrollments.rb @@ -1,11 +1,11 @@ class ApiSpec::Spec - endpoint 'Automation Enrollments' do |automation_enrollment| + endpoint 'Automation Enrollments' do |automation_enrollments| - automation_enrollment.method('Index') do |method| + automation_enrollments.method('Index') do |method| method.synopsis = 'Shows the list of automation enrollments' method.http_method = 'GET' - method.uri = '/v1/automation/:id/automation_enrollment/' + method.uri = '/v1/automations/:id/automation_enrollments/' method.parameter('id') do |p| p.required = 'Y' @@ -14,7 +14,7 @@ class ApiSpec::Spec end end - automation_enrollment.method('Create') do |method| + automation_enrollments.method('Create') do |method| method.synopsis = 'Creates an automation enrollment with the provided data' method.http_method = 'POST' method.uri = '/v1/automation_enrollments' @@ -26,10 +26,10 @@ class ApiSpec::Spec end end - automation_enrollment.method('Destroy') do |method| + automation_enrollments.method('Destroy') do |method| method.synopsis = 'Destroy a specific Automation Enrollment based on the signup' method.http_method = 'DELETE' - method.uri = '/v1/automation/:id/automation_enrollment/' + method.uri = '/v1/automations/:id/automation_enrollments/' method.parameter('signup_id') do |p| p.required = 'Y' diff --git a/spec.json b/spec.json index cf1df8f..971264e 100644 --- a/spec.json +++ b/spec.json @@ -7,7 +7,7 @@ "MethodName": "Index", "Synopsis": "Shows the list of automation enrollments", "HTTPMethod": "GET", - "URI": "/v1/automation/:id/automation_enrollment/", + "URI": "/v1/automations/:id/automation_enrollments/", "parameters": [ { "Name": "id", @@ -37,7 +37,7 @@ "MethodName": "Destroy", "Synopsis": "Destroy a specific Automation Enrollment based on the signup", "HTTPMethod": "DELETE", - "URI": "/v1/automation/:id/automation_enrollment/", + "URI": "/v1/automations/:id/automation_enrollments/", "parameters": [ { "Name": "signup_id", From 4e4998fcccfec7de413638bef3eb14ada62955c8 Mon Sep 17 00:00:00 2001 From: Ayelen Sanchez Date: Fri, 28 Jan 2022 15:10:49 -0300 Subject: [PATCH 4/6] Fixing endpoints for automation_enrollments --- lib/api_spec/specs/automation_enrollments.rb | 6 +++--- spec.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/api_spec/specs/automation_enrollments.rb b/lib/api_spec/specs/automation_enrollments.rb index e92d60a..2dd44d2 100644 --- a/lib/api_spec/specs/automation_enrollments.rb +++ b/lib/api_spec/specs/automation_enrollments.rb @@ -17,7 +17,7 @@ class ApiSpec::Spec automation_enrollments.method('Create') do |method| method.synopsis = 'Creates an automation enrollment with the provided data' method.http_method = 'POST' - method.uri = '/v1/automation_enrollments' + method.uri = '/v1/automations/:id/automation_enrollments' method.parameter('body') do |p| p.required = 'Y' @@ -29,7 +29,7 @@ class ApiSpec::Spec automation_enrollments.method('Destroy') do |method| method.synopsis = 'Destroy a specific Automation Enrollment based on the signup' method.http_method = 'DELETE' - method.uri = '/v1/automations/:id/automation_enrollments/' + method.uri = '/v1/automations/:id/automation_enrollments' method.parameter('signup_id') do |p| p.required = 'Y' @@ -37,7 +37,7 @@ class ApiSpec::Spec p.description = 'The Signup id of the automation enrollment' end - method.parameter('automation_id') do |p| + method.parameter('id') do |p| p.required = 'Y' p.type = 'int' p.description = 'The Automation id of the automation enrollment' diff --git a/spec.json b/spec.json index 971264e..a07b5e3 100644 --- a/spec.json +++ b/spec.json @@ -22,7 +22,7 @@ "MethodName": "Create", "Synopsis": "Creates an automation enrollment with the provided data", "HTTPMethod": "POST", - "URI": "/v1/automation_enrollments", + "URI": "/v1/automations/:id/automation_enrollments", "parameters": [ { "Name": "body", @@ -37,7 +37,7 @@ "MethodName": "Destroy", "Synopsis": "Destroy a specific Automation Enrollment based on the signup", "HTTPMethod": "DELETE", - "URI": "/v1/automations/:id/automation_enrollments/", + "URI": "/v1/automations/:id/automation_enrollments", "parameters": [ { "Name": "signup_id", @@ -47,7 +47,7 @@ "Description": "The Signup id of the automation enrollment" }, { - "Name": "automation_id", + "Name": "id", "Required": "Y", "Default": null, "Type": "int", From 1b30349346db2637f33c161f31f923ae03f1b139 Mon Sep 17 00:00:00 2001 From: Ayelen Sanchez Date: Fri, 28 Jan 2022 15:14:07 -0300 Subject: [PATCH 5/6] remove slash at the end of get endpoint --- lib/api_spec/specs/automation_enrollments.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api_spec/specs/automation_enrollments.rb b/lib/api_spec/specs/automation_enrollments.rb index 2dd44d2..25476a6 100644 --- a/lib/api_spec/specs/automation_enrollments.rb +++ b/lib/api_spec/specs/automation_enrollments.rb @@ -5,7 +5,7 @@ class ApiSpec::Spec automation_enrollments.method('Index') do |method| method.synopsis = 'Shows the list of automation enrollments' method.http_method = 'GET' - method.uri = '/v1/automations/:id/automation_enrollments/' + method.uri = '/v1/automations/:id/automation_enrollments' method.parameter('id') do |p| p.required = 'Y' From 529b595356b9fb03c1aefbeb58002df74dc8cfaa Mon Sep 17 00:00:00 2001 From: Ayelen Sanchez Date: Fri, 28 Jan 2022 15:16:48 -0300 Subject: [PATCH 6/6] fixing endpoint into spec json --- spec.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.json b/spec.json index a07b5e3..393958b 100644 --- a/spec.json +++ b/spec.json @@ -7,7 +7,7 @@ "MethodName": "Index", "Synopsis": "Shows the list of automation enrollments", "HTTPMethod": "GET", - "URI": "/v1/automations/:id/automation_enrollments/", + "URI": "/v1/automations/:id/automation_enrollments", "parameters": [ { "Name": "id",