Skip to content

Latest commit

 

History

History
1512 lines (958 loc) · 42 KB

PolicyAPI.md

File metadata and controls

1512 lines (958 loc) · 42 KB

\PolicyAPI

All URIs are relative to https://subdomain.okta.com

Method HTTP request Description
ActivatePolicy Post /api/v1/policies/{policyId}/lifecycle/activate Activate a Policy
ActivatePolicyRule Post /api/v1/policies/{policyId}/rules/{ruleId}/lifecycle/activate Activate a Policy Rule
ClonePolicy Post /api/v1/policies/{policyId}/clone Clone an existing Policy
CreatePolicy Post /api/v1/policies Create a Policy
CreatePolicyRule Post /api/v1/policies/{policyId}/rules Create a Policy Rule
CreatePolicySimulation Post /api/v1/policies/simulate Create a Policy Simulation
DeactivatePolicy Post /api/v1/policies/{policyId}/lifecycle/deactivate Deactivate a Policy
DeactivatePolicyRule Post /api/v1/policies/{policyId}/rules/{ruleId}/lifecycle/deactivate Deactivate a Policy Rule
DeletePolicy Delete /api/v1/policies/{policyId} Delete a Policy
DeletePolicyResourceMapping Delete /api/v1/policies/{policyId}/mappings/{mappingId} Delete a policy resource Mapping
DeletePolicyRule Delete /api/v1/policies/{policyId}/rules/{ruleId} Delete a Policy Rule
GetPolicy Get /api/v1/policies/{policyId} Retrieve a Policy
GetPolicyMapping Get /api/v1/policies/{policyId}/mappings/{mappingId} Retrieve a policy resource Mapping
GetPolicyRule Get /api/v1/policies/{policyId}/rules/{ruleId} Retrieve a Policy Rule
ListPolicies Get /api/v1/policies List all Policies
ListPolicyApps Get /api/v1/policies/{policyId}/app List all Applications mapped to a Policy
ListPolicyMappings Get /api/v1/policies/{policyId}/mappings List all resources mapped to a Policy
ListPolicyRules Get /api/v1/policies/{policyId}/rules List all Policy Rules
MapResourceToPolicy Post /api/v1/policies/{policyId}/mappings Map a resource to a Policy
ReplacePolicy Put /api/v1/policies/{policyId} Replace a Policy
ReplacePolicyRule Put /api/v1/policies/{policyId}/rules/{ruleId} Replace a Policy Rule

ActivatePolicy

ActivatePolicy(ctx, policyId).Execute()

