1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
/// Request to verify the plugin has loaded OK
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitPluginRequest {
    /// Implementation calling the plugin
    #[prost(string, tag = "1")]
    pub implementation: ::prost::alloc::string::String,
    /// Version of the implementation
    #[prost(string, tag = "2")]
    pub version: ::prost::alloc::string::String,
}
/// Entry to be added to the core catalogue. Each entry describes one of the features the plugin provides.
/// Entries will be stored in the catalogue under the key "plugin/$name/$type/$key".
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CatalogueEntry {
    /// Entry type
    #[prost(enumeration = "catalogue_entry::EntryType", tag = "1")]
    pub r#type: i32,
    /// Entry key
    #[prost(string, tag = "2")]
    pub key: ::prost::alloc::string::String,
    /// Associated data required for the entry. For CONTENT_MATCHER and CONTENT_GENERATOR types, a "content-types"
    /// value (separated by semi-colons) is required for all the content types the plugin supports.
    #[prost(map = "string, string", tag = "3")]
    pub values:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
/// Nested message and enum types in `CatalogueEntry`.
pub mod catalogue_entry {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum EntryType {
        /// Matcher for contents of messages, requests or response bodies
        ContentMatcher = 0,
        /// Generator for contents of messages, requests or response bodies
        ContentGenerator = 1,
        /// Mock server for a network protocol
        MockServer = 2,
        /// Matching rule for content field/values
        Matcher = 3,
        /// Type of interaction
        Interaction = 4,
    }
}
/// Response to init plugin, providing the catalogue entries the plugin provides
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitPluginResponse {
    /// List of entries the plugin supports
    #[prost(message, repeated, tag = "1")]
    pub catalogue: ::prost::alloc::vec::Vec<CatalogueEntry>,
}
/// Catalogue of Core Pact + Plugin features
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Catalogue {
    /// List of entries from the core catalogue
    #[prost(message, repeated, tag = "1")]
    pub catalogue: ::prost::alloc::vec::Vec<CatalogueEntry>,
}
/// Message representing a request, response or message body
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Body {
    /// The content type of the body in MIME format (i.e. application/json)
    #[prost(string, tag = "1")]
    pub content_type: ::prost::alloc::string::String,
    /// Bytes of the actual content
    #[prost(message, optional, tag = "2")]
    pub content: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    /// Content type override to apply (if required). If omitted, the default rules of the Pact implementation
    /// will be used
    #[prost(enumeration = "body::ContentTypeHint", tag = "3")]
    pub content_type_hint: i32,
}
/// Nested message and enum types in `Body`.
pub mod body {
    /// Enum of content type override. This is a hint on how the content type should be treated.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum ContentTypeHint {
        /// Determine the form of the content using the default rules of the Pact implementation
        Default = 0,
        /// Contents must always be treated as a text form
        Text = 1,
        /// Contents must always be treated as a binary form
        Binary = 2,
    }
}
/// Request to preform a comparison on an actual body given the expected one
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompareContentsRequest {
    /// Expected body from the Pact interaction
    #[prost(message, optional, tag = "1")]
    pub expected: ::core::option::Option<Body>,
    /// Actual received body
    #[prost(message, optional, tag = "2")]
    pub actual: ::core::option::Option<Body>,
    /// If unexpected keys or attributes should be allowed. Setting this to false results in additional keys or fields
    /// will cause a mismatch
    #[prost(bool, tag = "3")]
    pub allow_unexpected_keys: bool,
    /// Map of expressions to matching rules. The expressions follow the documented Pact matching rule expressions
    #[prost(map = "string, message", tag = "4")]
    pub rules: ::std::collections::HashMap<::prost::alloc::string::String, MatchingRules>,
    /// Additional data added to the Pact/Interaction by the plugin
    #[prost(message, optional, tag = "5")]
    pub plugin_configuration: ::core::option::Option<PluginConfiguration>,
}
/// Indicates that there was a mismatch with the content type
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContentTypeMismatch {
    /// Expected content type (MIME format)
    #[prost(string, tag = "1")]
    pub expected: ::prost::alloc::string::String,
    /// Actual content type received (MIME format)
    #[prost(string, tag = "2")]
    pub actual: ::prost::alloc::string::String,
}
/// A mismatch for an particular item of content
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContentMismatch {
    /// Expected data bytes
    #[prost(message, optional, tag = "1")]
    pub expected: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    /// Actual data bytes
    #[prost(message, optional, tag = "2")]
    pub actual: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    /// Description of the mismatch
    #[prost(string, tag = "3")]
    pub mismatch: ::prost::alloc::string::String,
    /// Path to the item that was matched. This is the value as per the documented Pact matching rule expressions.
    #[prost(string, tag = "4")]
    pub path: ::prost::alloc::string::String,
    /// Optional diff of the contents
    #[prost(string, tag = "5")]
    pub diff: ::prost::alloc::string::String,
}
/// List of content mismatches
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContentMismatches {
    #[prost(message, repeated, tag = "1")]
    pub mismatches: ::prost::alloc::vec::Vec<ContentMismatch>,
}
/// Response to the CompareContentsRequest with the results of the comparison
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompareContentsResponse {
    /// Error message if an error occurred. If this field is set, the remaining fields will be ignored and the
    /// verification marked as failed
    #[prost(string, tag = "1")]
    pub error: ::prost::alloc::string::String,
    /// There was a mismatch with the types of content. If this is set, the results may not be set.
    #[prost(message, optional, tag = "2")]
    pub type_mismatch: ::core::option::Option<ContentTypeMismatch>,
    /// Results of the match, keyed by matching rule expression
    #[prost(map = "string, message", tag = "3")]
    pub results: ::std::collections::HashMap<::prost::alloc::string::String, ContentMismatches>,
}
/// Request to configure/setup an interaction so that it can be verified later
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigureInteractionRequest {
    /// Content type of the interaction (MIME format)
    #[prost(string, tag = "1")]
    pub content_type: ::prost::alloc::string::String,
    /// This is data specified by the user in the consumer test
    #[prost(message, optional, tag = "2")]
    pub contents_config: ::core::option::Option<::prost_types::Struct>,
}
/// Represents a matching rule
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchingRule {
    /// Type of the matching rule
    #[prost(string, tag = "1")]
    pub r#type: ::prost::alloc::string::String,
    /// Associated data for the matching rule
    #[prost(message, optional, tag = "2")]
    pub values: ::core::option::Option<::prost_types::Struct>,
}
/// List of matching rules
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchingRules {
    #[prost(message, repeated, tag = "1")]
    pub rule: ::prost::alloc::vec::Vec<MatchingRule>,
}
/// Example generator
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Generator {
    /// Type of generator
    #[prost(string, tag = "1")]
    pub r#type: ::prost::alloc::string::String,
    /// Associated data for the generator
    #[prost(message, optional, tag = "2")]
    pub values: ::core::option::Option<::prost_types::Struct>,
}
/// Plugin configuration added to the pact file by the ConfigureInteraction step
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginConfiguration {
    /// Data to be persisted against the interaction
    #[prost(message, optional, tag = "1")]
    pub interaction_configuration: ::core::option::Option<::prost_types::Struct>,
    /// Data to be persisted in the Pact file metadata (Global data)
    #[prost(message, optional, tag = "2")]
    pub pact_configuration: ::core::option::Option<::prost_types::Struct>,
}
/// Response to the configure/setup an interaction request
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InteractionResponse {
    /// Contents for the interaction
    #[prost(message, optional, tag = "1")]
    pub contents: ::core::option::Option<Body>,
    /// All matching rules to apply
    #[prost(map = "string, message", tag = "2")]
    pub rules: ::std::collections::HashMap<::prost::alloc::string::String, MatchingRules>,
    /// Generators to apply
    #[prost(map = "string, message", tag = "3")]
    pub generators: ::std::collections::HashMap<::prost::alloc::string::String, Generator>,
    /// For message interactions, any metadata to be applied
    #[prost(message, optional, tag = "4")]
    pub message_metadata: ::core::option::Option<::prost_types::Struct>,
    /// Plugin specific data to be persisted in the pact file
    #[prost(message, optional, tag = "5")]
    pub plugin_configuration: ::core::option::Option<PluginConfiguration>,
    /// Markdown/HTML formatted text representation of the interaction
    #[prost(string, tag = "6")]
    pub interaction_markup: ::prost::alloc::string::String,
    #[prost(enumeration = "interaction_response::MarkupType", tag = "7")]
    pub interaction_markup_type: i32,
    /// Description of what part this interaction belongs to (in the case of there being more than one, for instance,
    /// request/response messages)
    #[prost(string, tag = "8")]
    pub part_name: ::prost::alloc::string::String,
}
/// Nested message and enum types in `InteractionResponse`.
pub mod interaction_response {
    /// Type of markup used
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum MarkupType {
        /// CommonMark format
        CommonMark = 0,
        /// HTML format
        Html = 1,
    }
}
/// Response to the configure/setup an interaction request
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfigureInteractionResponse {
    /// If an error occurred. In this case, the other fields will be ignored/not set
    #[prost(string, tag = "1")]
    pub error: ::prost::alloc::string::String,
    /// The actual response if no error occurred.
    #[prost(message, repeated, tag = "2")]
    pub interaction: ::prost::alloc::vec::Vec<InteractionResponse>,
    /// Plugin specific data to be persisted in the pact file
    #[prost(message, optional, tag = "3")]
    pub plugin_configuration: ::core::option::Option<PluginConfiguration>,
}
/// Request to generate the contents using any defined generators
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateContentRequest {
    /// Original contents
    #[prost(message, optional, tag = "1")]
    pub contents: ::core::option::Option<Body>,
    /// Generators to apply
    #[prost(map = "string, message", tag = "2")]
    pub generators: ::std::collections::HashMap<::prost::alloc::string::String, Generator>,
    /// Additional data added to the Pact/Interaction by the plugin
    #[prost(message, optional, tag = "3")]
    pub plugin_configuration: ::core::option::Option<PluginConfiguration>,
}
/// Generated body/message response
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateContentResponse {
    #[prost(message, optional, tag = "1")]
    pub contents: ::core::option::Option<Body>,
}
#[doc = r" Generated client implementations."]
pub mod pact_plugin_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    #[derive(Debug, Clone)]
    pub struct PactPluginClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl PactPluginClient<tonic::transport::Channel> {
        #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> PactPluginClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::ResponseBody: Body + Send + Sync + 'static,
        T::Error: Into<StdError>,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> PactPluginClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
                Into<StdError> + Send + Sync,
        {
            PactPluginClient::new(InterceptedService::new(inner, interceptor))
        }
        #[doc = r" Compress requests with `gzip`."]
        #[doc = r""]
        #[doc = r" This requires the server to support it otherwise it might respond with an"]
        #[doc = r" error."]
        pub fn send_gzip(mut self) -> Self {
            self.inner = self.inner.send_gzip();
            self
        }
        #[doc = r" Enable decompressing responses with `gzip`."]
        pub fn accept_gzip(mut self) -> Self {
            self.inner = self.inner.accept_gzip();
            self
        }
        #[doc = " Check that the plugin loaded OK. Returns the catalogue entries describing what the plugin provides"]
        pub async fn init_plugin(
            &mut self,
            request: impl tonic::IntoRequest<super::InitPluginRequest>,
        ) -> Result<tonic::Response<super::InitPluginResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })?;
            let codec = tonic::codec::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/io.pact.plugin.PactPlugin/InitPlugin");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Updated catalogue. This will be sent when the core catalogue has been updated (probably by a plugin loading)."]
        pub async fn update_catalogue(
            &mut self,
            request: impl tonic::IntoRequest<super::Catalogue>,
        ) -> Result<tonic::Response<()>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })?;
            let codec = tonic::codec::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/io.pact.plugin.PactPlugin/UpdateCatalogue");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Request to perform a comparison of some contents (matching request)"]
        pub async fn compare_contents(
            &mut self,
            request: impl tonic::IntoRequest<super::CompareContentsRequest>,
        ) -> Result<tonic::Response<super::CompareContentsResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })?;
            let codec = tonic::codec::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/io.pact.plugin.PactPlugin/CompareContents");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Request to configure/setup the interaction for later verification. Data returned will be persisted in the pact file."]
        pub async fn configure_interaction(
            &mut self,
            request: impl tonic::IntoRequest<super::ConfigureInteractionRequest>,
        ) -> Result<tonic::Response<super::ConfigureInteractionResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/io.pact.plugin.PactPlugin/ConfigureInteraction",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Request to generate the content using any defined generators"]
        pub async fn generate_content(
            &mut self,
            request: impl tonic::IntoRequest<super::GenerateContentRequest>,
        ) -> Result<tonic::Response<super::GenerateContentResponse>, tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })?;
            let codec = tonic::codec::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/io.pact.plugin.PactPlugin/GenerateContent");
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
}
#[doc = r" Generated server implementations."]
pub mod pact_plugin_server {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    #[doc = "Generated trait containing gRPC methods that should be implemented for use with PactPluginServer."]
    #[async_trait]
    pub trait PactPlugin: Send + Sync + 'static {
        #[doc = " Check that the plugin loaded OK. Returns the catalogue entries describing what the plugin provides"]
        async fn init_plugin(
            &self,
            request: tonic::Request<super::InitPluginRequest>,
        ) -> Result<tonic::Response<super::InitPluginResponse>, tonic::Status>;
        #[doc = " Updated catalogue. This will be sent when the core catalogue has been updated (probably by a plugin loading)."]
        async fn update_catalogue(
            &self,
            request: tonic::Request<super::Catalogue>,
        ) -> Result<tonic::Response<()>, tonic::Status>;
        #[doc = " Request to perform a comparison of some contents (matching request)"]
        async fn compare_contents(
            &self,
            request: tonic::Request<super::CompareContentsRequest>,
        ) -> Result<tonic::Response<super::CompareContentsResponse>, tonic::Status>;
        #[doc = " Request to configure/setup the interaction for later verification. Data returned will be persisted in the pact file."]
        async fn configure_interaction(
            &self,
            request: tonic::Request<super::ConfigureInteractionRequest>,
        ) -> Result<tonic::Response<super::ConfigureInteractionResponse>, tonic::Status>;
        #[doc = " Request to generate the content using any defined generators"]
        async fn generate_content(
            &self,
            request: tonic::Request<super::GenerateContentRequest>,
        ) -> Result<tonic::Response<super::GenerateContentResponse>, tonic::Status>;
    }
    #[derive(Debug)]
    pub struct PactPluginServer<T: PactPlugin> {
        inner: _Inner<T>,
        accept_compression_encodings: (),
        send_compression_encodings: (),
    }
    struct _Inner<T>(Arc<T>);
    impl<T: PactPlugin> PactPluginServer<T> {
        pub fn new(inner: T) -> Self {
            let inner = Arc::new(inner);
            let inner = _Inner(inner);
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
            }
        }
        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for PactPluginServer<T>
    where
        T: PactPlugin,
        B: Body + Send + Sync + 'static,
        B::Error: Into<StdError> + Send + 'static,
    {
        type Response = http::Response<tonic::body::BoxBody>;
        type Error = Never;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            let inner = self.inner.clone();
            match req.uri().path() {
                "/io.pact.plugin.PactPlugin/InitPlugin" => {
                    #[allow(non_camel_case_types)]
                    struct InitPluginSvc<T: PactPlugin>(pub Arc<T>);
                    impl<T: PactPlugin> tonic::server::UnaryService<super::InitPluginRequest> for InitPluginSvc<T> {
                        type Response = super::InitPluginResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InitPluginRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).init_plugin(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = InitPluginSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
                            accept_compression_encodings,
                            send_compression_encodings,
                        );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/io.pact.plugin.PactPlugin/UpdateCatalogue" => {
                    #[allow(non_camel_case_types)]
                    struct UpdateCatalogueSvc<T: PactPlugin>(pub Arc<T>);
                    impl<T: PactPlugin> tonic::server::UnaryService<super::Catalogue> for UpdateCatalogueSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::Catalogue>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).update_catalogue(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = UpdateCatalogueSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
                            accept_compression_encodings,
                            send_compression_encodings,
                        );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/io.pact.plugin.PactPlugin/CompareContents" => {
                    #[allow(non_camel_case_types)]
                    struct CompareContentsSvc<T: PactPlugin>(pub Arc<T>);
                    impl<T: PactPlugin> tonic::server::UnaryService<super::CompareContentsRequest>
                        for CompareContentsSvc<T>
                    {
                        type Response = super::CompareContentsResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::CompareContentsRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).compare_contents(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = CompareContentsSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
                            accept_compression_encodings,
                            send_compression_encodings,
                        );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/io.pact.plugin.PactPlugin/ConfigureInteraction" => {
                    #[allow(non_camel_case_types)]
                    struct ConfigureInteractionSvc<T: PactPlugin>(pub Arc<T>);
                    impl<T: PactPlugin>
                        tonic::server::UnaryService<super::ConfigureInteractionRequest>
                        for ConfigureInteractionSvc<T>
                    {
                        type Response = super::ConfigureInteractionResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ConfigureInteractionRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).configure_interaction(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = ConfigureInteractionSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
                            accept_compression_encodings,
                            send_compression_encodings,
                        );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/io.pact.plugin.PactPlugin/GenerateContent" => {
                    #[allow(non_camel_case_types)]
                    struct GenerateContentSvc<T: PactPlugin>(pub Arc<T>);
                    impl<T: PactPlugin> tonic::server::UnaryService<super::GenerateContentRequest>
                        for GenerateContentSvc<T>
                    {
                        type Response = super::GenerateContentResponse;
                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GenerateContentRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).generate_content(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = GenerateContentSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
                            accept_compression_encodings,
                            send_compression_encodings,
                        );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => Box::pin(async move {
                    Ok(http::Response::builder()
                        .status(200)
                        .header("grpc-status", "12")
                        .header("content-type", "application/grpc")
                        .body(empty_body())
                        .unwrap())
                }),
            }
        }
    }
    impl<T: PactPlugin> Clone for PactPluginServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
            }
        }
    }
    impl<T: PactPlugin> Clone for _Inner<T> {
        fn clone(&self) -> Self {
            Self(self.0.clone())
        }
    }
    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            write!(f, "{:?}", self.0)
        }
    }
    impl<T: PactPlugin> tonic::transport::NamedService for PactPluginServer<T> {
        const NAME: &'static str = "io.pact.plugin.PactPlugin";
    }
}