Create User Service Handler and SDK (#106)

* Create user handler stuff.

* Fixing Not Found errors from DB.

* Fixing param names.

* Update the proto's go package generation.

* Generate the user resource.

* Adding SDK methods for users.

* Fix the base type of Users and add tests.

* Connect user service to the controller handler.

* Attach the default org to the Test Controller's client.

* Take into account the provided request paths when the client builds the org/project path prefix.

* Adding comments to the API.

* rename repo function to repoFn.

* Fix typo in update mask errors.

* Clean up tests.

* Remove special checks for request url content in the api client and fix CORS test.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-06-09 11:20:59 -07:00
1 parent 2c3fbe3024
commit df6ca5289f
25 files changed
+3845 -9

No files matched your search

+248
View File
@@ -1569,6 +1569,171 @@
"controller.api.services.v1.HostCatalogService"
]
}
},
"/v1/orgs/{org_id}/users": {
"get": {
"summary": "Lists all Users",
"operationId": "UserService_ListUsers",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/controller.api.services.v1.ListUsersResponse"
}
}
},
"parameters": [
{
"name": "org_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "view",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"controller.api.services.v1.UserService"
]
},
"post": {
"summary": "Creates a single User",
"operationId": "UserService_CreateUser",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
},
"parameters": [
{
"name": "org_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
],
"tags": [
"controller.api.services.v1.UserService"
]
}
},
"/v1/orgs/{org_id}/users/{id}": {
"get": {
"summary": "Gets a single User",
"operationId": "UserService_GetUser",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
},
"parameters": [
{
"name": "org_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "view",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"controller.api.services.v1.UserService"
]
},
"delete": {
"summary": "Deletes a User",
"operationId": "UserService_DeleteUser",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/controller.api.services.v1.DeleteUserResponse"
}
}
},
"parameters": [
{
"name": "org_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"controller.api.services.v1.UserService"
]
},
"patch": {
"summary": "Updates a User",
"operationId": "UserService_UpdateUser",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
},
"parameters": [
{
"name": "org_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
],
"tags": [
"controller.api.services.v1.UserService"
]
}
}
},
"definitions": {
@@ -1750,6 +1915,42 @@
},
"title": "Project contains all fields related to a Project resource"
},
"controller.api.resources.users.v1.User": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the Project\nOutput only.",
"readOnly": true
},
"name": {
"type": "string",
"title": "Optional name for identification purposes"
},
"description": {
"type": "string",
"title": "Optional user-set descripton for identification purposes"
},
"created_time": {
"type": "string",
"format": "date-time",
"description": "The time this resource was created\nOutput only.",
"readOnly": true
},
"updated_time": {
"type": "string",
"format": "date-time",
"description": "The time this resource was last updated.\nOutput only.",
"readOnly": true
},
"disabled": {
"type": "boolean",
"format": "boolean",
"title": "Whether the resource is disabled"
}
},
"title": "User contains all fields related to a User resource"
},
"controller.api.services.v1.AddToHostSetResponse": {
"type": "object"
},
@@ -1797,6 +1998,17 @@
}
}
},
"controller.api.services.v1.CreateUserResponse": {
"type": "object",
"properties": {
"uri": {
"type": "string"
},
"item": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
},
"controller.api.services.v1.DeleteHostCatalogResponse": {
"type": "object",
"properties": {
@@ -1833,6 +2045,15 @@
}
}
},
"controller.api.services.v1.DeleteUserResponse": {
"type": "object",
"properties": {
"existed": {
"type": "boolean",
"format": "boolean"
}
}
},
"controller.api.services.v1.GetHostCatalogResponse": {
"type": "object",
"properties": {
@@ -1865,6 +2086,14 @@
}
}
},
"controller.api.services.v1.GetUserResponse": {
"type": "object",
"properties": {
"item": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
},
"controller.api.services.v1.ListHostCatalogsResponse": {
"type": "object",
"properties": {
@@ -1909,6 +2138,17 @@
}
}
},
"controller.api.services.v1.ListUsersResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
}
},
"controller.api.services.v1.RemoveFromHostSetResponse": {
"type": "object"
},
@@ -1944,6 +2184,14 @@
}
}
},
"controller.api.services.v1.UpdateUserResponse": {
"type": "object",
"properties": {
"item": {
"$ref": "#/definitions/controller.api.resources.users.v1.User"
}
}
},
"google.protobuf.FieldMask": {
"type": "object",
"properties": {