KiCad PCB EDA Suite
Loading...
Searching...
No Matches
remote_provider_models.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef REMOTE_PROVIDER_MODELS_H
21#define REMOTE_PROVIDER_MODELS_H
22
23#include <optional>
24#include <vector>
25
26#include <kicommon.h>
27#include <json_common.h>
28#include <wx/filename.h>
29#include <wx/string.h>
30
31
42
43
57
58
65
66
68{
69 wxString issuer;
73
74 static std::optional<REMOTE_PROVIDER_OAUTH_SERVER_METADATA>
75 FromJson( const nlohmann::json& aJson, bool aAllowInsecureLocalhost, wxString& aError );
76};
77
79{
80 wxString asset_type;
81 wxString name;
83 wxString target_name;
84 wxString content_type;
85 long long size_bytes = 0;
86 wxString sha256;
87 wxString download_url;
88 bool required = false;
89};
90
91
93{
94 wxString part_id;
95 wxString display_name;
96 wxString summary;
97 wxString license;
98 std::vector<REMOTE_PROVIDER_PART_ASSET> assets;
99
100 static wxFileName DefaultSchemaPath();
101
102 static std::optional<REMOTE_PROVIDER_PART_MANIFEST> FromJson( const nlohmann::json& aJson,
103 bool aAllowInsecureLocalhost, wxString& aError );
104
105 static std::optional<REMOTE_PROVIDER_PART_MANIFEST> FromJson( const nlohmann::json& aJson,
106 const wxFileName& aSchemaFile,
107 bool aAllowInsecureLocalhost, wxString& aError );
108};
109
110#endif // REMOTE_PROVIDER_MODELS_H
@ NONE
Definition eda_shape.h:69
#define KICOMMON_API
Definition kicommon.h:28
REMOTE_PROVIDER_ERROR_TYPE
REMOTE_PROVIDER_SIGNIN_STATE
REMOTE_PROVIDER_ERROR_TYPE type
static std::optional< REMOTE_PROVIDER_OAUTH_SERVER_METADATA > FromJson(const nlohmann::json &aJson, bool aAllowInsecureLocalhost, wxString &aError)
std::vector< REMOTE_PROVIDER_PART_ASSET > assets
static std::optional< REMOTE_PROVIDER_PART_MANIFEST > FromJson(const nlohmann::json &aJson, bool aAllowInsecureLocalhost, wxString &aError)