github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/identity/v3/agency/urls.go (about) 1 package agency 2 3 import "github.com/chnsz/golangsdk" 4 5 const ( 6 rootPath = "OS-AGENCY" 7 resourcePath = "agencies" 8 ) 9 10 func rootURL(c *golangsdk.ServiceClient) string { 11 return c.ServiceURL(rootPath, resourcePath) 12 } 13 14 func resourceURL(c *golangsdk.ServiceClient, id string) string { 15 return c.ServiceURL(rootPath, resourcePath, id) 16 } 17 18 func roleURL(c *golangsdk.ServiceClient, resource, resourceID, agencyID, roleID string) string { 19 return c.ServiceURL(rootPath, resource, resourceID, resourcePath, agencyID, "roles", roleID) 20 } 21 22 func listRolesURL(c *golangsdk.ServiceClient, resource, resourceID, agencyID string) string { 23 return c.ServiceURL(rootPath, resource, resourceID, resourcePath, agencyID, "roles") 24 } 25 26 func inheritedURL(client *golangsdk.ServiceClient, domainID, agencyID, roleID string) string { 27 return client.ServiceURL("OS-INHERIT", "domains", domainID, resourcePath, agencyID, 28 "roles", roleID, "inherited_to_projects") 29 } 30 31 func listInheritedURL(client *golangsdk.ServiceClient, domainID, agencyID string) string { 32 return client.ServiceURL("OS-INHERIT", "domains", domainID, resourcePath, agencyID, "roles", "inherited_to_projects") 33 }