You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2018/06/26 18:54:54 UTC
[trafficcontrol] 03/15: add tenants structs
This is an automated email from the ASF dual-hosted git repository.
dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 23aa135a32d47145bd614dafd925964d8936a17d
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Thu Jun 21 14:11:04 2018 -0600
add tenants structs
---
lib/go-tc/tenants.go | 62 +++++++++++++++++++++++++++++++++-------------------
1 file changed, 39 insertions(+), 23 deletions(-)
diff --git a/lib/go-tc/tenants.go b/lib/go-tc/tenants.go
index 232d617..c53e707 100644
--- a/lib/go-tc/tenants.go
+++ b/lib/go-tc/tenants.go
@@ -1,24 +1,23 @@
package tc
/*
-
- Licensed 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.
-*/
-
-// GetTenantsResponse ...
-type GetTenantsResponse struct {
- Response []Tenant `json:"response"`
-}
+ * 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.
+ */
// TenantResponse ...
type TenantResponse struct {
@@ -26,13 +25,30 @@ type TenantResponse struct {
Alerts []TenantAlert `json:"alerts"`
}
+// TenantResponse ...
+type TenantsResponse struct {
+ Response []Tenant `json:"response"`
+ Alerts []TenantAlert `json:"alerts"`
+}
+
// Tenant ...
type Tenant struct {
- ID int `json:"id,omitempty"`
- Name string `json:"name,omitempty"`
- Active bool `json:"active,omitempty"`
- ParentID int `json:"parentId"`
- ParentName string `json:"parentName,omitempty"`
+ Active bool `json:"active"`
+ ID int `json:"id"`
+ LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"`
+ Name string `json:"name"`
+ ParentID int `json:"parentId"`
+ ParentName string `json:"parentName,omitempty" db:"parent_name"`
+}
+
+// TenantNullable ...
+type TenantNullable struct {
+ ID *int `json:"id" db:"id"`
+ Name *string `json:"name" db:"name"`
+ Active *bool `json:"active" db:"active"`
+ LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
+ ParentID *int `json:"parentId" db:"parent_id"`
+ ParentName *string `json:"parentName,omitempty" db:"parent_name"`
}
// DeleteTenantResponse ...