sfgboxapi

<back to all web services

ZonesAdd

Requires Authentication
The following routes are available for this service:
POST/zones
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ZonesAddResponse:
    tenants_id: int = 0
    name: Optional[str] = None
    is_main: bool = False
    is_default: bool = False
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ZonesAdd:
    # @Validate(Validator="NotNull")
    tenants_id: int = 0

    # @Validate(Validator="NotNull")
    name: Optional[str] = None

    # @Validate(Validator="NotNull")
    is_main: bool = False

    # @Validate(Validator="NotNull")
    is_default: bool = False

Python ZonesAdd DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /zones HTTP/1.1 
Host: api.sfgtec.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	tenantsId: 0,
	name: String,
	isMain: False,
	isDefault: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	tenantsId: 0,
	name: String,
	isMain: False,
	isDefault: False,
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}