mitchell852 closed pull request #2122: Created Swagger documentation for 
/phys_locations
URL: https://github.com/apache/incubator-trafficcontrol/pull/2122
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/go-tc/v13/physlocations.go b/lib/go-tc/v13/physlocations.go
new file mode 100644
index 000000000..dc1c4f512
--- /dev/null
+++ b/lib/go-tc/v13/physlocations.go
@@ -0,0 +1,194 @@
+package v13
+
+import tc "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+type PhysLocationsResponse struct {
+       Response []PhysLocation `json:"response"`
+}
+
+type PhysLocationResponse struct {
+       Response PhysLocationNullable `json:"response"`
+}
+
+type PhysLocation struct {
+
+       //
+       // The Street Address of the physical location
+       //
+       // required: true
+       Address string `json:"address" db:"address"`
+
+       //
+       // The Address of the physical location
+       //
+       // required: true
+       City string `json:"city" db:"city"`
+
+       //
+       // comments are additional details about the physical location
+       //
+       Comments string `json:"comments" db:"comments"`
+
+       //
+       // The email address for the Point of Contact at the physical location
+       //
+       Email string `json:"email" db:"email"`
+
+       //
+       // The name of the physical location
+       //
+       // required: true
+       ID int `json:"id" db:"id"`
+
+       // Timestamp of the last time this row was updated
+       //
+       LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
+
+       //
+       // The name of the physical location
+       //
+       // required: true
+       Name string `json:"name" db:"name"`
+
+       //
+       // The phone number of the physical location
+       //
+       // required: true
+       Phone string `json:"phone" db:"phone"`
+
+       //
+       // The Point Of Contact at the physical location
+       //
+       // required: true
+       POC string `json:"poc" db:"poc"`
+
+       //
+       // The RegionID associated to this physical location
+       //
+       // required: true
+       RegionID int `json:"regionId" db:"region"`
+
+       //
+       // The Region Name for the region associated to this physical location
+       //
+       RegionName string `json:"region" db:"region_name"`
+
+       //
+       // The shortName for the physical location (like an alias)
+       //
+       // required: true
+       ShortName string `json:"shortName" db:"short_name"`
+
+       //
+       // The State for the physical location
+       //
+       // required: true
+       State string `json:"state" db:"state"`
+
+       //
+       // The Zipcode for the physical location
+       //
+       // required: true
+       Zip string `json:"zip" db:"zip"`
+}
+
+// PhysLocationNullable - a struct version that allows for all fields to be 
null
+type PhysLocationNullable struct {
+       //
+       // The Street Address of the physical location
+       //
+       // required: true
+       Address *string `json:"address" db:"address"`
+
+       //
+       // The Address of the physical location
+       //
+       // required: true
+       City *string `json:"city" db:"city"`
+
+       //
+       // comments are additional details about the physical location
+       //
+       Comments *string `json:"comments" db:"comments"`
+
+       //
+       // The email address for the Point of Contact at the physical location
+       //
+       Email *string `json:"email" db:"email"`
+
+       //
+       // The name of the physical location
+       //
+       // required: true
+       ID *int `json:"id" db:"id"`
+
+       // Timestamp of the last time this row was updated
+       //
+       LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
+
+       //
+       // The name of the physical location
+       //
+       // required: true
+       Name *string `json:"name" db:"name"`
+
+       //
+       // The phone number of the physical location
+       //
+       // required: true
+       Phone *string `json:"phone" db:"phone"`
+
+       //
+       // The Point Of Contact at the physical location
+       //
+       // required: true
+       POC *string `json:"poc" db:"poc"`
+
+       //
+       // The RegionID associated to this physical location
+       //
+       // required: true
+       RegionID *int `json:"regionId" db:"region"`
+
+       //
+       // The Region Name for the region associated to this physical location
+       //
+       RegionName *string `json:"region" db:"region_name"`
+
+       //
+       // The shortName for the physical location (like an alias)
+       //
+       // required: true
+       ShortName *string `json:"shortName" db:"short_name"`
+
+       //
+       // The State for the physical location
+       //
+       // required: true
+       State *string `json:"state" db:"state"`
+
+       //
+       // The Zipcode for the physical location
+       //
+       // required: true
+       Zip *string `json:"zip" db:"zip"`
+}
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/v13/physlocations.go 
b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/physlocations.go
new file mode 100644
index 000000000..9acafc3b8
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/physlocations.go
@@ -0,0 +1,149 @@
+package v13
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import v13 "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13"
+
+// PhysLocations -  PhysLocationsResponse to get the "response" top level key
+// swagger:response PhysLocations
+// in: body
+type PhysLocations struct {
+       // PhysLocation Response Body
+       // in: body
+       PhysLocationsResponse v13.PhysLocationsResponse `json:"response"`
+}
+
+// PhysLocation -  PhysLocationResponse to get the "response" top level key
+// swagger:response PhysLocation
+// in: body
+type PhysLocation struct {
+       // PhysLocation Response Body
+       // in: body
+       PhysLocationResponse v13.PhysLocationResponse
+}
+
+// PhysLocationQueryParams
+//
+// swagger:parameters GetPhysLocations
+type PhysLocationQueryParams struct {
+
+       // PhysLocationsQueryParams
+
+       // The ID of the region associated with this Physical Location
+       //
+       RegionID int `json:"regionId"`
+
+       //
+       //
+       Orderby string `json:"orderby"`
+}
+
+// swagger:parameters PostPhysLocation
+type PhysLocationPostParam struct {
+       // PhysLocation Request Body
+       //
+       // in: body
+       // required: true
+       PhysLocation v13.PhysLocationNullable
+}
+
+// swagger:parameters GetPhysLocationById DeletePhysLocation
+type PhysLocationPathParams struct {
+
+       // Id associated to the PhysLocation
+       // in: path
+       ID int `json:"id"`
+}
+
+// PostPhysLocation swagger:route POST /phys_locations PhysLocation 
PostPhysLocation
+//
+// Create a PhysLocation
+//
+// A PhysLocation is a collection of Delivery Services
+//
+// Responses:
+//          200: Alerts
+func PostPhysLocation(entity PhysLocationPostParam) (PhysLocation, Alerts) {
+       return PhysLocation{}, Alerts{}
+}
+
+// GetPhysLocations swagger:route GET /phys_locations PhysLocation 
GetPhysLocations
+//
+// Retrieve a list of PhysLocations
+//
+// List of PhysLocations
+//
+// Responses:
+//          200: PhysLocations
+//          400: Alerts
+func GetPhysLocations() (PhysLocations, Alerts) {
+       return PhysLocations{}, Alerts{}
+}
+
+// swagger:parameters PutPhysLocation
+type PhysLocationPutParam struct {
+
+       // ID
+       // in: path
+       ID int `json:"id"`
+
+       // PhysLocation Request Body
+       //
+       // in: body
+       // required: true
+       PhysLocation v13.PhysLocationNullable
+}
+
+// PutPhysLocation swagger:route PUT /phys_locations/{id} PhysLocation 
PutPhysLocation
+//
+// Update a PhysLocation by Id
+//
+// Update a PhysLocation
+//
+// Responses:
+//          200: PhysLocation
+func PutPhysLocation(entity PhysLocationPutParam) (PhysLocation, Alerts) {
+       return PhysLocation{}, Alerts{}
+}
+
+// GetPhysLocationById swagger:route GET /phys_locations/{id} PhysLocation 
GetPhysLocationById
+//
+// Retrieve a specific PhysLocation by Id
+//
+// Retrieve a specific PhysLocation
+//
+// Responses:
+//          200: PhysLocations
+//          400: Alerts
+func GetPhysLocationById() (PhysLocations, Alerts) {
+       return PhysLocations{}, Alerts{}
+}
+
+// DeletePhysLocation swagger:route DELETE /phys_locations/{id} PhysLocation 
DeletePhysLocation
+//
+// Delete a PhysLocation by Id
+//
+// Delete a PhysLocation
+//
+// Responses:
+//          200: Alerts
+func DeletePhysLocation(entityId int) Alerts {
+       return Alerts{}
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to