ns1-go.v2: gopkg.in/ns1/ns1-go.v2/rest/model/account Index | Files

package account

import "gopkg.in/ns1/ns1-go.v2/rest/model/account"

Package account contains definitions for NS1 apikeys/teams/users/etc.

Index

Package Files

apikey.go doc.go permissions.go settings.go team.go user.go warning.go

type APIKey Uses

type APIKey struct {
    // Read-only fields
    ID         string `json:"id,omitempty"`
    Key        string `json:"key,omitempty"`
    LastAccess int    `json:"last_access,omitempty"`

    Name              string         `json:"name"`
    TeamIDs           []string       `json:"teams"`
    Permissions       PermissionsMap `json:"permissions"`
    IPWhitelist       []string       `json:"ip_whitelist"`
    IPWhitelistStrict bool           `json:"ip_whitelist_strict"`
}

APIKey wraps an NS1 /account/apikeys resource

type Address Uses

type Address struct {
    Country string `json:"country,omitempty"`
    Street  string `json:"street,omitempty"`
    State   string `json:"state,omitempty"`
    City    string `json:"city,omitempty"`
    Postal  string `json:"postalcode,omitempty"`
}

Address for Setting struct.

type IDP Uses

type IDP struct {
    UseMetadataURL *bool   `json:"use_metadata_url"`
    MetadataURL    *string `json:"metadata_url"`
    MetadataFile   *string `json:"metadata_file"`
    Provider       *string `json:"provider"`
}

IDP wraps the IDP object in SAML.

type IPWhitelist Uses

type IPWhitelist struct {
    ID     string   `json:"id,omitempty"`
    Name   string   `json:"name"`
    Values []string `json:"values"`
}

IPWhitelist wraps the IP whitelist for Teams.

type NotificationSettings Uses

type NotificationSettings struct {
    Billing bool `json:"billing"`
}

NotificationSettings wraps a User's "notify" attribute

type PermissionsAccount Uses

type PermissionsAccount struct {
    ManageUsers           bool `json:"manage_users"`
    ManagePaymentMethods  bool `json:"manage_payment_methods"`
    ManagePlan            bool `json:"manage_plan"`
    ManageTeams           bool `json:"manage_teams"`
    ManageApikeys         bool `json:"manage_apikeys"`
    ManageAccountSettings bool `json:"manage_account_settings"`
    ViewActivityLog       bool `json:"view_activity_log"`
    ViewInvoices          bool `json:"view_invoices"`
}

PermissionsAccount wraps a User's "permissions.account" attribute

type PermissionsDHCP Uses

type PermissionsDHCP struct {
    ManageDHCP bool `json:"manage_dhcp"`
    ViewDHCP   bool `json:"view_dhcp"`
}

PermissionsDHCP wraps a User's "permissions.dhcp" attribute for DDI.

type PermissionsDNS Uses

type PermissionsDNS struct {
    ViewZones           bool     `json:"view_zones"`
    ManageZones         bool     `json:"manage_zones"`
    ZonesAllowByDefault bool     `json:"zones_allow_by_default"`
    ZonesDeny           []string `json:"zones_deny"`
    ZonesAllow          []string `json:"zones_allow"`
}

PermissionsDNS wraps a User's "permissions.dns" attribute

type PermissionsData Uses

type PermissionsData struct {
    PushToDatafeeds   bool `json:"push_to_datafeeds"`
    ManageDatasources bool `json:"manage_datasources"`
    ManageDatafeeds   bool `json:"manage_datafeeds"`
}

PermissionsData wraps a User's "permissions.data" attribute

type PermissionsIPAM Uses

type PermissionsIPAM struct {
    ManageIPAM bool `json:"manage_ipam"`
    ViewIPAM   bool `json:"view_ipam"`
}

PermissionsIPAM wraps a User's "permissions.ipam" attribute for DDI.

type PermissionsMap Uses

type PermissionsMap struct {
    DNS        PermissionsDNS        `json:"dns"`
    Data       PermissionsData       `json:"data"`
    Account    PermissionsAccount    `json:"account"`
    Monitoring PermissionsMonitoring `json:"monitoring"`
    Security   *PermissionsSecurity  `json:"security,omitempty"`

    // DHCP and IPAM are only relevant for DDI and should not be provided in managed.
    DHCP *PermissionsDHCP `json:"dhcp,omitempty"`
    IPAM *PermissionsIPAM `json:"ipam,omitempty"`
}

PermissionsMap wraps a User's "permissions" attribute

type PermissionsMonitoring Uses

type PermissionsMonitoring struct {
    ManageLists bool `json:"manage_lists"`
    ManageJobs  bool `json:"manage_jobs"`
    ViewJobs    bool `json:"view_jobs"`
}

PermissionsMonitoring wraps a User's "permissions.monitoring" attribute Only relevant for the managed product.

type PermissionsSecurity Uses

type PermissionsSecurity struct {
    ManageGlobal2FA bool `json:"manage_global_2fa"`

    // This field is only relevant for DDI and should not be set to true for managed.
    ManageActiveDirectory bool `json:"manage_active_directory,omitempty"`
}

PermissionsSecurity wraps a User's "permissions.security" attribute.

type SAML Uses

type SAML struct {
    SSO bool `json:"sso"`
    IDP `json:"idp"`
}

SAML wraps the SAML object in SharedAuth.

type Setting Uses

type Setting struct {
    CustomerID int     `json:"customerid,omitempty"`
    FirstName  string  `json:"firstname,omitempty"`
    LastName   string  `json:"lastname,omitempty"`
    Company    string  `json:"company,omitempty"`
    Phone      string  `json:"phone,omitempty"`
    Email      string  `json:"email,omitempty"`
    Address    Address `json:"address,omitempty"`
}

Setting represents an accounts' contact info.

type SharedAuth Uses

type SharedAuth struct {
    SAML `json:"saml"`
}

SharedAuth wraps the shared auth object on a User.

type Team Uses

type Team struct {
    ID          string         `json:"id,omitempty"`
    Name        string         `json:"name"`
    Permissions PermissionsMap `json:"permissions"`
    IPWhitelist []IPWhitelist  `json:"ip_whitelist"`
}

Team wraps an NS1 /accounts/teams resource

type UsageWarning Uses

type UsageWarning struct {
    Records Warning `json:"records"`
    Queries Warning `json:"queries"`
}

UsageWarning wraps an NS1 /account/usagewarnings resource

type User Uses

type User struct {
    // Read-only fields
    LastAccess float64 `json:"last_access"`
    Created    float64 `json:"created"`

    Name                 string               `json:"name"`
    Username             string               `json:"username"`
    Email                string               `json:"email"`
    TeamIDs              []string             `json:"teams"`
    Notify               NotificationSettings `json:"notify"`
    Permissions          PermissionsMap       `json:"permissions"`
    IPWhitelist          []string             `json:"ip_whitelist"`
    IPWhitelistStrict    bool                 `json:"ip_whitelist_strict"`
    TwoFactorAuthEnabled bool                 `json:"2fa_enabled"`
    InviteToken          string               `json:"invite_token,omitempty"`
    SharedAuth           `json:"shared_auth"`
}

User wraps an NS1 /account/users resource

type Warning Uses

type Warning struct {
    Send bool `json:"send_warnings"`

    First  int `json:"warning_1"`
    Second int `json:"warning_2"`
}

Warning contains alerting toggles and thresholds for overage warning alert messages. First thresholds must be smaller than Second ones and all thresholds must be percentages between 0 and 100.

Package account is imported by 12 packages. Updated 2020-07-06. Refresh now. Tools for package owners.