From ab6dbd67f618f1871a6233f7211cecb6a6d9e3d9 Mon Sep 17 00:00:00 2001 From: Liran Roitman Date: Sun, 17 Mar 2024 14:33:57 +0200 Subject: [PATCH] [OCM-6763] Add default capability resource to SDK --- .../v1/default_capabilities_resource.model | 44 +++++++++++++++++++ .../v1/default_capabilities_type.model | 23 ++++++++++ .../v1/default_capability_resource.model | 31 +++++++++++++ .../v1/default_capability_type.model | 22 ++++++++++ model/accounts_mgmt/v1/root_resource.model | 5 +++ 5 files changed, 125 insertions(+) create mode 100644 model/accounts_mgmt/v1/default_capabilities_resource.model create mode 100644 model/accounts_mgmt/v1/default_capabilities_type.model create mode 100644 model/accounts_mgmt/v1/default_capability_resource.model create mode 100644 model/accounts_mgmt/v1/default_capability_type.model diff --git a/model/accounts_mgmt/v1/default_capabilities_resource.model b/model/accounts_mgmt/v1/default_capabilities_resource.model new file mode 100644 index 00000000..49fd1015 --- /dev/null +++ b/model/accounts_mgmt/v1/default_capabilities_resource.model @@ -0,0 +1,44 @@ +resource DefaultCapabilities{ + // Retrieves a list of Dedfault Capabilities. + method List { + // Index of the requested page, where one corresponds to the first page. + in out Page Integer = 1 + + // Maximum number of items that will be contained in the returned page. + in out Size Integer = 100 + + // Total number of items of the collection that match the search criteria, + // regardless of the size of the page. + out Total Integer + + // Search criteria. + // + // The syntax of this parameter is similar to the syntax of the _where_ clause + // of an SQL statement, but using the names of the attributes of the organization + // instead of the names of the columns of a table. For example, in order to + // retrieve organizations with name starting with my: + // + // ```sql + // name like 'my%' + // ``` + // + // If the parameter isn't provided, or if the value is empty, then all the + // items that the user has permission to see will be returned. + in Search String + + // Retrieved list of Default Capabilities. + out Items []DefaultCapability + } + + // Creates a new default capability. + method Add { + // Default capability data. + in out Body DefaultCapability + } + + // Reference to the service that manages an specific default capability. + locator DefaultCapability { + target DefaultCapability + variable Name + } +} \ No newline at end of file diff --git a/model/accounts_mgmt/v1/default_capabilities_type.model b/model/accounts_mgmt/v1/default_capabilities_type.model new file mode 100644 index 00000000..6ca55d10 --- /dev/null +++ b/model/accounts_mgmt/v1/default_capabilities_type.model @@ -0,0 +1,23 @@ +/* +Copyright (c) 2024 Red Hat, Inc. + +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. +*/ + +// Default Capability model that represents default internal labels with a key-value pair. +struct DefaultCapabilities { + // Name of the capability label. + Name String + // Value that can be assigned to the capability (eg. "true", "false" etc). + Value String +} diff --git a/model/accounts_mgmt/v1/default_capability_resource.model b/model/accounts_mgmt/v1/default_capability_resource.model new file mode 100644 index 00000000..28d1d5d1 --- /dev/null +++ b/model/accounts_mgmt/v1/default_capability_resource.model @@ -0,0 +1,31 @@ +/* +Copyright (c) 2024 Red Hat, Inc. + +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. +*/ + +// Manages a specific default capability. +resource DefaultCapability { + // Retrieves the details of the default capability. + method Get { + out Body DefaultCapability + } + + // Updates the default capability. + method Update { + in out Body DefaultCapability + } + + method Delete { + } +} diff --git a/model/accounts_mgmt/v1/default_capability_type.model b/model/accounts_mgmt/v1/default_capability_type.model new file mode 100644 index 00000000..cdc4c30d --- /dev/null +++ b/model/accounts_mgmt/v1/default_capability_type.model @@ -0,0 +1,22 @@ +/* +Copyright (c) 2024 Red Hat, Inc. + +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. +*/ + +class DefaultCapability { + // Name of the default capability (the key). + Name String + // Value of the default capability. + Value String +} diff --git a/model/accounts_mgmt/v1/root_resource.model b/model/accounts_mgmt/v1/root_resource.model index 25f83926..1738eeab 100644 --- a/model/accounts_mgmt/v1/root_resource.model +++ b/model/accounts_mgmt/v1/root_resource.model @@ -139,6 +139,11 @@ resource Root { target Capabilities } + // Reference to the resource that manages the collection of default capabilities. + locator DefaultCapabilities { + target DefaultCapabilities + } + // Reference to the resource that manages the collection of deleted subscriptions. locator DeletedSubscriptions { target DeletedSubscriptions