mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The projection these were generated from was a month old and predated the compute migration, so every one of them described /v1/visor — which the API serves at zero paths now. That is why a hand-written console client and a generated one had drifted the same way at the same time. No /v1/visor path survives here. The word still appears as a source-plane value and inside gvisor and supervisor, which are not this rename.
119 lines
4.0 KiB
C++
119 lines
4.0 KiB
C++
/**
|
|
* Hanzo Cloud API
|
|
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
*
|
|
* The version of the OpenAPI document: v1
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
/*
|
|
* PairingView.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_PairingView_H_
|
|
#define HANZO_MODEL_PairingView_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include <cpprest/details/basic_types.h>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
|
|
|
|
class PairingView
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
PairingView();
|
|
virtual ~PairingView();
|
|
|
|
/////////////////////////////////////////////
|
|
/// ModelBase overrides
|
|
|
|
void validate() override;
|
|
|
|
web::json::value toJson() const override;
|
|
bool fromJson(const web::json::value& json) override;
|
|
|
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// PairingView members
|
|
|
|
|
|
/// <summary>
|
|
/// Channel is the transport the request arrived on — discord, slack, teams or telegram — and half of what approval names. The cap of three unapproved requests applies per (org, channel); while it is full no further code is minted until one is approved or expires.
|
|
/// </summary>
|
|
utility::string_t getChannel() const;
|
|
bool channelIsSet() const;
|
|
void unsetChannel();
|
|
void setChannel(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Code is the CAPABILITY that authorises the approval: eight characters from a 32-symbol uppercase alphabet (A-Z0-9 minus the confusables 0, O, 1 and I), minted with crypto/rand and also sent to the requester in chat. An org admin passes it with the channel to POST /v1/channel/pairing/approve, which CONSUMES it — the request row is deleted, so a code approves once — and which takes org admin as well as the code. It lives ONE HOUR from CreatedAt; expired requests are not listed here, and approving one is a 404. It is shown on this admin surface and NEVER logged.
|
|
/// </summary>
|
|
utility::string_t getCode() const;
|
|
bool codeIsSet() const;
|
|
void unsetCode();
|
|
void setCode(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// CreatedAt is Unix SECONDS of FIRST contact: when the request was minted and the code sent. Expiry is measured from here and from nowhere else.
|
|
/// </summary>
|
|
int64_t getCreatedAt() const;
|
|
bool createdAtIsSet() const;
|
|
void unsetCreatedAt();
|
|
void setCreatedAt(int64_t value);
|
|
|
|
/// <summary>
|
|
/// LastSeen is Unix SECONDS of the MOST RECENT message from this sender while the request has been pending. It moves as they keep writing, which is how an admin tells a live request from an abandoned one — but it does not extend the hour and does not re-send the code, since one request sends exactly one chat reply.
|
|
/// </summary>
|
|
int64_t getLastSeen() const;
|
|
bool lastSeenIsSet() const;
|
|
void unsetLastSeen();
|
|
void setLastSeen(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Sender is the transport-native user id waiting for access — the same identity inbox messages carry. Approving mints a DM allow entry for exactly this value and nothing wider: pairing never grants group access.
|
|
/// </summary>
|
|
utility::string_t getSender() const;
|
|
bool senderIsSet() const;
|
|
void unsetSender();
|
|
void setSender(const utility::string_t& value);
|
|
|
|
|
|
protected:
|
|
utility::string_t m_Channel;
|
|
bool m_ChannelIsSet;
|
|
|
|
utility::string_t m_Code;
|
|
bool m_CodeIsSet;
|
|
|
|
int64_t m_CreatedAt;
|
|
bool m_CreatedAtIsSet;
|
|
|
|
int64_t m_LastSeen;
|
|
bool m_LastSeenIsSet;
|
|
|
|
utility::string_t m_Sender;
|
|
bool m_SenderIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_PairingView_H_ */
|