Skip to content

Commit

Permalink
[OCM-6763] Add default capability resource to SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Liran Roitman committed Mar 17, 2024
1 parent a7857be commit ab6dbd6
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 0 deletions.
44 changes: 44 additions & 0 deletions model/accounts_mgmt/v1/default_capabilities_resource.model
Original file line number Diff line number Diff line change
@@ -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
}
}
23 changes: 23 additions & 0 deletions model/accounts_mgmt/v1/default_capabilities_type.model
Original file line number Diff line number Diff line change
@@ -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
}
31 changes: 31 additions & 0 deletions model/accounts_mgmt/v1/default_capability_resource.model
Original file line number Diff line number Diff line change
@@ -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 {
}
}
22 changes: 22 additions & 0 deletions model/accounts_mgmt/v1/default_capability_type.model
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 5 additions & 0 deletions model/accounts_mgmt/v1/root_resource.model
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab6dbd6

Please sign in to comment.