How to use the okta.models.policy.Policy function in okta

To help you get started, we’ve selected a few okta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github okta / okta-sdk-python / okta / resource_clients / policy_client.py View on Github external
request, error = await self._request_executor.create_request(
            http_method, api_url, body, headers
        )

        if error:
            return (None, None, error)

        response, error = await self._request_executor\
            .execute(request, Policy)

        if error:
            return (None, response, error)

        try:
            result = Policy(
                response.get_body()
            )
        except Exception as error:
            return (None, response, error)
        return (result, response, None)
github okta / okta-sdk-python / okta / models / o_auth_authorization_policy.py View on Github external
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.
"""

# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION

from okta.models.policy\
    import Policy


class OAuthAuthorizationPolicy(
    Policy
):
    """
    A class for OAuthAuthorizationPolicy objects.
    """

    def __init__(self, config=None):
        super().__init__(config)
        pass

    def request_format(self):
        parent_req_format = super().request_format()
        current_obj_format = {
        }
        parent_req_format.update(current_obj_format)
        return parent_req_format
github okta / okta-sdk-python / okta / resource_clients / policy_client.py View on Github external
http_method, api_url, body, headers
        )

        if error:
            return (None, None, error)

        response, error = await self._request_executor\
            .execute(request, Policy)

        if error:
            return (None, response, error)

        try:
            result = []
            for item in response.get_body():
                result.append(Policy(item))
        except Exception as error:
            return (None, response, error)
        return (result, response, None)
github okta / okta-sdk-python / okta / resource_clients / policy_client.py View on Github external
request, error = await self._request_executor.create_request(
            http_method, api_url, body, headers
        )

        if error:
            return (None, None, error)

        response, error = await self._request_executor\
            .execute(request, Policy)

        if error:
            return (None, response, error)

        try:
            result = Policy(
                response.get_body()
            )
        except Exception as error:
            return (None, response, error)
        return (result, response, None)
github okta / okta-sdk-python / okta / models / password_policy.py View on Github external
limitations under the License.
"""

# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION

from okta.models.policy\
    import Policy
from okta.models.password_policy_conditions\
    import PasswordPolicyConditions
from okta.models.password_policy_settings\
    import PasswordPolicySettings


class PasswordPolicy(
    Policy
):
    """
    A class for PasswordPolicy objects.
    """

    def __init__(self, config=None):
        super().__init__(config)
        if config:
            if "conditions" in config:
                if isinstance(config["conditions"],
                              PasswordPolicyConditions):
                    self.conditions = config["conditions"]
                else:
                    self.conditions = PasswordPolicyConditions(
                        config["conditions"]
                    )
github okta / okta-sdk-python / okta / resource_clients / authorization_server_client.py View on Github external
http_method, api_url, body, headers
        )

        if error:
            return (None, None, error)

        response, error = await self._request_executor\
            .execute(request, Policy)

        if error:
            return (None, response, error)

        try:
            result = []
            for item in response.get_body():
                result.append(Policy(item))
        except Exception as error:
            return (None, response, error)
        return (result, response, None)
github okta / okta-sdk-python / okta / resource_clients / authorization_server_client.py View on Github external
/api/v1/authorizationServers/{authServerId}
                /policies
            """)

        body = {}
        headers = {}

        request, error = await self._request_executor.create_request(
            http_method, api_url, body, headers
        )

        if error:
            return (None, None, error)

        response, error = await self._request_executor\
            .execute(request, Policy)

        if error:
            return (None, response, error)

        try:
            result = []
            for item in response.get_body():
                result.append(Policy(item))
        except Exception as error:
            return (None, response, error)
        return (result, response, None)
github okta / okta-sdk-python / okta / models / okta_sign_on_policy.py View on Github external
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.
"""

# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION

from okta.models.policy\
    import Policy
from okta.models.okta_sign_on_policy_conditions\
    import OktaSignOnPolicyConditions


class OktaSignOnPolicy(
    Policy
):
    """
    A class for OktaSignOnPolicy objects.
    """

    def __init__(self, config=None):
        super().__init__(config)
        if config:
            if "conditions" in config:
                if isinstance(config["conditions"],
                              OktaSignOnPolicyConditions):
                    self.conditions = config["conditions"]
                else:
                    self.conditions = OktaSignOnPolicyConditions(
                        config["conditions"]
                    )
github okta / okta-sdk-python / okta / models / identity_provider_policy.py View on Github external
# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION

from okta.models.policy\
    import Policy
from okta.models.policy_account_link\
    import PolicyAccountLink
from okta.models.provisioning\
    import Provisioning
from okta.models.policy_subject\
    import PolicySubject


class IdentityProviderPolicy(
    Policy
):
    """
    A class for IdentityProviderPolicy objects.
    """

    def __init__(self, config=None):
        super().__init__(config)
        if config:
            if "accountLink" in config:
                if isinstance(config["accountLink"],
                              PolicyAccountLink):
                    self.account_link = config["accountLink"]
                else:
                    self.account_link = PolicyAccountLink(
                        config["accountLink"]
                    )
github okta / okta-sdk-python / okta / resource_clients / authorization_server_client.py View on Github external
body = policy.as_dict()
        headers = {
            "Accept": "application/json",
            "Content-Type": "application/json"
        }

        request, error = await self._request_executor.create_request(
            http_method, api_url, body, headers
        )

        if error:
            return (None, None, error)

        response, error = await self._request_executor\
            .execute(request, Policy)

        if error:
            return (None, response, error)

        try:
            result = Policy(
                response.get_body()
            )
        except Exception as error:
            return (None, response, error)
        return (result, response, None)