github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/networking/v2/extensions/rbacpolicies/testing/fixtures.go (about)

     1  package testing
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/rbacpolicies"
     5  )
     6  
     7  const ListResponse = `
     8  {
     9  	"rbac_policies": [
    10  		{
    11  			"target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
    12  			"tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    13  			"object_type": "network",
    14  			"object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
    15  			"action": "access_as_shared",
    16  			"project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    17  			"id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
    18  		},
    19  		{
    20  			"target_tenant": "1a547a3bcfe44702889fdeff3c3520c3",
    21  			"tenant_id": "1ae27ce0a2a54cc6ae06dc62dd0ec832",
    22  			"object_type": "network",
    23  			"object_id": "120d22bf-bd17-4238-9758-25f72610ecdc",
    24  			"action": "access_as_shared",
    25  			"project_id": "1ae27ce0a2a54cc6ae06dc62dd0ec832",
    26  			"id":"1ab7523a-93b5-4e69-9360-6c6bf986bb7c"
    27  		}
    28  	]
    29  }`
    30  
    31  // CreateRequest is the structure of request body to create rbac-policy.
    32  const CreateRequest = `
    33  {
    34      "rbac_policy": {
    35          "action": "access_as_shared",
    36          "object_type": "network",
    37          "target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
    38          "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc"
    39      }
    40  }`
    41  
    42  // CreateResponse is the structure of response body of rbac-policy create.
    43  const CreateResponse = `
    44  {
    45      "rbac_policy": {
    46          "target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
    47          "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    48          "object_type": "network",
    49          "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
    50          "action": "access_as_shared",
    51          "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    52          "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
    53      }
    54  }`
    55  
    56  // GetResponse is the structure of the response body of rbac-policy get operation.
    57  const GetResponse = `
    58  {
    59      "rbac_policy": {
    60                          "target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
    61                          "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    62                          "object_type": "network",
    63                          "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
    64                          "action": "access_as_shared",
    65                          "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    66                          "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
    67          }
    68  }`
    69  
    70  // UpdateRequest is the structure of request body to update rbac-policy.
    71  const UpdateRequest = `
    72  {
    73      "rbac_policy": {
    74          "target_tenant": "9d766060b6354c9e8e2da44cab0e8f38"
    75      }
    76  }`
    77  
    78  // UpdateResponse is the structure of response body of rbac-policy update.
    79  const UpdateResponse = `
    80  {
    81      "rbac_policy": {
    82          "target_tenant": "9d766060b6354c9e8e2da44cab0e8f38",
    83          "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    84          "object_type": "network",
    85          "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
    86          "action": "access_as_shared",
    87          "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
    88          "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
    89      }
    90  }`
    91  
    92  var rbacPolicy1 = rbacpolicies.RBACPolicy{
    93  	ID:           "2cf7523a-93b5-4e69-9360-6c6bf986bb7c",
    94  	Action:       rbacpolicies.ActionAccessShared,
    95  	ObjectID:     "240d22bf-bd17-4238-9758-25f72610ecdc",
    96  	ObjectType:   "network",
    97  	TenantID:     "3de27ce0a2a54cc6ae06dc62dd0ec832",
    98  	TargetTenant: "6e547a3bcfe44702889fdeff3c3520c3",
    99  	ProjectID:    "3de27ce0a2a54cc6ae06dc62dd0ec832",
   100  }
   101  
   102  var rbacPolicy2 = rbacpolicies.RBACPolicy{
   103  	ID:           "1ab7523a-93b5-4e69-9360-6c6bf986bb7c",
   104  	Action:       rbacpolicies.ActionAccessShared,
   105  	ObjectID:     "120d22bf-bd17-4238-9758-25f72610ecdc",
   106  	ObjectType:   "network",
   107  	TenantID:     "1ae27ce0a2a54cc6ae06dc62dd0ec832",
   108  	TargetTenant: "1a547a3bcfe44702889fdeff3c3520c3",
   109  	ProjectID:    "1ae27ce0a2a54cc6ae06dc62dd0ec832",
   110  }
   111  
   112  var ExpectedRBACPoliciesSlice = []rbacpolicies.RBACPolicy{rbacPolicy1, rbacPolicy2}