grafbase_sdk/types/
authentication.rs1use crate::{types::Headers, wit};
2
3#[non_exhaustive]
5pub struct PublicMetadataEndpoint {
6 path: String,
8 response_body: Vec<u8>,
10 response_headers: Headers,
12}
13
14impl PublicMetadataEndpoint {
15 pub fn new(path: String, response_body: Vec<u8>) -> Self {
17 PublicMetadataEndpoint {
18 path,
19 response_body,
20 response_headers: Default::default(),
21 }
22 }
23
24 pub fn with_headers(mut self, response_headers: Headers) -> Self {
26 self.response_headers = response_headers;
27 self
28 }
29
30 pub fn response_headers_mut(&mut self) -> &mut Headers {
32 &mut self.response_headers
33 }
34}
35
36impl From<wit::PublicMetadataEndpoint> for PublicMetadataEndpoint {
37 fn from(
38 wit::PublicMetadataEndpoint {
39 path,
40 response_body,
41 response_headers,
42 }: wit::PublicMetadataEndpoint,
43 ) -> Self {
44 PublicMetadataEndpoint {
45 path,
46 response_body,
47 response_headers: response_headers.into(),
48 }
49 }
50}
51
52impl From<PublicMetadataEndpoint> for wit::PublicMetadataEndpoint {
53 fn from(
54 PublicMetadataEndpoint {
55 path,
56 response_body,
57 response_headers,
58 }: PublicMetadataEndpoint,
59 ) -> Self {
60 wit::PublicMetadataEndpoint {
61 path,
62 response_body,
63 response_headers: response_headers.into(),
64 }
65 }
66}