Activate a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PolicyAPI.ActivatePolicy(context.Background(), policyId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ActivatePolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiActivatePolicyRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ActivatePolicyRule

ActivatePolicyRule(ctx, policyId, ruleId).Execute()

Activate a Policy Rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    ruleId := "ruld3hJ7jZh4fn0st0g3" // string | `id` of the Policy Rule

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PolicyAPI.ActivatePolicyRule(context.Background(), policyId, ruleId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ActivatePolicyRule``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Other Parameters

Other parameters are passed through a pointer to a apiActivatePolicyRuleRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ClonePolicy

ListPolicies200ResponseInner ClonePolicy(ctx, policyId).Execute()

Clone an existing Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.ClonePolicy(context.Background(), policyId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ClonePolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ClonePolicy`: ListPolicies200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.ClonePolicy`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiClonePolicyRequest struct via the builder pattern

Name Type Description Notes

Return type

ListPolicies200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreatePolicy

ListPolicies200ResponseInner CreatePolicy(ctx).Policy(policy).Activate(activate).Execute()

Create a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policy := openapiclient.listPolicies_200_response_inner{AccessPolicy: openapiclient.NewAccessPolicy()} // ListPolicies200ResponseInner | 
    activate := true // bool |  (optional) (default to true)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.CreatePolicy(context.Background()).Policy(policy).Activate(activate).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.CreatePolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreatePolicy`: ListPolicies200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.CreatePolicy`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreatePolicyRequest struct via the builder pattern

Name Type Description Notes
policy ListPolicies200ResponseInner
activate bool [default to true]

Return type

ListPolicies200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreatePolicyRule

ListPolicyRules200ResponseInner CreatePolicyRule(ctx, policyId).PolicyRule(policyRule).Execute()

Create a Policy Rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    policyRule := openapiclient.listPolicyRules_200_response_inner{AccessPolicyRule: openapiclient.NewAccessPolicyRule()} // ListPolicyRules200ResponseInner | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.CreatePolicyRule(context.Background(), policyId).PolicyRule(policyRule).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.CreatePolicyRule``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreatePolicyRule`: ListPolicyRules200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.CreatePolicyRule`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiCreatePolicyRuleRequest struct via the builder pattern

Name Type Description Notes

policyRule | ListPolicyRules200ResponseInner | |

Return type

ListPolicyRules200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreatePolicySimulation

[]SimulatePolicyEvaluations CreatePolicySimulation(ctx).SimulatePolicy(simulatePolicy).Expand(expand).Execute()

Create a Policy Simulation

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    simulatePolicy := []openapiclient.SimulatePolicyBody{*openapiclient.NewSimulatePolicyBody("AppInstance_example")} // []SimulatePolicyBody | 
    expand := "expand=EVALUATED&expand=RULE" // string | Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition was (not) matched. (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.CreatePolicySimulation(context.Background()).SimulatePolicy(simulatePolicy).Expand(expand).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.CreatePolicySimulation``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreatePolicySimulation`: []SimulatePolicyEvaluations
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.CreatePolicySimulation`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreatePolicySimulationRequest struct via the builder pattern

Name Type Description Notes
simulatePolicy []SimulatePolicyBody
expand string Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition was (not) matched.

Return type

[]SimulatePolicyEvaluations

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeactivatePolicy

DeactivatePolicy(ctx, policyId).Execute()

Deactivate a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PolicyAPI.DeactivatePolicy(context.Background(), policyId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.DeactivatePolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiDeactivatePolicyRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeactivatePolicyRule

DeactivatePolicyRule(ctx, policyId, ruleId).Execute()

Deactivate a Policy Rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    ruleId := "ruld3hJ7jZh4fn0st0g3" // string | `id` of the Policy Rule

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PolicyAPI.DeactivatePolicyRule(context.Background(), policyId, ruleId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.DeactivatePolicyRule``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Other Parameters

Other parameters are passed through a pointer to a apiDeactivatePolicyRuleRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeletePolicy

DeletePolicy(ctx, policyId).Execute()

Delete a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PolicyAPI.DeletePolicy(context.Background(), policyId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.DeletePolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiDeletePolicyRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeletePolicyResourceMapping

DeletePolicyResourceMapping(ctx, policyId, mappingId).Execute()

Delete a policy resource Mapping

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    mappingId := "maplr2rLjZ6NsGn1P0g3" // string | `id` of the policy resource Mapping

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PolicyAPI.DeletePolicyResourceMapping(context.Background(), policyId, mappingId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.DeletePolicyResourceMapping``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy
mappingId string `id` of the policy resource Mapping

Other Parameters

Other parameters are passed through a pointer to a apiDeletePolicyResourceMappingRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeletePolicyRule

DeletePolicyRule(ctx, policyId, ruleId).Execute()

Delete a Policy Rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    ruleId := "ruld3hJ7jZh4fn0st0g3" // string | `id` of the Policy Rule

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PolicyAPI.DeletePolicyRule(context.Background(), policyId, ruleId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.DeletePolicyRule``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Other Parameters

Other parameters are passed through a pointer to a apiDeletePolicyRuleRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPolicy

ListPolicies200ResponseInner GetPolicy(ctx, policyId).Expand(expand).Execute()

Retrieve a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    expand := "expand_example" // string |  (optional) (default to "")

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.GetPolicy(context.Background(), policyId).Expand(expand).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.GetPolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetPolicy`: ListPolicies200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.GetPolicy`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiGetPolicyRequest struct via the builder pattern

Name Type Description Notes

expand | string | | [default to ""]

Return type

ListPolicies200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPolicyMapping

PolicyMapping GetPolicyMapping(ctx, policyId, mappingId).Execute()

Retrieve a policy resource Mapping

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    mappingId := "maplr2rLjZ6NsGn1P0g3" // string | `id` of the policy resource Mapping

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.GetPolicyMapping(context.Background(), policyId, mappingId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.GetPolicyMapping``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetPolicyMapping`: PolicyMapping
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.GetPolicyMapping`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy
mappingId string `id` of the policy resource Mapping

Other Parameters

Other parameters are passed through a pointer to a apiGetPolicyMappingRequest struct via the builder pattern

Name Type Description Notes

Return type

PolicyMapping

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPolicyRule

ListPolicyRules200ResponseInner GetPolicyRule(ctx, policyId, ruleId).Execute()

Retrieve a Policy Rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    ruleId := "ruld3hJ7jZh4fn0st0g3" // string | `id` of the Policy Rule

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.GetPolicyRule(context.Background(), policyId, ruleId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.GetPolicyRule``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetPolicyRule`: ListPolicyRules200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.GetPolicyRule`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Other Parameters

Other parameters are passed through a pointer to a apiGetPolicyRuleRequest struct via the builder pattern

Name Type Description Notes

Return type

ListPolicyRules200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListPolicies

[]ListPolicies200ResponseInner ListPolicies(ctx).Type_(type_).Status(status).Expand(expand).Execute()

List all Policies

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    type_ := "type__example" // string | 
    status := "status_example" // string |  (optional)
    expand := "expand_example" // string |  (optional) (default to "")

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.ListPolicies(context.Background()).Type_(type_).Status(status).Expand(expand).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ListPolicies``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListPolicies`: []ListPolicies200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.ListPolicies`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListPoliciesRequest struct via the builder pattern

Name Type Description Notes
type_ string
status string
expand string [default to ""]

Return type

[]ListPolicies200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListPolicyApps

[]ListApplications200ResponseInner ListPolicyApps(ctx, policyId).Execute()

List all Applications mapped to a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.ListPolicyApps(context.Background(), policyId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ListPolicyApps``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListPolicyApps`: []ListApplications200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.ListPolicyApps`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiListPolicyAppsRequest struct via the builder pattern

Name Type Description Notes

Return type

[]ListApplications200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListPolicyMappings

[]PolicyMapping ListPolicyMappings(ctx, policyId).Execute()

List all resources mapped to a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.ListPolicyMappings(context.Background(), policyId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ListPolicyMappings``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListPolicyMappings`: []PolicyMapping
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.ListPolicyMappings`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiListPolicyMappingsRequest struct via the builder pattern

Name Type Description Notes

Return type

[]PolicyMapping

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListPolicyRules

[]ListPolicyRules200ResponseInner ListPolicyRules(ctx, policyId).Execute()

List all Policy Rules

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.ListPolicyRules(context.Background(), policyId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ListPolicyRules``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListPolicyRules`: []ListPolicyRules200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.ListPolicyRules`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiListPolicyRulesRequest struct via the builder pattern

Name Type Description Notes

Return type

[]ListPolicyRules200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

MapResourceToPolicy

PolicyMapping MapResourceToPolicy(ctx, policyId).PolicyMappingRequest(policyMappingRequest).Execute()

Map a resource to a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    policyMappingRequest := *openapiclient.NewPolicyMappingRequest() // PolicyMappingRequest | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.MapResourceToPolicy(context.Background(), policyId).PolicyMappingRequest(policyMappingRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.MapResourceToPolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `MapResourceToPolicy`: PolicyMapping
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.MapResourceToPolicy`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiMapResourceToPolicyRequest struct via the builder pattern

Name Type Description Notes

policyMappingRequest | PolicyMappingRequest | |

Return type

PolicyMapping

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ReplacePolicy

ListPolicies200ResponseInner ReplacePolicy(ctx, policyId).Policy(policy).Execute()

Replace a Policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    policy := openapiclient.listPolicies_200_response_inner{AccessPolicy: openapiclient.NewAccessPolicy()} // ListPolicies200ResponseInner | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.ReplacePolicy(context.Background(), policyId).Policy(policy).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ReplacePolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ReplacePolicy`: ListPolicies200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.ReplacePolicy`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy

Other Parameters

Other parameters are passed through a pointer to a apiReplacePolicyRequest struct via the builder pattern

Name Type Description Notes

policy | ListPolicies200ResponseInner | |

Return type

ListPolicies200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ReplacePolicyRule

ListPolicyRules200ResponseInner ReplacePolicyRule(ctx, policyId, ruleId).PolicyRule(policyRule).Execute()

Replace a Policy Rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    policyId := "00plrilJ7jZ66Gn0X0g3" // string | `id` of the Policy
    ruleId := "ruld3hJ7jZh4fn0st0g3" // string | `id` of the Policy Rule
    policyRule := openapiclient.listPolicyRules_200_response_inner{AccessPolicyRule: openapiclient.NewAccessPolicyRule()} // ListPolicyRules200ResponseInner | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PolicyAPI.ReplacePolicyRule(context.Background(), policyId, ruleId).PolicyRule(policyRule).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PolicyAPI.ReplacePolicyRule``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ReplacePolicyRule`: ListPolicyRules200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `PolicyAPI.ReplacePolicyRule`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Other Parameters

Other parameters are passed through a pointer to a apiReplacePolicyRuleRequest struct via the builder pattern

Name Type Description Notes

policyRule | ListPolicyRules200ResponseInner | |

Return type

ListPolicyRules200ResponseInner

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]