Portal

<back to all web services

BrowseSupplierAllUser

The following routes are available for this service:
GET/supplier/{supplierid}/user
import Foundation
import ServiceStack

public class BrowseSupplierAllUser : IGet, Codable
{
    public var supplierId:Int

    required public init(){}
}

public class BrowseSupplierAllUserResponse : ResponseBase
{
    public var users:[UserSimple] = []

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case users
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        users = try container.decodeIfPresent([UserSimple].self, forKey: .users) ?? []
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if users.count > 0 { try container.encode(users, forKey: .users) }
    }
}

public class ResponseBase : Codable
{
    public var responseStatus:ResponseStatus

    required public init(){}
}

public class UserSimple : Codable
{
    public var id:Int
    public var email:String
    public var displayName:String
    public var mobilePhoneNumber:String
    public var mobilePhoneNumberCountryCode:String
    public var phoneNumber:String
    public var phoneNumberCountryCode:String
    public var phoneNumberExtension:String
    public var organizationUnit:String
    public var position:String
    public var role:String
    public var status:ApplicationUserStatus

    required public init(){}
}

public enum ApplicationUserStatus : Int, Codable
{
    case Registered = 0
    case ConfirmedByUser = 1
    case SupplierUserRegistered = 2
    case AwaitingSupplierConfirmation = 3
    case AwaitingVeoliaConfirmation = 4
    case Active = 5
    case Rejected = 6
    case Deleted = 7
}


Swift BrowseSupplierAllUser 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.

GET /supplier/{supplierid}/user HTTP/1.1 
Host: szallitoiportal-be.veolia.hu 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Users: 
	[
		{
			Id: 0,
			Email: String,
			DisplayName: String,
			MobilePhoneNumber: String,
			MobilePhoneNumberCountryCode: String,
			PhoneNumber: String,
			PhoneNumberCountryCode: String,
			PhoneNumberExtension: String,
			OrganizationUnit: String,
			Position: String,
			Role: String,
			Status: 0
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}