file_name
stringlengths
3
137
prefix
stringlengths
0
918k
suffix
stringlengths
0
962k
middle
stringlengths
0
812k
huawei-grpc-dialout.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0-devel // protoc v3.15.8 // source: huawei-grpc-dialout.proto package huawei_dialout import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ServiceArgs struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields ReqId int64 `protobuf:"varint,1,opt,name=ReqId,proto3" json:"ReqId,omitempty"` //Request ID. // Types that are assignable to MessageData: // *ServiceArgs_Data // *ServiceArgs_DataJson MessageData isServiceArgs_MessageData `protobuf_oneof:"MessageData"` Errors string `protobuf:"bytes,3,opt,name=errors,proto3" json:"errors,omitempty"` //Error description. } func (x *ServiceArgs) Reset() { *x = ServiceArgs{} if protoimpl.UnsafeEnabled { mi := &file_huawei_grpc_dialout_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ServiceArgs) String() string { return protoimpl.X.MessageStringOf(x) } func (*ServiceArgs) ProtoMessage() {} func (x *ServiceArgs) ProtoReflect() protoreflect.Message { mi := &file_huawei_grpc_dialout_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ServiceArgs.ProtoReflect.Descriptor instead. func (*ServiceArgs) Descriptor() ([]byte, []int) { return file_huawei_grpc_dialout_proto_rawDescGZIP(), []int{0} } func (x *ServiceArgs) GetReqId() int64 { if x != nil { return x.ReqId } return 0 } func (m *ServiceArgs) GetMessageData() isServiceArgs_MessageData { if m != nil { return m.MessageData } return nil } func (x *ServiceArgs) GetData() []byte { if x, ok := x.GetMessageData().(*ServiceArgs_Data); ok { return x.Data } return nil } func (x *ServiceArgs) GetDataJson() string { if x, ok := x.GetMessageData().(*ServiceArgs_DataJson); ok { return x.DataJson } return "" } func (x *ServiceArgs) GetErrors() string { if x != nil { return x.Errors } return "" } type isServiceArgs_MessageData interface { isServiceArgs_MessageData() } type ServiceArgs_Data struct { Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"` //Sampled data in GPB encoding format is carried. } type ServiceArgs_DataJson struct { DataJson string `protobuf:"bytes,4,opt,name=data_json,json=dataJson,proto3,oneof"` //Sampled data in JSON encoding format is carried. } func (*ServiceArgs_Data) isServiceArgs_MessageData() {} func (*ServiceArgs_DataJson) isServiceArgs_MessageData() {} var File_huawei_grpc_dialout_proto protoreflect.FileDescriptor var file_huawei_grpc_dialout_proto_rawDesc = []byte{ 0x0a, 0x19, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x75, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x5f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0x7f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x72, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x52, 0x65, 0x71, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x52, 0x65, 0x71, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x32, 0x60, 0x0a, 0x0f, 0x67, 0x52, 0x50, 0x43, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x1b, 0x2e, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x5f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x75, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x1b, 0x2e, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x5f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x75, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x72, 0x67, 0x73, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x17, 0x5a, 0x15, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x2f, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x5f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x75, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_huawei_grpc_dialout_proto_rawDescOnce sync.Once file_huawei_grpc_dialout_proto_rawDescData = file_huawei_grpc_dialout_proto_rawDesc ) func file_huawei_grpc_dialout_proto_rawDescGZIP() []byte { file_huawei_grpc_dialout_proto_rawDescOnce.Do(func() { file_huawei_grpc_dialout_proto_rawDescData = protoimpl.X.CompressGZIP(file_huawei_grpc_dialout_proto_rawDescData) }) return file_huawei_grpc_dialout_proto_rawDescData } var file_huawei_grpc_dialout_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_huawei_grpc_dialout_proto_goTypes = []interface{}{ (*ServiceArgs)(nil), // 0: huawei_dialout.serviceArgs } var file_huawei_grpc_dialout_proto_depIdxs = []int32{ 0, // 0: huawei_dialout.gRPCDataservice.dataPublish:input_type -> huawei_dialout.serviceArgs 0, // 1: huawei_dialout.gRPCDataservice.dataPublish:output_type -> huawei_dialout.serviceArgs 1, // [1:2] is the sub-list for method output_type 0, // [0:1] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_huawei_grpc_dialout_proto_init() } func file_huawei_grpc_dialout_proto_init() { if File_huawei_grpc_dialout_proto != nil { return } if !protoimpl.UnsafeEnabled { file_huawei_grpc_dialout_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServiceArgs); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } file_huawei_grpc_dialout_proto_msgTypes[0].OneofWrappers = []interface{}{ (*ServiceArgs_Data)(nil), (*ServiceArgs_DataJson)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_huawei_grpc_dialout_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 1, }, GoTypes: file_huawei_grpc_dialout_proto_goTypes, DependencyIndexes: file_huawei_grpc_dialout_proto_depIdxs, MessageInfos: file_huawei_grpc_dialout_proto_msgTypes, }.Build() File_huawei_grpc_dialout_proto = out.File file_huawei_grpc_dialout_proto_rawDesc = nil file_huawei_grpc_dialout_proto_goTypes = nil file_huawei_grpc_dialout_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion6 // GRPCDataserviceClient is the client API for GRPCDataservice service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type GRPCDataserviceClient interface { DataPublish(ctx context.Context, opts ...grpc.CallOption) (GRPCDataservice_DataPublishClient, error) } type gRPCDataserviceClient struct { cc grpc.ClientConnInterface } func NewGRPCDataserviceClient(cc grpc.ClientConnInterface) GRPCDataserviceClient { return &gRPCDataserviceClient{cc} }
stream, err := c.cc.NewStream(ctx, &_GRPCDataservice_serviceDesc.Streams[0], "/huawei_dialout.gRPCDataservice/dataPublish", opts...) if err != nil { return nil, err } x := &gRPCDataserviceDataPublishClient{stream} return x, nil } type GRPCDataservice_DataPublishClient interface { Send(*ServiceArgs) error Recv() (*ServiceArgs, error) grpc.ClientStream } type gRPCDataserviceDataPublishClient struct { grpc.ClientStream } func (x *gRPCDataserviceDataPublishClient) Send(m *ServiceArgs) error { return x.ClientStream.SendMsg(m) } func (x *gRPCDataserviceDataPublishClient) Recv() (*ServiceArgs, error) { m := new(ServiceArgs) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // GRPCDataserviceServer is the server API for GRPCDataservice service. type GRPCDataserviceServer interface { DataPublish(GRPCDataservice_DataPublishServer) error } // UnimplementedGRPCDataserviceServer can be embedded to have forward compatible implementations. type UnimplementedGRPCDataserviceServer struct { } func (*UnimplementedGRPCDataserviceServer) DataPublish(GRPCDataservice_DataPublishServer) error { return status.Errorf(codes.Unimplemented, "method DataPublish not implemented") } func RegisterGRPCDataserviceServer(s *grpc.Server, srv GRPCDataserviceServer) { s.RegisterService(&_GRPCDataservice_serviceDesc, srv) } func _GRPCDataservice_DataPublish_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(GRPCDataserviceServer).DataPublish(&gRPCDataserviceDataPublishServer{stream}) } type GRPCDataservice_DataPublishServer interface { Send(*ServiceArgs) error Recv() (*ServiceArgs, error) grpc.ServerStream } type gRPCDataserviceDataPublishServer struct { grpc.ServerStream } func (x *gRPCDataserviceDataPublishServer) Send(m *ServiceArgs) error { return x.ServerStream.SendMsg(m) } func (x *gRPCDataserviceDataPublishServer) Recv() (*ServiceArgs, error) { m := new(ServiceArgs) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } var _GRPCDataservice_serviceDesc = grpc.ServiceDesc{ ServiceName: "huawei_dialout.gRPCDataservice", HandlerType: (*GRPCDataserviceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "dataPublish", Handler: _GRPCDataservice_DataPublish_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "huawei-grpc-dialout.proto", }
func (c *gRPCDataserviceClient) DataPublish(ctx context.Context, opts ...grpc.CallOption) (GRPCDataservice_DataPublishClient, error) {
DirectorySearchBox.tsx
import * as React from 'react'; import styles from './DirectorySearchBox.module.scss'; import { IDirectorySearchBoxProps } from './IDirectorySearchBoxProps'; import { Fabric, TextField, SearchBox } from 'office-ui-fabric-react'; import { RxJsEventEmitter } from '../../../RxJsEventEmitter/RxJsEventEmitter'; import IEventData from '../../../RxJsEventEmitter/IEventData'; export default class DirectorySearchBox extends React.Component<IDirectorySearchBoxProps, {}> { private readonly eventEmitter: RxJsEventEmitter = RxJsEventEmitter.getInstance(); constructor(props: IDirectorySearchBoxProps) { super(props); this.state = { text: null, };
public render(): React.ReactElement<IDirectorySearchBoxProps> { return ( <SearchBox styles={{ root: { width: 300 } }} placeholder={this.props.searchBoxPlaceholder} onChange={(_, newValue) => this._onChangeText(newValue)} /> ); } private _onChangeText = ( text: string ): void => { var eventBody = { sharedData: text } as IEventData; this.eventEmitter.emit("filterTerms", eventBody); } }
}
function.rs
/*! A function is an M-expression. For the purposes of this library, the "head" of a function is not an expression. It's just the name of the function. Functions are usually written with parentheses, even if the function takes no arguments: `f()`. In contexts where only a function name can be the parentheses are dropped. The children of a function are an ordered list (a `Vec<RcExpression>`) of expressions even when the function is commutative. The attributes of a function record whether it is commutative or associative and potentially other boolean data about the function. */ use std::{ cmp::Ordering, rc::Rc }; use crate::{ expression::{ RcExpression, Expression, ExpressionKind }, attributes::Attributes, format::{ Formatable, Formatter }, normal_form::NormalFormOrder }; use super::{Atom, Symbol, Variable}; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Function{ /// The head of the function is either a symbol or a variable. It cannot be a /// function, sequence, or sequence variable. pub head: RcExpression, pub children: Vec<RcExpression>, pub attributes: Attributes } impl Function { /// Creates a new function having a head that is a symbol of the name `name`. pub fn with_symbolic_head(name: &str) -> Function { let head = Rc::new(Symbol(name.to_string()).to_expression()); Function::new(head).unwrap() } /// Creates a new function having a head that is a variable of the name `name`. pub fn with_variable_head(name: &str) -> Function { let head = Rc::new(Variable(name.to_string()).to_expression()); Function::new(head).unwrap() } /// Creates a new function or function variable. If an expression other than a /// symbol or variable is given for the head, an error is return. pub fn new(head: RcExpression) -> Result<Function, ()> { match (head.as_ref()).into() { | ExpressionKind::Symbol | ExpressionKind::Variable => { Ok( Function{ head, children: Vec::new(), attributes: Attributes::default() } ) }, _ => { Err(()) } } } pub fn duplicate_head(&self) -> Function { Function{ head: self.head.clone(), children: Vec::new(), attributes: self.attributes.clone() } } pub fn duplicate_with_rest(&self) -> Function { Function{ head: self.head.clone(), children: self.rest(), attributes: self.attributes.clone() } } pub fn len(&self) -> usize { self.children.len() } pub fn part(&self, idx: usize) -> RcExpression { self.children[idx].clone() } pub fn push(&mut self, child: RcExpression) { self.children.push(child); } /// Returns the first child. pub fn first(&self) -> Option<RcExpression> { if self.children.len() >= 1 { Some(self.children[0].clone()) } else { None } } /// Returns a vector containing all but the first child. If there are zero or one children, returns an empty vector. pub fn rest(&self) -> Vec<RcExpression> { let mut result = Vec::new(); if self.children.len() > 1 { self.children[1..].clone_into(&mut result); } result } /// Is the head of this function a function variable? pub fn is_function_variable(&self) -> bool { ExpressionKind::Variable == self.head.as_ref().into() } pub fn commutative(&self) -> bool { self.attributes.commutative() } pub fn associative(&self) -> bool { self.attributes.associative() } pub fn free(&self) -> bool { !(self.attributes.associative() || self.attributes.commutative()) } /// Rewrites the function into associative normal form by flattening any /// nested occurences of the same function. pub fn associative_normal_form(&mut self) { if !(self.attributes.associative() && self.attributes.variadic()) { /* It isn't enough to just be associative. Suppose ƒ is a binary associative function. Then ƒ(ƒ(a, b), c) = ƒ(a, ƒ(b, c)), but ƒ cannot be flattened to ƒ(a, b, c). */ return; } // Make sure all children are flat. for child in self.children.iter_mut() { let mut_child: &mut Expression = Rc::<Expression>::make_mut(child); mut_child.associative_normal_form(); } /* The following code does not completely flatten the function. Consider the expression `ƒ(a, (b, ƒ(c)))`. Every child of the outer ƒ is already in associative-normal form. The code below will transform the expression as: `ƒ(a, (b, ƒ(c)))` -> `ƒ(a, b, ƒ(c))`, which is not in a-normal form. Worse, consider: `ƒ(a, (b, ƒ(c, (d, f(e)))))` -> `ƒ(a, b, ƒ(c, d, ƒ(e)))`. The solution is to check again if a sequence is spliced. Because the children are already in a-normal form, the second loop is guaranteed not to encounter a sequence. */ // Initialized to true to allow the first loop. let mut found_a_squence: bool = true; while found_a_squence { found_a_squence = false; let mut child_stack: Vec<(usize, RcExpression)> = vec![]; let mut additional_children: usize = 0; for (i, child) in self.children.iter().enumerate() { // Variadic associative functions flatten two kinds of children: functions // of the same name, and any and all sequences. match &**child { Expression::Function(function) if self.is_equal(function) => { additional_children += function.len() - 1; child_stack.push((i, child.clone())); }, Expression::Sequence(sequence) => { additional_children += sequence.len() - 1; child_stack.push((i, child.clone())); found_a_squence = true; }, _ => continue } } self.children.reserve_exact(additional_children); // Iterating over the stack in reverse maintains the validity of the index `i`. for (i, child) in child_stack.iter().rev(){ // Destructure match &**child { Expression::Function(function) => { self.children.splice(i..=i, function.children.iter().map(|e| e.clone())); } Expression::Sequence(sequence) => { self.children.splice(i..=i, sequence.children.iter().map(|e| e.clone())); }, _ => { unreachable!() } } // end match on child } // end stack processing loop } // end for repeat } /// Rewrites the sequence into commutative normal form by sorting the children /// according to `NormalFormOrder`. pub fn commutative_normal_form(&mut self) { // Put all children in commutative normal form. for child in self.children.iter_mut() { let mut_child: &mut Expression = Rc::<Expression>::make_mut(child); mut_child.commutative_normal_form(); } // Now put `self` into commutative normal form. self.children.sort_unstable_by(|x, y| Expression::cmp(x, y) ); } } impl Formatable for Function { fn format(&self, formatter: &Formatter) -> String { format!( // "{}({})", "{}❨{}❩", self.head, self.children .iter() .map(|c| c.format(formatter)) .collect::<Vec<_>>() .join(", ") ) } } impl NormalFormOrder for Function { /// For the purposes of `NormalFormOrder`, two functions are equal if their names are equal. fn cmp(&self, other: &Self) -> Ordering { // todo: Prohibit distinct expressions with the same name, presumably in the symbol table. self.head.cmp(&other.head) } } impl Atom for Function { fn to_expression(self) -> Expression { Expression::Function(self) } } impl From<Function> for Expression { fn from(function: Function) -> Self { Expression::Function(function) } } display_formatable_impl!(Function); #[cfg(test)] mod tests { use std::rc::Rc; use super::*; use crate::{ atoms::{ Variable, SequenceVariable, Sequence }, attributes::Attribute }; #[test] fn a_normal_form() { /
t is modified, be sure the modified version still tests // a mutually nested case similar to `ƒ(a, (b, ƒ(c)))`. (See the // comment in `Self::associative_normal_form()`.) let a = Rc::new(Variable("a".into()).to_expression()); let b = Rc::new(Variable("b".into()).to_expression()); let c = Rc::new(Variable("c".into()).to_expression()); let d = Rc::new(Variable("d".into()).to_expression()); let e = Rc::new(Variable("e".into()).to_expression()); let h = Rc::new(Variable("h".into()).to_expression()); let mut g = Function::with_symbolic_head("f"); g.attributes.set(Attribute::Associative); g.attributes.set(Attribute::Variadic); g.children = vec![a.clone(), b.clone(), c.clone(), d.clone(), e.clone(), h.clone()]; let mut f1 = Function::with_symbolic_head("f"); f1.attributes.set(Attribute::Associative); f1.attributes.set(Attribute::Variadic); f1.children.push(a); let mut sequence_inner = Sequence::default(); sequence_inner.children.push(d); sequence_inner.children.push(e); let mut f2 = Function::with_symbolic_head("f"); f2.attributes.set(Attribute::Associative); f2.attributes.set(Attribute::Variadic); f2.children.push(b); f2.children.push(c); f2.children.push(Rc::new(sequence_inner.into())); f2.children.push(h); let mut sequence_outer = Sequence::default(); sequence_outer.children.push(Rc::new(f2.into())); f1.children.push(Rc::new(sequence_outer.into())); // println!("{}", f1); f1.associative_normal_form(); // println!("{}", f1); assert_eq!(f1, g); } #[test] fn formatted_function() { let v = Rc::new(Variable("a".into()).to_expression()); let u = Rc::new(SequenceVariable("b".into()).to_expression()); let mut f = Function::with_symbolic_head("f"); f.children = vec![v, u]; // assert_eq!(f.format(&Formatter::default()), "f(‹a›, «b»)"); assert_eq!(f.format(&Formatter::default()), "f❨‹a›, «b»❩"); } #[test] fn function_len() { let v = Rc::new(Variable("a".into()).to_expression()); let u = Rc::new(Variable("b".into()).to_expression()); let mut f = Function::with_symbolic_head("f"); f.children = vec![v, u]; assert_eq!(f.len(), 2); } #[test] fn function_part() { let v = Rc::new(Variable("a".into()).to_expression()); let u = Rc::new(Variable("b".into()).to_expression()); let mut f = Function::with_symbolic_head("f"); f.children = vec![v, u.clone()]; assert_eq!(f.part(1), u); } #[test] fn function_normal_form_ordering(){ let mut f: Function = Function::with_symbolic_head("f"); let mut g: Function = Function::with_symbolic_head("g"); f.children = vec![ Rc::new(Variable("a".into()).to_expression()), Rc::new(Variable("b".into()).to_expression()), Rc::new(Variable("c".into()).to_expression()), Rc::new(Variable("d".into()).to_expression()), ]; g.children = f.children.clone(); g.children.push(Rc::new(Variable("e".into()).to_expression())); assert_eq!(NormalFormOrder::cmp(&f, &g), Ordering::Less); assert_eq!(NormalFormOrder::cmp(&g, &f), Ordering::Greater); g.children = vec![]; assert_eq!(NormalFormOrder::cmp(&f, &g), Ordering::Less); assert_eq!(NormalFormOrder::cmp(&g, &f), Ordering::Greater); g.children = f.children.clone(); f.children.push(Rc::new(Variable("e".into()).to_expression())); assert_eq!(NormalFormOrder::cmp(&f, &g), Ordering::Less); assert_eq!(NormalFormOrder::cmp(&g, &f), Ordering::Greater); } }
/ If this tes
12_ownership.rs
#![feature(const_fn_trait_bound)] mod fe_prelude; mod fe_std; use fe_prelude::*; use fe_std::Console; #[allow(non_upper_case_globals)] const STR_SLICE_0: FeShareable<FeString> = FeShareable::new(FeString::from_slice("Adam")); #[allow(non_upper_case_globals)] const STR_SLICE_1: FeShareable<FeString> = FeShareable::new(FeString::from_slice("Madeline")); #[allow(non_upper_case_globals)] const STR_SLICE_2: FeShareable<FeString> = FeShareable::new(FeString::from_slice("Brian")); #[allow(non_upper_case_globals)] const STR_SLICE_3: FeShareable<FeString> = FeShareable::new(FeString::from_slice( "Got unique person1 while person2 still exists!!!", )); #[allow(non_upper_case_globals)] const STR_SLICE_4: FeShareable<FeString> = FeShareable::new(FeString::from_slice("new")); #[allow(non_upper_case_globals)] const STR_SLICE_5: FeShareable<FeString> = FeShareable::new(FeString::from_slice("person1 cannot be made unique yet.")); #[allow(non_upper_case_globals)] const STR_SLICE_6: FeShareable<FeString> = FeShareable::new(FeString::from_slice( "Got unique person1 after person2 dropped.", )); #[allow(non_upper_case_globals)] const STR_SLICE_7: FeShareable<FeString> = FeShareable::new(FeString::from_slice( "person1 cannot be made unique even after person2 dropped?!", )); #[derive(Debug, Clone)] struct Person { pub name: FeShareable<FeString>, pub age: usize, } impl Person { fn new(name: FeShareable<FeString>, age: usize) -> Self { Self { name, age } } fn requires_borrow(&self) {} fn requires_borrow_mut(&mut self) -> &mut Self { return self; } } #[derive(Debug, Clone)] struct House { pub owner: FeMutField<Person>, } #[derive(Debug, Clone)] struct Child { parents: (FeShareable<Person>, FeShareable<Person>), } fn main()
{ let fe_person1 = Person { name: STR_SLICE_0, age: 25, }; let fe_person2 = fe_person1; let mut shared_person2; let shared = FeShareable::new(fe_person2).share(); shared_person2 = shared.0; let shared_person3 = shared.1; // `Shareables` must be `borrow`ed, or `borrow_mut`ed to access inner data Console::write_line(FeString::from_owned(format!( "{} is {} years old.", shared_person3.name, shared_person2.age ))); let mut fe_person1 = Person { name: STR_SLICE_0, age: 25, }; let mut shared_person1; let shared = FeShareable::new(fe_person1).share(); shared_person1 = shared.0; let shared_person2 = shared.1; let shared_person3 = shared_person2; let mut fe_person1 = Person { name: STR_SLICE_0, age: 25, }; let mut fe_person1 = shared_person1.clone().take(); fe_person1.age = 26; Console::write_line(FeString::from_owned(format!( "{} is {} years old.", shared_person3.name, fe_person1.age ))); fe_person1.requires_borrow(); fe_person1.requires_borrow_mut(); let mut house1 = House { owner: FeMutField::new(fe_person1), }; let house2 = House { owner: FeMutField::from(shared_person3), }; house1.owner.age = 50; let shared_mom = FeShareable::new(Person { name: STR_SLICE_1, age: 52, }); let shared_dad = FeShareable::new(Person { name: STR_SLICE_2, age: 56, }); let shared_adam = FeShareable::new(Child { parents: (shared_mom, shared_dad), }); let mut shared_person1 = FeShareable::new(Person { name: STR_SLICE_0, age: 25, }); { let shared = shared_person1.share(); shared_person1 = shared.0; let shared_person2 = shared.1; match shared_person1.try_mutable() { Ok(person) => { Console::write_line(STR_SLICE_3); shared_person1 = FeShareable::new(Person { name: STR_SLICE_4, age: 0, }); } Err(person) => { Console::write_line(STR_SLICE_5); shared_person1 = person; } } } match shared_person1.try_mutable() { Ok(person) => { Console::write_line(STR_SLICE_6); } Err(person) => { Console::write_line(STR_SLICE_7); } } }
channels.ts
import { SlashCommandBuilder } from '@discordjs/builders'; import { CommandInteraction, Guild, MessageActionRow, MessageEmbed, MessageSelectMenu, SelectMenuInteraction, TextChannel, VoiceChannel, } from 'discord.js'; import * as RolesJob from '../jobs/roles'; import * as Channels from '../services/channels'; import { ChannelCategories, MessageCategories } from '../types/categories'; export const data = { name: 'channels', client: false, slashCommand: new SlashCommandBuilder() .setName('channels') .setDescription('Channels related commands.') .setDefaultPermission(false) .addSubcommand((subcommand) => subcommand .setName('create') .setDescription('Create a guild channel.') .addStringOption((option) => option.setName('name').setDescription('Channel name.').setRequired(true)) .addStringOption((option) => option .setName('type') .setDescription('Whether it should be a text or voice channel.') .setRequired(true) .addChoices( { name: 'Text Channel', value: 'GUILD_TEXT' }, { name: 'Voice Channel', value: 'GUILD_VOICE' }, ), ) .addStringOption((option) => option.setName('topic').setDescription('Topic of the text channel.')) .addBooleanOption((option) => option.setName('nsfw').setDescription('Whether the channel is NSFW.')), ) .addSubcommand((subcommand) => subcommand .setName('update') .setDescription('Update a guild channel.') .addChannelOption((option) => option.setName('channel').setDescription('Guild channel.').setRequired(true), ) .addStringOption((option) => option.setName('name').setDescription('Channel name.')) .addStringOption((option) => option.setName('topic').setDescription('Topic of the text channel.')) .addBooleanOption((option) => option.setName('nsfw').setDescription('Whether the channel is NSFW.')), ) .addSubcommand((subcommand) => subcommand .setName('delete') .setDescription('Delete a guild channel.') .addChannelOption((option) => option.setName('channel').setDescription('Guild channel.').setRequired(true), ), ) .addSubcommand((subcommand) => subcommand .setName('assign') .setDescription('Assign a bot message to a text channel.') .addStringOption((option) => option .setName('category') .setDescription('Message category.') .setRequired(true) .addChoices( { name: 'Roles', value: 'GUILD_TEXT' }, { name: 'Leaderboards', value: 'LEADERBOARDS_MESSAGE' }, { name: 'Birthdays', value: 'BIRTHDAYS_MESSAGE' }, ), ) .addChannelOption((option) => option.setName('channel').setDescription('Text channel to receive bot message.').setRequired(true), ), ) .addSubcommand((subcommand) => subcommand .setName('dissociate') .setDescription('Dissociate a bot message from a text channel.') .addStringOption((option) => option .setName('category') .setDescription('Message category.') .setRequired(true) .addChoices( { name: 'Roles', value: 'GUILD_TEXT' }, { name: 'Leaderboards', value: 'LEADERBOARDS_MESSAGE' }, { name: 'Birthdays', value: 'BIRTHDAYS_MESSAGE' }, ), ) .addChannelOption((option) => option .setName('channel') .setDescription('Text channel which has the bot message assigned.') .setRequired(true), ), ), }; export const execute = async (interaction: CommandInteraction) => { const subcommand = interaction.options.getSubcommand(); const select = async (category: string) => { const options: Record<string, (interaction: CommandInteraction) => Promise<void>> = { create: createChannel, update: updateChannel, delete: deleteChannel, assign: assignChannel, dissociate: dissociateChannel, }; return options[category](interaction); }; await select(subcommand); }; const getRoleOptions = (guild: Guild) => { const roles = [...guild.roles.cache.values()].sort((a, b) => a.position - b.position); return roles .map(({ id, name, tags }) => { if (id === guild.roles.everyone.id || tags) return; return { label: name, value: id, }; }) .filter((option): option is NonNullable<typeof option> => !!option); }; const getLeaderboardOptions = () => { const leaderboards = ['Steam']; return leaderboards.map((option) => ({ label: option, value: option })); }; const createChannel = async (interaction: CommandInteraction) => { const name = interaction.options.getString('name')!; const type = interaction.options.getString('type')! as ChannelCategories; const topic = interaction.options.getString('topic') ?? ''; const nsfw = interaction.options.getBoolean('nsfw') ?? false; const guild = interaction.guild as Guild; await Channels.create(guild, name, type, topic, nsfw); await interaction.reply({ embeds: [new MessageEmbed().setTitle(`Channel ${name} has been created.`).setColor('RANDOM')], ephemeral: true, }); }; const updateChannel = async (interaction: CommandInteraction) => { const channel = interaction.options.getChannel('channel')!; const name = interaction.options.getString('name')!; const topic = interaction.options.getString('topic'); const nsfw = interaction.options.getBoolean('nsfw'); const isValid = channel instanceof TextChannel || channel instanceof VoiceChannel; if (!isValid) return await interaction.reply({ content: 'Channel must be a text or voice channel.', ephemeral: true }); await Channels.update(channel, name, topic, nsfw); await interaction.reply({ embeds: [new MessageEmbed().setTitle(`Channel ${channel.name} has been updated.`).setColor('RANDOM')], ephemeral: true, }); }; const deleteChannel = async (interaction: CommandInteraction) => { const channel = interaction.options.getChannel('channel'); const isValid = channel instanceof TextChannel || channel instanceof VoiceChannel; if (!isValid) return await interaction.reply({ content: 'Channel must be a text or voice channel.', ephemeral: true }); await Channels.remove(channel); await interaction.reply({ embeds: [new MessageEmbed().setTitle(`Channel ${channel.name} has been deleted.`).setColor('RANDOM')], ephemeral: true, }); }; const assignChannel = async (interaction: CommandInteraction) => { const channel = interaction.options.getChannel('channel')!; const category = interaction.options.getString('category')! as MessageCategories; const isValid = channel instanceof TextChannel; if (!isValid) return await interaction.reply({ content: 'Channel must be a text channel.', ephemeral: true }); const guild = interaction.guild as Guild; if (category === 'BIRTHDAYS_MESSAGE') { await Channels.assign(guild.id, channel, category, []); return await interaction.reply({ embeds: [ new MessageEmbed().setTitle(`${category} has been assigned to ${channel.name}.`).setColor('RANDOM'), ], ephemeral: true, }); } const options = category === 'ROLES_MESSAGE' ? getRoleOptions(guild) : getLeaderboardOptions(); if (options.length === 0) return await interaction.reply({ content: `Invalid length of options for ${category}.`, ephemeral: true }); const selectMenu = new MessageActionRow().addComponents( new MessageSelectMenu() .setCustomId(`ASSIGN_${category}`) .setPlaceholder('Nothing selected.') .setMaxValues(options.length) .addOptions(options), ); await interaction.reply({ embeds: [ new MessageEmbed() .setTitle(`Select which actions should be included in the ${category}.`) .setColor('RANDOM'), ], components: [selectMenu], ephemeral: true, }); const interactionChannel = interaction.channel as TextChannel; const filter = (filterInteraction: SelectMenuInteraction) => filterInteraction.customId === `ASSIGN_${category}` && filterInteraction.user.id === interaction.user.id; const collector = interactionChannel.createMessageComponentCollector({ filter, componentType: 'SELECT_MENU', max: 1, time: 60 * 1000 * 5, }); await new Promise<void>((resolve, reject) => { collector.on('end', async (collected) => { try { const collectedInteraction = collected.first(); if (!collectedInteraction) { await interaction.editReply({ content: 'Channel assign timeout.', embeds: [], components: [] }); return; } await Channels.assign(guild.id, channel, category, collectedInteraction.values); collectedInteraction.update({ embeds: [ new MessageEmbed() .setTitle(`${category} has been assigned to ${channel.name}.`) .setColor('RANDOM'), ], components: [], }); if (category === 'ROLES_MESSAGE') await RolesJob.execute(collectedInteraction.client); } catch (error) { reject(error); } }); }); }; const dissociateChannel = async (interaction: CommandInteraction) => { const channel = interaction.options.getChannel('channel')!; const category = interaction.options.getString('category')! as MessageCategories; const isValid = channel instanceof TextChannel; if (!isValid) return await interaction.reply({ content: 'Channel must be a text channel.', ephemeral: true });
const result = await Channels.dissociate(guild.id, channel, category, []).catch((error: Error) => error); if (result instanceof Error) return await interaction.reply({ content: result.message, ephemeral: true }); return await interaction.reply({ embeds: [ new MessageEmbed() .setTitle(`${category} has been dissociated from ${channel.name}.`) .setColor('RANDOM'), ], ephemeral: true, }); } const options = getLeaderboardOptions(); if (options.length === 0) return await interaction.reply({ content: `Invalid length of options for ${category}`, ephemeral: true }); const selectMenu = new MessageActionRow().addComponents( new MessageSelectMenu() .setCustomId(`DISSOCIATE_${category}`) .setPlaceholder('Nothing selected.') .setMaxValues(options.length) .addOptions(options), ); await interaction.reply({ embeds: [ new MessageEmbed() .setTitle(`Select which actions should be excluded from the ${category} in channel ${channel.name}.`) .setColor('RANDOM'), ], components: [selectMenu], ephemeral: true, }); const interactionChannel = interaction.channel as TextChannel; const filter = (filterInteraction: SelectMenuInteraction) => filterInteraction.customId === `DISSOCIATE_${category}` && filterInteraction.user.id === interaction.user.id; const collector = interactionChannel.createMessageComponentCollector({ filter, componentType: 'SELECT_MENU', max: 1, time: 60 * 1000 * 5, }); await new Promise<void>((resolve, reject) => { try { collector.on('end', async (collected) => { const collectedInteraction = collected.first(); if (!collectedInteraction) { await interaction.editReply({ content: 'Channel dissociate timeout.', embeds: [], components: [] }); return; } const result = await Channels.dissociate( guild.id, channel, category, collectedInteraction.values, ).catch((error: Error) => error); if (result instanceof Error) { await interaction.editReply({ content: result.message, embeds: [], components: [] }); return; } await collectedInteraction.update({ embeds: [ new MessageEmbed() .setTitle(`${category} has been dissociated from ${channel.name}.`) .setColor('RANDOM'), ], components: [], }); }); resolve(); } catch (error) { reject(error); } }); };
const guild = interaction.guild as Guild; if (category === 'ROLES_MESSAGE' || category === 'BIRTHDAYS_MESSAGE') {
retriever_concurrent_test.go
// +build big //
// of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package fs import ( "errors" "fmt" "io/ioutil" "math/rand" "os" "path/filepath" "sync" "testing" "time" "github.com/m3db/bloom" "github.com/m3db/m3/src/dbnode/digest" "github.com/m3db/m3/src/dbnode/storage/block" "github.com/m3db/m3/src/dbnode/storage/index/convert" "github.com/m3db/m3/src/dbnode/ts" "github.com/m3db/m3/src/dbnode/x/xio" "github.com/m3db/m3x/checked" "github.com/m3db/m3x/context" "github.com/m3db/m3x/ident" "github.com/m3db/m3x/pool" xtime "github.com/m3db/m3x/time" "github.com/fortytw2/leaktest" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) type testBlockRetrieverOptions struct { retrieverOpts BlockRetrieverOptions fsOpts Options newSeekerMgrFn newSeekerMgrFn } type testCleanupFn func() func newOpenTestBlockRetriever( t *testing.T, opts testBlockRetrieverOptions, ) (*blockRetriever, testCleanupFn) { require.NotNil(t, opts.retrieverOpts) require.NotNil(t, opts.fsOpts) r := NewBlockRetriever(opts.retrieverOpts, opts.fsOpts) retriever := r.(*blockRetriever) if opts.newSeekerMgrFn != nil { retriever.newSeekerMgrFn = opts.newSeekerMgrFn } nsPath := NamespaceDataDirPath(opts.fsOpts.FilePathPrefix(), testNs1ID) require.NoError(t, os.MkdirAll(nsPath, opts.fsOpts.NewDirectoryMode())) require.NoError(t, retriever.Open(testNs1Metadata(t))) return retriever, func() { assert.NoError(t, retriever.Close()) } } func newOpenTestWriter( t *testing.T, fsOpts Options, shard uint32, start time.Time, ) (DataFileSetWriter, testCleanupFn) { w := newTestWriter(t, fsOpts.FilePathPrefix()) writerOpts := DataWriterOpenOptions{ BlockSize: testBlockSize, Identifier: FileSetFileIdentifier{ Namespace: testNs1ID, Shard: shard, BlockStart: start, }, } require.NoError(t, w.Open(writerOpts)) return w, func() { assert.NoError(t, w.Close()) } } type streamResult struct { ctx context.Context shard uint32 id string blockStart time.Time stream xio.SegmentReader } // TestBlockRetrieverHighConcurrentSeeks tests the retriever with high // concurrent seeks, but without caching the shard indices. This means that the // seekers will be opened lazily by calls to ConcurrentIDBloomFilter() in the // SeekerManager func TestBlockRetrieverHighConcurrentSeeks(t *testing.T) { testBlockRetrieverHighConcurrentSeeks(t, false) } // TestBlockRetrieverHighConcurrentSeeksCacheShardIndices tests the retriever // with high concurrent seekers and calls cache shard indices at the beginning. // This means that the seekers will be opened all at once in the beginning and // by the time ConcurrentIDBloomFilter() is called, they seekers will already be // open. func TestBlockRetrieverHighConcurrentSeeksCacheShardIndices(t *testing.T) { testBlockRetrieverHighConcurrentSeeks(t, true) } func testBlockRetrieverHighConcurrentSeeks(t *testing.T, shouldCacheShardIndices bool) { defer leaktest.CheckTimeout(t, 2*time.Minute)() dir, err := ioutil.TempDir("", "testdb") require.NoError(t, err) defer os.RemoveAll(dir) filePathPrefix := filepath.Join(dir, "") fsOpts := testDefaultOpts.SetFilePathPrefix(filePathPrefix) fetchConcurrency := 4 seekConcurrency := 4 * fetchConcurrency opts := testBlockRetrieverOptions{ retrieverOpts: NewBlockRetrieverOptions(). SetFetchConcurrency(fetchConcurrency). SetRequestPoolOptions(pool.NewObjectPoolOptions(). // NB(r): Try to make sure same req structs are reused frequently // to surface any race issues that might occur with pooling. SetSize(fetchConcurrency / 2)), fsOpts: fsOpts, } retriever, cleanup := newOpenTestBlockRetriever(t, opts) defer cleanup() ropts := testNs1Metadata(t).Options().RetentionOptions() now := time.Now().Truncate(ropts.BlockSize()) min, max := now.Add(-6*ropts.BlockSize()), now.Add(-ropts.BlockSize()) var ( shards = []uint32{0, 1, 2} idsPerShard = 16 shardIDs = make(map[uint32][]ident.ID) shardIDStrings = make(map[uint32][]string) dataBytesPerID = 32 shardData = make(map[uint32]map[string]map[xtime.UnixNano]checked.Bytes) blockStarts []time.Time ) for st := min; !st.After(max); st = st.Add(ropts.BlockSize()) { blockStarts = append(blockStarts, st) } for _, shard := range shards { shardIDs[shard] = make([]ident.ID, 0, idsPerShard) shardData[shard] = make(map[string]map[xtime.UnixNano]checked.Bytes, idsPerShard) for _, blockStart := range blockStarts { w, closer := newOpenTestWriter(t, fsOpts, shard, blockStart) for i := 0; i < idsPerShard; i++ { idString := fmt.Sprintf("foo.%d", i) shardIDStrings[shard] = append(shardIDStrings[shard], idString) id := ident.StringID(idString) shardIDs[shard] = append(shardIDs[shard], id) if _, ok := shardData[shard][idString]; !ok { shardData[shard][idString] = make(map[xtime.UnixNano]checked.Bytes, len(blockStarts)) } data := checked.NewBytes(nil, nil) data.IncRef() for j := 0; j < dataBytesPerID; j++ { data.Append(byte(rand.Int63n(256))) } shardData[shard][idString][xtime.ToUnixNano(blockStart)] = data tags := testTagsFromTestID(id.String()) err := w.Write(id, ident.NewTags(tags...), data, digest.Checksum(data.Bytes())) require.NoError(t, err) } closer() } } if shouldCacheShardIndices { retriever.CacheShardIndices(shards) } var ( startWg, readyWg sync.WaitGroup seeksPerID = 24 seeksEach = len(shards) * idsPerShard * seeksPerID ) // Write a fake onRetrieve function so we can verify the behavior of the callback. var ( retrievedIDs = map[string]ident.Tags{} retrievedIDsMutex = sync.Mutex{} bytesPool = pool.NewCheckedBytesPool(nil, nil, func(s []pool.Bucket) pool.BytesPool { return pool.NewBytesPool(s, nil) }) idPool = ident.NewPool(bytesPool, ident.PoolOptions{}) ) bytesPool.Init() onRetrieve := block.OnRetrieveBlockFn(func(id ident.ID, tagsIter ident.TagIterator, startTime time.Time, segment ts.Segment) { // TagsFromTagsIter requires a series ID to try and share bytes so we just pass // an empty string because we don't care about efficiency. tags, err := convert.TagsFromTagsIter(ident.StringID(""), tagsIter, idPool) require.NoError(t, err) retrievedIDsMutex.Lock() retrievedIDs[id.String()] = tags retrievedIDsMutex.Unlock() }) var enqueueWg sync.WaitGroup startWg.Add(1) for i := 0; i < seekConcurrency; i++ { i := i readyWg.Add(1) enqueueWg.Add(1) go func() { defer enqueueWg.Done() readyWg.Done() startWg.Wait() shardOffset := i idOffset := i % seekConcurrency / 4 results := make([]streamResult, 0, len(blockStarts)) compare := ts.Segment{} for j := 0; j < seeksEach; j++ { shard := uint32((j + shardOffset) % len(shards)) idIdx := uint32((j + idOffset) % len(shardIDs[shard])) id := shardIDs[shard][idIdx] idString := shardIDStrings[shard][idIdx] for k := 0; k < len(blockStarts); k++ { ctx := context.NewContext() stream, err := retriever.Stream(ctx, shard, id, blockStarts[k], onRetrieve) require.NoError(t, err) results = append(results, streamResult{ ctx: ctx, shard: shard, id: idString, blockStart: blockStarts[k], stream: stream, }) } for _, r := range results { seg, err := r.stream.Segment() if err != nil { fmt.Printf("\nstream seg err: %v\n", err) fmt.Printf("id: %s\n", r.id) fmt.Printf("shard: %d\n", r.shard) fmt.Printf("start: %v\n", r.blockStart.String()) } require.NoError(t, err) compare.Head = shardData[r.shard][r.id][xtime.ToUnixNano(r.blockStart)] assert.True(t, seg.Equal(&compare)) r.ctx.Close() } results = results[:0] } }() } // Wait for all routines to be ready then start. readyWg.Wait() startWg.Done() // Wait until done. enqueueWg.Wait() // Verify the onRetrieve callback was called properly for everything. for _, shard := range shardIDStrings { for _, id := range shard { retrievedIDsMutex.Lock() tags, ok := retrievedIDs[id] retrievedIDsMutex.Unlock() require.True(t, ok, fmt.Sprintf("expected %s to be retrieved, but it was not", id)) expectedTags := ident.NewTags(testTagsFromTestID(id)...) require.True(t, tags.Equal(expectedTags)) } } } // TestBlockRetrieverIDDoesNotExist verifies the behavior of the Stream() method // on the retriever in the case where the requested ID does not exist. In that // case, Stream() should return an empty segment. func TestBlockRetrieverIDDoesNotExist(t *testing.T) { // Make sure reader/writer are looking at the same test directory dir, err := ioutil.TempDir("", "testdb") require.NoError(t, err) defer os.RemoveAll(dir) filePathPrefix := filepath.Join(dir, "") // Setup constants and config fsOpts := testDefaultOpts.SetFilePathPrefix(filePathPrefix) rOpts := testNs1Metadata(t).Options().RetentionOptions() shard := uint32(0) blockStart := time.Now().Truncate(rOpts.BlockSize()) // Setup the reader opts := testBlockRetrieverOptions{ retrieverOpts: NewBlockRetrieverOptions(), fsOpts: fsOpts, } retriever, cleanup := newOpenTestBlockRetriever(t, opts) defer cleanup() // Write out a test file w, closer := newOpenTestWriter(t, fsOpts, shard, blockStart) data := checked.NewBytes([]byte("Hello world!"), nil) data.IncRef() defer data.DecRef() err = w.Write(ident.StringID("exists"), ident.Tags{}, data, digest.Checksum(data.Bytes())) assert.NoError(t, err) closer() // Make sure we return the correct error if the ID does not exist ctx := context.NewContext() defer ctx.Close() segmentReader, err := retriever.Stream(ctx, shard, ident.StringID("not-exists"), blockStart, nil) assert.NoError(t, err) segment, err := segmentReader.Segment() assert.NoError(t, err) assert.Equal(t, nil, segment.Head) assert.Equal(t, nil, segment.Tail) } // TestBlockRetrieverHandlesErrors verifies the behavior of the Stream() method // on the retriever in the case where the SeekIndexEntry function returns an // error. func TestBlockRetrieverHandlesSeekIndexEntryErrors(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() mockSeeker := NewMockConcurrentDataFileSetSeeker(ctrl) mockSeeker.EXPECT().SeekIndexEntry(gomock.Any(), gomock.Any()).Return(IndexEntry{}, errSeekErr) testBlockRetrieverHandlesSeekErrors(t, ctrl, mockSeeker) } // TestBlockRetrieverHandlesErrors verifies the behavior of the Stream() method // on the retriever in the case where the SeekByIndexEntry function returns an // error. func TestBlockRetrieverHandlesSeekByIndexEntryErrors(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() mockSeeker := NewMockConcurrentDataFileSetSeeker(ctrl) mockSeeker.EXPECT().SeekIndexEntry(gomock.Any(), gomock.Any()).Return(IndexEntry{}, nil) mockSeeker.EXPECT().SeekByIndexEntry(gomock.Any(), gomock.Any()).Return(nil, errSeekErr) testBlockRetrieverHandlesSeekErrors(t, ctrl, mockSeeker) } var errSeekErr = errors.New("some-error") func testBlockRetrieverHandlesSeekErrors(t *testing.T, ctrl *gomock.Controller, mockSeeker ConcurrentDataFileSetSeeker) { // Make sure reader/writer are looking at the same test directory. dir, err := ioutil.TempDir("", "testdb") require.NoError(t, err) defer os.RemoveAll(dir) filePathPrefix := filepath.Join(dir, "") // Setup constants and config. var ( fsOpts = testDefaultOpts.SetFilePathPrefix(filePathPrefix) rOpts = testNs1Metadata(t).Options().RetentionOptions() shard = uint32(0) blockStart = time.Now().Truncate(rOpts.BlockSize()) // Always true because all the bits in 255 are set. bloomBytes = []byte{255, 255, 255, 255, 255, 255, 255, 255} alwaysTrueBloomFilter = bloom.NewConcurrentReadOnlyBloomFilter(1, 1, bloomBytes) managedBloomFilter = newManagedConcurrentBloomFilter(alwaysTrueBloomFilter, bloomBytes) ) mockSeekerManager := NewMockDataFileSetSeekerManager(ctrl) mockSeekerManager.EXPECT().Open(gomock.Any()).Return(nil) mockSeekerManager.EXPECT().ConcurrentIDBloomFilter(gomock.Any(), gomock.Any()).Return(managedBloomFilter, nil) mockSeekerManager.EXPECT().Borrow(gomock.Any(), gomock.Any()).Return(mockSeeker, nil) mockSeekerManager.EXPECT().Return(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) mockSeekerManager.EXPECT().Close().Return(nil) newSeekerMgr := func( bytesPool pool.CheckedBytesPool, opts Options, fetchConcurrency int, ) DataFileSetSeekerManager { return mockSeekerManager } // Setup the reader. opts := testBlockRetrieverOptions{ retrieverOpts: NewBlockRetrieverOptions(), fsOpts: fsOpts, newSeekerMgrFn: newSeekerMgr, } retriever, cleanup := newOpenTestBlockRetriever(t, opts) defer cleanup() // Make sure we return the correct error. ctx := context.NewContext() defer ctx.Close() segmentReader, err := retriever.Stream(ctx, shard, ident.StringID("not-exists"), blockStart, nil) require.NoError(t, err) segment, err := segmentReader.Segment() assert.Equal(t, errSeekErr, err) assert.Equal(t, nil, segment.Head) assert.Equal(t, nil, segment.Tail) } func testTagsFromTestID(seriesID string) []ident.Tag { tags := []ident.Tag{} for j := 0; j < 5; j++ { tags = append(tags, ident.Tag{ Name: ident.StringID(fmt.Sprintf("%s.tag.%d.name", seriesID, j)), Value: ident.StringID(fmt.Sprintf("%s.tag.%d.value", seriesID, j)), }) } return tags }
// Copyright (c) 2016 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy
dma.rs
#[derive(Clone, Copy, PartialEq, Eq)] #[doc="DMA Peripheral"] pub struct DmaPeriph(pub usize); pub struct DmaCh { pub periph: DmaPeriph, pub index: usize } impl DmaPeriph { #[doc="Get the LISR Register."] #[inline] pub fn lisr_reg(&self) -> ::bobbin_mcu::register::Register<Lisr> { ::bobbin_mcu::register::Register::new(self.0 as *mut Lisr, 0x0) } #[doc="Get the *mut pointer for the LISR register."] #[inline] pub fn lisr_mut(&self) -> *mut Lisr { self.lisr_reg().ptr() } #[doc="Get the *const pointer for the LISR register."] #[inline] pub fn lisr_ptr(&self) -> *const Lisr { self.lisr_reg().ptr() } #[doc="Read the LISR register."] #[inline] pub fn lisr(&self) -> Lisr { self.lisr_reg().read() } #[doc="Get the HISR Register."] #[inline] pub fn hisr_reg(&self) -> ::bobbin_mcu::register::Register<Hisr> { ::bobbin_mcu::register::Register::new(self.0 as *mut Hisr, 0x4) } #[doc="Get the *mut pointer for the HISR register."] #[inline] pub fn hisr_mut(&self) -> *mut Hisr { self.hisr_reg().ptr() } #[doc="Get the *const pointer for the HISR register."] #[inline] pub fn hisr_ptr(&self) -> *const Hisr { self.hisr_reg().ptr() } #[doc="Read the HISR register."] #[inline] pub fn hisr(&self) -> Hisr { self.hisr_reg().read() } #[doc="Get the LIFCR Register."] #[inline] pub fn lifcr_reg(&self) -> ::bobbin_mcu::register::Register<Lifcr> { ::bobbin_mcu::register::Register::new(self.0 as *mut Lifcr, 0x8) } #[doc="Get the *mut pointer for the LIFCR register."] #[inline] pub fn lifcr_mut(&self) -> *mut Lifcr { self.lifcr_reg().ptr() } #[doc="Get the *const pointer for the LIFCR register."] #[inline] pub fn lifcr_ptr(&self) -> *const Lifcr { self.lifcr_reg().ptr() } #[doc="Read the LIFCR register."] #[inline] pub fn lifcr(&self) -> Lifcr { self.lifcr_reg().read() } #[doc="Write the LIFCR register."] #[inline] pub fn write_lifcr(&self, value: Lifcr) -> &Self { self.lifcr_reg().write(value); self } #[doc="Set the LIFCR register."] #[inline] pub fn set_lifcr<F: FnOnce(Lifcr) -> Lifcr>(&self, f: F) -> &Self { self.lifcr_reg().set(f); self } #[doc="Modify the LIFCR register."] #[inline] pub fn with_lifcr<F: FnOnce(Lifcr) -> Lifcr>(&self, f: F) -> &Self { self.lifcr_reg().with(f); self } #[doc="Get the HIFCR Register."] #[inline] pub fn hifcr_reg(&self) -> ::bobbin_mcu::register::Register<Hifcr> { ::bobbin_mcu::register::Register::new(self.0 as *mut Hifcr, 0xc) } #[doc="Get the *mut pointer for the HIFCR register."] #[inline] pub fn hifcr_mut(&self) -> *mut Hifcr { self.hifcr_reg().ptr() } #[doc="Get the *const pointer for the HIFCR register."] #[inline] pub fn hifcr_ptr(&self) -> *const Hifcr { self.hifcr_reg().ptr() } #[doc="Read the HIFCR register."] #[inline] pub fn hifcr(&self) -> Hifcr { self.hifcr_reg().read() } #[doc="Write the HIFCR register."] #[inline] pub fn write_hifcr(&self, value: Hifcr) -> &Self { self.hifcr_reg().write(value); self } #[doc="Set the HIFCR register."] #[inline] pub fn set_hifcr<F: FnOnce(Hifcr) -> Hifcr>(&self, f: F) -> &Self { self.hifcr_reg().set(f); self } #[doc="Modify the HIFCR register."] #[inline] pub fn with_hifcr<F: FnOnce(Hifcr) -> Hifcr>(&self, f: F) -> &Self { self.hifcr_reg().with(f); self } #[doc="Get the SCR Register."] #[inline] pub fn scr_reg(&self) -> ::bobbin_mcu::register::RegisterArray<Scr, ::bobbin_bits::R8> { ::bobbin_mcu::register::RegisterArray::new(self.0 as *mut Scr, 0x10, 0x18) } #[doc="Get the *mut pointer for the SCR register."] #[inline] pub fn scr_mut<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *mut Scr { self.scr_reg().ptr(index.into()) } #[doc="Get the *const pointer for the SCR register."] #[inline] pub fn scr_ptr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *const Scr { self.scr_reg().ptr(index.into()) } #[doc="Read the SCR register."] #[inline] pub fn scr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> Scr { self.scr_reg().read(index.into()) } #[doc="Write the SCR register."] #[inline] pub fn write_scr<I: Into<::bobbin_bits::R8>>(&self, index: I, value: Scr) -> &Self { self.scr_reg().write(index.into(), value); self } #[doc="Set the SCR register."] #[inline] pub fn set_scr<I: Into<::bobbin_bits::R8>, F: FnOnce(Scr) -> Scr>(&self, index: I, f: F) -> &Self { self.scr_reg().set(index.into(), f); self } #[doc="Modify the SCR register."] #[inline] pub fn with_scr<I: Into<::bobbin_bits::R8> + Copy, F: FnOnce(Scr) -> Scr>(&self, index: I, f: F) -> &Self { self.scr_reg().with(index.into(), f); self } #[doc="Get the SNDTR Register."] #[inline] pub fn sndtr_reg(&self) -> ::bobbin_mcu::register::RegisterArray<Sndtr, ::bobbin_bits::R8> { ::bobbin_mcu::register::RegisterArray::new(self.0 as *mut Sndtr, 0x14, 0x18) } #[doc="Get the *mut pointer for the SNDTR register."] #[inline] pub fn sndtr_mut<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *mut Sndtr { self.sndtr_reg().ptr(index.into()) } #[doc="Get the *const pointer for the SNDTR register."] #[inline] pub fn sndtr_ptr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *const Sndtr { self.sndtr_reg().ptr(index.into()) } #[doc="Read the SNDTR register."] #[inline] pub fn sndtr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> Sndtr { self.sndtr_reg().read(index.into()) } #[doc="Write the SNDTR register."] #[inline] pub fn write_sndtr<I: Into<::bobbin_bits::R8>>(&self, index: I, value: Sndtr) -> &Self { self.sndtr_reg().write(index.into(), value); self } #[doc="Set the SNDTR register."] #[inline] pub fn set_sndtr<I: Into<::bobbin_bits::R8>, F: FnOnce(Sndtr) -> Sndtr>(&self, index: I, f: F) -> &Self { self.sndtr_reg().set(index.into(), f); self } #[doc="Modify the SNDTR register."] #[inline] pub fn with_sndtr<I: Into<::bobbin_bits::R8> + Copy, F: FnOnce(Sndtr) -> Sndtr>(&self, index: I, f: F) -> &Self { self.sndtr_reg().with(index.into(), f); self } #[doc="Get the SPAR Register."] #[inline] pub fn spar_reg(&self) -> ::bobbin_mcu::register::RegisterArray<Spar, ::bobbin_bits::R8> { ::bobbin_mcu::register::RegisterArray::new(self.0 as *mut Spar, 0x18, 0x18) } #[doc="Get the *mut pointer for the SPAR register."] #[inline] pub fn spar_mut<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *mut Spar { self.spar_reg().ptr(index.into()) } #[doc="Get the *const pointer for the SPAR register."] #[inline] pub fn spar_ptr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *const Spar { self.spar_reg().ptr(index.into()) } #[doc="Read the SPAR register."] #[inline] pub fn spar<I: Into<::bobbin_bits::R8>>(&self, index: I) -> Spar { self.spar_reg().read(index.into()) } #[doc="Write the SPAR register."] #[inline] pub fn write_spar<I: Into<::bobbin_bits::R8>>(&self, index: I, value: Spar) -> &Self { self.spar_reg().write(index.into(), value); self } #[doc="Set the SPAR register."] #[inline] pub fn set_spar<I: Into<::bobbin_bits::R8>, F: FnOnce(Spar) -> Spar>(&self, index: I, f: F) -> &Self { self.spar_reg().set(index.into(), f); self } #[doc="Modify the SPAR register."] #[inline] pub fn with_spar<I: Into<::bobbin_bits::R8> + Copy, F: FnOnce(Spar) -> Spar>(&self, index: I, f: F) -> &Self { self.spar_reg().with(index.into(), f); self } #[doc="Get the SM0AR Register."] #[inline] pub fn sm0ar_reg(&self) -> ::bobbin_mcu::register::RegisterArray<Sm0ar, ::bobbin_bits::R8> { ::bobbin_mcu::register::RegisterArray::new(self.0 as *mut Sm0ar, 0x1c, 0x18) } #[doc="Get the *mut pointer for the SM0AR register."] #[inline] pub fn sm0ar_mut<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *mut Sm0ar { self.sm0ar_reg().ptr(index.into()) } #[doc="Get the *const pointer for the SM0AR register."] #[inline] pub fn sm0ar_ptr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *const Sm0ar { self.sm0ar_reg().ptr(index.into()) } #[doc="Read the SM0AR register."] #[inline] pub fn sm0ar<I: Into<::bobbin_bits::R8>>(&self, index: I) -> Sm0ar { self.sm0ar_reg().read(index.into()) } #[doc="Write the SM0AR register."] #[inline] pub fn write_sm0ar<I: Into<::bobbin_bits::R8>>(&self, index: I, value: Sm0ar) -> &Self { self.sm0ar_reg().write(index.into(), value); self } #[doc="Set the SM0AR register."] #[inline] pub fn set_sm0ar<I: Into<::bobbin_bits::R8>, F: FnOnce(Sm0ar) -> Sm0ar>(&self, index: I, f: F) -> &Self { self.sm0ar_reg().set(index.into(), f); self } #[doc="Modify the SM0AR register."] #[inline] pub fn with_sm0ar<I: Into<::bobbin_bits::R8> + Copy, F: FnOnce(Sm0ar) -> Sm0ar>(&self, index: I, f: F) -> &Self { self.sm0ar_reg().with(index.into(), f); self } #[doc="Get the SM1AR Register."] #[inline] pub fn sm1ar_reg(&self) -> ::bobbin_mcu::register::RegisterArray<Sm1ar, ::bobbin_bits::R8> { ::bobbin_mcu::register::RegisterArray::new(self.0 as *mut Sm1ar, 0x20, 0x18) } #[doc="Get the *mut pointer for the SM1AR register."] #[inline] pub fn sm1ar_mut<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *mut Sm1ar { self.sm1ar_reg().ptr(index.into()) } #[doc="Get the *const pointer for the SM1AR register."] #[inline] pub fn sm1ar_ptr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *const Sm1ar { self.sm1ar_reg().ptr(index.into()) } #[doc="Read the SM1AR register."] #[inline] pub fn sm1ar<I: Into<::bobbin_bits::R8>>(&self, index: I) -> Sm1ar { self.sm1ar_reg().read(index.into()) } #[doc="Write the SM1AR register."] #[inline] pub fn write_sm1ar<I: Into<::bobbin_bits::R8>>(&self, index: I, value: Sm1ar) -> &Self { self.sm1ar_reg().write(index.into(), value); self } #[doc="Set the SM1AR register."] #[inline] pub fn set_sm1ar<I: Into<::bobbin_bits::R8>, F: FnOnce(Sm1ar) -> Sm1ar>(&self, index: I, f: F) -> &Self { self.sm1ar_reg().set(index.into(), f); self } #[doc="Modify the SM1AR register."] #[inline] pub fn with_sm1ar<I: Into<::bobbin_bits::R8> + Copy, F: FnOnce(Sm1ar) -> Sm1ar>(&self, index: I, f: F) -> &Self { self.sm1ar_reg().with(index.into(), f); self } #[doc="Get the SFCR Register."] #[inline] pub fn sfcr_reg(&self) -> ::bobbin_mcu::register::RegisterArray<Sfcr, ::bobbin_bits::R8> { ::bobbin_mcu::register::RegisterArray::new(self.0 as *mut Sfcr, 0x24, 0x18) } #[doc="Get the *mut pointer for the SFCR register."] #[inline] pub fn sfcr_mut<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *mut Sfcr { self.sfcr_reg().ptr(index.into()) } #[doc="Get the *const pointer for the SFCR register."] #[inline] pub fn sfcr_ptr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> *const Sfcr { self.sfcr_reg().ptr(index.into()) } #[doc="Read the SFCR register."] #[inline] pub fn sfcr<I: Into<::bobbin_bits::R8>>(&self, index: I) -> Sfcr { self.sfcr_reg().read(index.into()) } #[doc="Write the SFCR register."] #[inline] pub fn write_sfcr<I: Into<::bobbin_bits::R8>>(&self, index: I, value: Sfcr) -> &Self { self.sfcr_reg().write(index.into(), value); self } #[doc="Set the SFCR register."] #[inline] pub fn set_sfcr<I: Into<::bobbin_bits::R8>, F: FnOnce(Sfcr) -> Sfcr>(&self, index: I, f: F) -> &Self { self.sfcr_reg().set(index.into(), f); self } #[doc="Modify the SFCR register."] #[inline] pub fn with_sfcr<I: Into<::bobbin_bits::R8> + Copy, F: FnOnce(Sfcr) -> Sfcr>(&self, index: I, f: F) -> &Self { self.sfcr_reg().with(index.into(), f); self } } #[doc="low interrupt status register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Lisr(pub u32); impl Lisr { #[doc="Stream x transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn tcif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 27) & 0x1) as u8) } // [27] } #[doc="Returns true if TCIF3 != 0"] #[inline] pub fn test_tcif3(&self) -> bool { self.tcif3() != 0 } #[doc="Sets the TCIF3 field."] #[inline] pub fn set_tcif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 27); self.0 |= value << 27; self } #[doc="Stream x half transfer interrupt flag (x=3..0)"] #[inline] pub fn htif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 26) & 0x1) as u8) } // [26] } #[doc="Returns true if HTIF3 != 0"] #[inline] pub fn test_htif3(&self) -> bool { self.htif3() != 0 } #[doc="Sets the HTIF3 field."] #[inline] pub fn set_htif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 26); self.0 |= value << 26; self } #[doc="Stream x transfer error interrupt flag (x=3..0)"] #[inline] pub fn teif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 25) & 0x1) as u8) } // [25] } #[doc="Returns true if TEIF3 != 0"] #[inline] pub fn test_teif3(&self) -> bool { self.teif3() != 0 } #[doc="Sets the TEIF3 field."] #[inline] pub fn set_teif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 25); self.0 |= value << 25; self } #[doc="Stream x direct mode error interrupt flag (x=3..0)"] #[inline] pub fn dmeif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 24) & 0x1) as u8) } // [24] } #[doc="Returns true if DMEIF3 != 0"] #[inline] pub fn test_dmeif3(&self) -> bool { self.dmeif3() != 0 } #[doc="Sets the DMEIF3 field."] #[inline] pub fn set_dmeif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 24); self.0 |= value << 24; self } #[doc="Stream x FIFO error interrupt flag (x=3..0)"] #[inline] pub fn feif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 22) & 0x1) as u8) } // [22] } #[doc="Returns true if FEIF3 != 0"] #[inline] pub fn test_feif3(&self) -> bool { self.feif3() != 0 } #[doc="Sets the FEIF3 field."] #[inline] pub fn set_feif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 22); self.0 |= value << 22; self } #[doc="Stream x transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn tcif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 21) & 0x1) as u8) } // [21] } #[doc="Returns true if TCIF2 != 0"] #[inline] pub fn test_tcif2(&self) -> bool { self.tcif2() != 0 } #[doc="Sets the TCIF2 field."] #[inline] pub fn set_tcif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 21); self.0 |= value << 21; self } #[doc="Stream x half transfer interrupt flag (x=3..0)"] #[inline] pub fn htif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 20) & 0x1) as u8) } // [20] } #[doc="Returns true if HTIF2 != 0"] #[inline] pub fn test_htif2(&self) -> bool { self.htif2() != 0 } #[doc="Sets the HTIF2 field."] #[inline] pub fn set_htif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 20); self.0 |= value << 20; self } #[doc="Stream x transfer error interrupt flag (x=3..0)"] #[inline] pub fn teif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 19) & 0x1) as u8) } // [19] } #[doc="Returns true if TEIF2 != 0"] #[inline] pub fn test_teif2(&self) -> bool { self.teif2() != 0 } #[doc="Sets the TEIF2 field."] #[inline] pub fn set_teif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 19); self.0 |= value << 19; self } #[doc="Stream x direct mode error interrupt flag (x=3..0)"] #[inline] pub fn dmeif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 18) & 0x1) as u8) } // [18] } #[doc="Returns true if DMEIF2 != 0"] #[inline] pub fn test_dmeif2(&self) -> bool { self.dmeif2() != 0 } #[doc="Sets the DMEIF2 field."] #[inline] pub fn set_dmeif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 18); self.0 |= value << 18; self } #[doc="Stream x FIFO error interrupt flag (x=3..0)"] #[inline] pub fn feif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 16) & 0x1) as u8) } // [16] } #[doc="Returns true if FEIF2 != 0"] #[inline] pub fn test_feif2(&self) -> bool { self.feif2() != 0 } #[doc="Sets the FEIF2 field."] #[inline] pub fn set_feif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 16); self.0 |= value << 16; self } #[doc="Stream x transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn tcif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 11) & 0x1) as u8) } // [11] } #[doc="Returns true if TCIF1 != 0"] #[inline] pub fn test_tcif1(&self) -> bool { self.tcif1() != 0 } #[doc="Sets the TCIF1 field."] #[inline] pub fn set_tcif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 11); self.0 |= value << 11; self } #[doc="Stream x half transfer interrupt flag (x=3..0)"] #[inline] pub fn htif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 10) & 0x1) as u8) } // [10] } #[doc="Returns true if HTIF1 != 0"] #[inline] pub fn test_htif1(&self) -> bool { self.htif1() != 0 } #[doc="Sets the HTIF1 field."] #[inline] pub fn set_htif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 10); self.0 |= value << 10; self } #[doc="Stream x transfer error interrupt flag (x=3..0)"] #[inline] pub fn teif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 9) & 0x1) as u8) } // [9] } #[doc="Returns true if TEIF1 != 0"] #[inline] pub fn test_teif1(&self) -> bool { self.teif1() != 0 } #[doc="Sets the TEIF1 field."] #[inline] pub fn set_teif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 9); self.0 |= value << 9; self } #[doc="Stream x direct mode error interrupt flag (x=3..0)"] #[inline] pub fn dmeif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 8) & 0x1) as u8) } // [8] } #[doc="Returns true if DMEIF1 != 0"] #[inline] pub fn test_dmeif1(&self) -> bool { self.dmeif1() != 0 } #[doc="Sets the DMEIF1 field."] #[inline] pub fn set_dmeif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 8); self.0 |= value << 8; self } #[doc="Stream x FIFO error interrupt flag (x=3..0)"] #[inline] pub fn feif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 6) & 0x1) as u8) } // [6] } #[doc="Returns true if FEIF1 != 0"] #[inline] pub fn test_feif1(&self) -> bool { self.feif1() != 0 } #[doc="Sets the FEIF1 field."] #[inline] pub fn set_feif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 6); self.0 |= value << 6; self } #[doc="Stream x transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn tcif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 5) & 0x1) as u8) } // [5] } #[doc="Returns true if TCIF0 != 0"] #[inline] pub fn test_tcif0(&self) -> bool { self.tcif0() != 0 } #[doc="Sets the TCIF0 field."] #[inline] pub fn set_tcif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 5); self.0 |= value << 5; self } #[doc="Stream x half transfer interrupt flag (x=3..0)"] #[inline] pub fn htif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 4) & 0x1) as u8) } // [4] } #[doc="Returns true if HTIF0 != 0"] #[inline] pub fn test_htif0(&self) -> bool { self.htif0() != 0 } #[doc="Sets the HTIF0 field."] #[inline] pub fn set_htif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 4); self.0 |= value << 4; self } #[doc="Stream x transfer error interrupt flag (x=3..0)"] #[inline] pub fn teif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 3) & 0x1) as u8) } // [3] } #[doc="Returns true if TEIF0 != 0"] #[inline] pub fn test_teif0(&self) -> bool { self.teif0() != 0 } #[doc="Sets the TEIF0 field."] #[inline] pub fn set_teif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 3); self.0 |= value << 3; self } #[doc="Stream x direct mode error interrupt flag (x=3..0)"] #[inline] pub fn dmeif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 2) & 0x1) as u8) } // [2] } #[doc="Returns true if DMEIF0 != 0"] #[inline] pub fn test_dmeif0(&self) -> bool { self.dmeif0() != 0 } #[doc="Sets the DMEIF0 field."] #[inline] pub fn set_dmeif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 2); self.0 |= value << 2; self } #[doc="Stream x FIFO error interrupt flag (x=3..0)"] #[inline] pub fn feif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x1) as u8) } // [0] } #[doc="Returns true if FEIF0 != 0"] #[inline] pub fn test_feif0(&self) -> bool { self.feif0() != 0 } #[doc="Sets the FEIF0 field."] #[inline] pub fn set_feif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 0); self.0 |= value << 0; self } } impl From<u32> for Lisr { #[inline] fn from(other: u32) -> Self { Lisr(other) } } impl ::core::fmt::Display for Lisr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Lisr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); if self.tcif3() != 0 { try!(write!(f, " tcif3"))} if self.htif3() != 0 { try!(write!(f, " htif3"))} if self.teif3() != 0 { try!(write!(f, " teif3"))} if self.dmeif3() != 0 { try!(write!(f, " dmeif3"))} if self.feif3() != 0 { try!(write!(f, " feif3"))} if self.tcif2() != 0 { try!(write!(f, " tcif2"))} if self.htif2() != 0 { try!(write!(f, " htif2"))} if self.teif2() != 0 { try!(write!(f, " teif2"))} if self.dmeif2() != 0 { try!(write!(f, " dmeif2"))} if self.feif2() != 0 { try!(write!(f, " feif2"))} if self.tcif1() != 0 { try!(write!(f, " tcif1"))} if self.htif1() != 0 { try!(write!(f, " htif1"))} if self.teif1() != 0 { try!(write!(f, " teif1"))} if self.dmeif1() != 0 { try!(write!(f, " dmeif1"))} if self.feif1() != 0 { try!(write!(f, " feif1"))} if self.tcif0() != 0 { try!(write!(f, " tcif0"))} if self.htif0() != 0 { try!(write!(f, " htif0"))} if self.teif0() != 0 { try!(write!(f, " teif0"))} if self.dmeif0() != 0 { try!(write!(f, " dmeif0"))} if self.feif0() != 0 { try!(write!(f, " feif0"))} try!(write!(f, "]")); Ok(()) } } #[doc="high interrupt status register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Hisr(pub u32); impl Hisr { #[doc="Stream x transfer complete interrupt flag (x=7..4)"] #[inline] pub fn tcif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 27) & 0x1) as u8) } // [27] } #[doc="Returns true if TCIF7 != 0"] #[inline] pub fn test_tcif7(&self) -> bool { self.tcif7() != 0 } #[doc="Sets the TCIF7 field."] #[inline] pub fn set_tcif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 27); self.0 |= value << 27; self } #[doc="Stream x half transfer interrupt flag (x=7..4)"] #[inline] pub fn htif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 26) & 0x1) as u8) } // [26] } #[doc="Returns true if HTIF7 != 0"] #[inline] pub fn test_htif7(&self) -> bool { self.htif7() != 0 } #[doc="Sets the HTIF7 field."] #[inline] pub fn set_htif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 26); self.0 |= value << 26; self } #[doc="Stream x transfer error interrupt flag (x=7..4)"] #[inline] pub fn teif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 25) & 0x1) as u8) } // [25] } #[doc="Returns true if TEIF7 != 0"] #[inline] pub fn test_teif7(&self) -> bool { self.teif7() != 0 } #[doc="Sets the TEIF7 field."] #[inline] pub fn set_teif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 25); self.0 |= value << 25; self } #[doc="Stream x direct mode error interrupt flag (x=7..4)"] #[inline] pub fn dmeif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 24) & 0x1) as u8) } // [24] } #[doc="Returns true if DMEIF7 != 0"] #[inline] pub fn test_dmeif7(&self) -> bool { self.dmeif7() != 0 } #[doc="Sets the DMEIF7 field."] #[inline] pub fn set_dmeif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 24); self.0 |= value << 24; self } #[doc="Stream x FIFO error interrupt flag (x=7..4)"] #[inline] pub fn feif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 22) & 0x1) as u8) } // [22] } #[doc="Returns true if FEIF7 != 0"] #[inline] pub fn test_feif7(&self) -> bool { self.feif7() != 0 } #[doc="Sets the FEIF7 field."] #[inline] pub fn set_feif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 22); self.0 |= value << 22; self } #[doc="Stream x transfer complete interrupt flag (x=7..4)"] #[inline] pub fn tcif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 21) & 0x1) as u8) } // [21] } #[doc="Returns true if TCIF6 != 0"] #[inline] pub fn test_tcif6(&self) -> bool { self.tcif6() != 0 } #[doc="Sets the TCIF6 field."] #[inline] pub fn set_tcif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 21); self.0 |= value << 21; self } #[doc="Stream x half transfer interrupt flag (x=7..4)"] #[inline] pub fn htif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 20) & 0x1) as u8) } // [20] } #[doc="Returns true if HTIF6 != 0"] #[inline] pub fn test_htif6(&self) -> bool { self.htif6() != 0 } #[doc="Sets the HTIF6 field."] #[inline] pub fn set_htif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 20); self.0 |= value << 20; self } #[doc="Stream x transfer error interrupt flag (x=7..4)"] #[inline] pub fn teif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 19) & 0x1) as u8) } // [19] } #[doc="Returns true if TEIF6 != 0"] #[inline] pub fn test_teif6(&self) -> bool { self.teif6() != 0 } #[doc="Sets the TEIF6 field."] #[inline] pub fn set_teif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 19); self.0 |= value << 19; self } #[doc="Stream x direct mode error interrupt flag (x=7..4)"] #[inline] pub fn dmeif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 18) & 0x1) as u8) } // [18] } #[doc="Returns true if DMEIF6 != 0"] #[inline] pub fn test_dmeif6(&self) -> bool { self.dmeif6() != 0 } #[doc="Sets the DMEIF6 field."] #[inline] pub fn set_dmeif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 18); self.0 |= value << 18; self } #[doc="Stream x FIFO error interrupt flag (x=7..4)"] #[inline] pub fn feif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 16) & 0x1) as u8) } // [16] } #[doc="Returns true if FEIF6 != 0"] #[inline] pub fn test_feif6(&self) -> bool { self.feif6() != 0 } #[doc="Sets the FEIF6 field."] #[inline] pub fn set_feif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 16); self.0 |= value << 16; self } #[doc="Stream x transfer complete interrupt flag (x=7..4)"] #[inline] pub fn tcif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 11) & 0x1) as u8) } // [11] } #[doc="Returns true if TCIF5 != 0"] #[inline] pub fn test_tcif5(&self) -> bool { self.tcif5() != 0 } #[doc="Sets the TCIF5 field."] #[inline] pub fn set_tcif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 11); self.0 |= value << 11; self } #[doc="Stream x half transfer interrupt flag (x=7..4)"] #[inline] pub fn htif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 10) & 0x1) as u8) } // [10] } #[doc="Returns true if HTIF5 != 0"] #[inline] pub fn test_htif5(&self) -> bool { self.htif5() != 0 } #[doc="Sets the HTIF5 field."] #[inline] pub fn set_htif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 10); self.0 |= value << 10; self } #[doc="Stream x transfer error interrupt flag (x=7..4)"] #[inline] pub fn teif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 9) & 0x1) as u8) } // [9] } #[doc="Returns true if TEIF5 != 0"] #[inline] pub fn test_teif5(&self) -> bool { self.teif5() != 0 } #[doc="Sets the TEIF5 field."] #[inline] pub fn set_teif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 9); self.0 |= value << 9; self } #[doc="Stream x direct mode error interrupt flag (x=7..4)"] #[inline] pub fn dmeif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 8) & 0x1) as u8) } // [8] } #[doc="Returns true if DMEIF5 != 0"] #[inline] pub fn test_dmeif5(&self) -> bool { self.dmeif5() != 0 } #[doc="Sets the DMEIF5 field."] #[inline] pub fn set_dmeif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 8); self.0 |= value << 8; self } #[doc="Stream x FIFO error interrupt flag (x=7..4)"] #[inline] pub fn feif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 6) & 0x1) as u8) } // [6] } #[doc="Returns true if FEIF5 != 0"] #[inline] pub fn test_feif5(&self) -> bool { self.feif5() != 0 } #[doc="Sets the FEIF5 field."] #[inline] pub fn set_feif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 6); self.0 |= value << 6; self } #[doc="Stream x transfer complete interrupt flag (x=7..4)"] #[inline] pub fn tcif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 5) & 0x1) as u8) } // [5] } #[doc="Returns true if TCIF4 != 0"] #[inline] pub fn test_tcif4(&self) -> bool { self.tcif4() != 0 } #[doc="Sets the TCIF4 field."] #[inline] pub fn set_tcif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 5); self.0 |= value << 5; self } #[doc="Stream x half transfer interrupt flag (x=7..4)"] #[inline] pub fn htif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 4) & 0x1) as u8) } // [4] } #[doc="Returns true if HTIF4 != 0"] #[inline] pub fn test_htif4(&self) -> bool { self.htif4() != 0 } #[doc="Sets the HTIF4 field."] #[inline] pub fn set_htif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 4); self.0 |= value << 4; self } #[doc="Stream x transfer error interrupt flag (x=7..4)"] #[inline] pub fn teif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 3) & 0x1) as u8) } // [3] } #[doc="Returns true if TEIF4 != 0"] #[inline] pub fn test_teif4(&self) -> bool { self.teif4() != 0 } #[doc="Sets the TEIF4 field."] #[inline] pub fn set_teif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 3); self.0 |= value << 3; self } #[doc="Stream x direct mode error interrupt flag (x=7..4)"] #[inline] pub fn dmeif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 2) & 0x1) as u8) } // [2] } #[doc="Returns true if DMEIF4 != 0"] #[inline] pub fn test_dmeif4(&self) -> bool { self.dmeif4() != 0 } #[doc="Sets the DMEIF4 field."] #[inline] pub fn set_dmeif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 2); self.0 |= value << 2; self } #[doc="Stream x FIFO error interrupt flag (x=7..4)"] #[inline] pub fn feif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x1) as u8) } // [0] } #[doc="Returns true if FEIF4 != 0"] #[inline] pub fn test_feif4(&self) -> bool { self.feif4() != 0 } #[doc="Sets the FEIF4 field."] #[inline] pub fn set_feif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 0); self.0 |= value << 0; self } } impl From<u32> for Hisr { #[inline] fn from(other: u32) -> Self { Hisr(other) } } impl ::core::fmt::Display for Hisr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Hisr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); if self.tcif7() != 0 { try!(write!(f, " tcif7"))} if self.htif7() != 0 { try!(write!(f, " htif7"))} if self.teif7() != 0 { try!(write!(f, " teif7"))} if self.dmeif7() != 0 { try!(write!(f, " dmeif7"))} if self.feif7() != 0 { try!(write!(f, " feif7"))} if self.tcif6() != 0 { try!(write!(f, " tcif6"))} if self.htif6() != 0 { try!(write!(f, " htif6"))} if self.teif6() != 0 { try!(write!(f, " teif6"))} if self.dmeif6() != 0 { try!(write!(f, " dmeif6"))} if self.feif6() != 0 { try!(write!(f, " feif6"))} if self.tcif5() != 0 { try!(write!(f, " tcif5"))} if self.htif5() != 0 { try!(write!(f, " htif5"))} if self.teif5() != 0 { try!(write!(f, " teif5"))} if self.dmeif5() != 0 { try!(write!(f, " dmeif5"))} if self.feif5() != 0 { try!(write!(f, " feif5"))} if self.tcif4() != 0 { try!(write!(f, " tcif4"))} if self.htif4() != 0 { try!(write!(f, " htif4"))} if self.teif4() != 0 { try!(write!(f, " teif4"))} if self.dmeif4() != 0 { try!(write!(f, " dmeif4"))} if self.feif4() != 0 { try!(write!(f, " feif4"))} try!(write!(f, "]")); Ok(()) } } #[doc="low interrupt flag clear register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Lifcr(pub u32); impl Lifcr { #[doc="Stream x clear transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn ctcif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 27) & 0x1) as u8) } // [27] } #[doc="Returns true if CTCIF3 != 0"] #[inline] pub fn test_ctcif3(&self) -> bool { self.ctcif3() != 0 } #[doc="Sets the CTCIF3 field."] #[inline] pub fn set_ctcif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 27); self.0 |= value << 27; self } #[doc="Stream x clear half transfer interrupt flag (x = 3..0)"] #[inline] pub fn chtif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 26) & 0x1) as u8) } // [26] } #[doc="Returns true if CHTIF3 != 0"] #[inline] pub fn test_chtif3(&self) -> bool { self.chtif3() != 0 } #[doc="Sets the CHTIF3 field."] #[inline] pub fn set_chtif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 26); self.0 |= value << 26; self } #[doc="Stream x clear transfer error interrupt flag (x = 3..0)"] #[inline] pub fn cteif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 25) & 0x1) as u8) } // [25] } #[doc="Returns true if CTEIF3 != 0"] #[inline] pub fn test_cteif3(&self) -> bool { self.cteif3() != 0 } #[doc="Sets the CTEIF3 field."] #[inline] pub fn set_cteif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 25); self.0 |= value << 25; self } #[doc="Stream x clear direct mode error interrupt flag (x = 3..0)"] #[inline] pub fn cdmeif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 24) & 0x1) as u8) } // [24] } #[doc="Returns true if CDMEIF3 != 0"] #[inline] pub fn test_cdmeif3(&self) -> bool { self.cdmeif3() != 0 } #[doc="Sets the CDMEIF3 field."] #[inline] pub fn set_cdmeif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 24); self.0 |= value << 24; self } #[doc="Stream x clear FIFO error interrupt flag (x = 3..0)"] #[inline] pub fn cfeif3(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 22) & 0x1) as u8) } // [22] } #[doc="Returns true if CFEIF3 != 0"] #[inline] pub fn test_cfeif3(&self) -> bool { self.cfeif3() != 0 } #[doc="Sets the CFEIF3 field."] #[inline] pub fn set_cfeif3<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 22); self.0 |= value << 22; self } #[doc="Stream x clear transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn ctcif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 21) & 0x1) as u8) } // [21] } #[doc="Returns true if CTCIF2 != 0"] #[inline] pub fn test_ctcif2(&self) -> bool { self.ctcif2() != 0 } #[doc="Sets the CTCIF2 field."] #[inline] pub fn set_ctcif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 21); self.0 |= value << 21; self } #[doc="Stream x clear half transfer interrupt flag (x = 3..0)"] #[inline] pub fn chtif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 20) & 0x1) as u8) } // [20] } #[doc="Returns true if CHTIF2 != 0"] #[inline] pub fn test_chtif2(&self) -> bool { self.chtif2() != 0 } #[doc="Sets the CHTIF2 field."] #[inline] pub fn set_chtif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 20); self.0 |= value << 20; self } #[doc="Stream x clear transfer error interrupt flag (x = 3..0)"] #[inline] pub fn cteif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 19) & 0x1) as u8) } // [19] } #[doc="Returns true if CTEIF2 != 0"] #[inline] pub fn test_cteif2(&self) -> bool { self.cteif2() != 0 } #[doc="Sets the CTEIF2 field."] #[inline] pub fn set_cteif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 19); self.0 |= value << 19; self } #[doc="Stream x clear direct mode error interrupt flag (x = 3..0)"] #[inline] pub fn cdmeif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 18) & 0x1) as u8) } // [18] } #[doc="Returns true if CDMEIF2 != 0"] #[inline] pub fn test_cdmeif2(&self) -> bool { self.cdmeif2() != 0 } #[doc="Sets the CDMEIF2 field."] #[inline] pub fn set_cdmeif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 18); self.0 |= value << 18; self } #[doc="Stream x clear FIFO error interrupt flag (x = 3..0)"] #[inline] pub fn cfeif2(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 16) & 0x1) as u8) } // [16] } #[doc="Returns true if CFEIF2 != 0"] #[inline] pub fn test_cfeif2(&self) -> bool { self.cfeif2() != 0 } #[doc="Sets the CFEIF2 field."] #[inline] pub fn set_cfeif2<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 16); self.0 |= value << 16; self } #[doc="Stream x clear transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn ctcif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 11) & 0x1) as u8) } // [11] } #[doc="Returns true if CTCIF1 != 0"] #[inline] pub fn test_ctcif1(&self) -> bool { self.ctcif1() != 0 } #[doc="Sets the CTCIF1 field."] #[inline] pub fn set_ctcif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 11); self.0 |= value << 11; self } #[doc="Stream x clear half transfer interrupt flag (x = 3..0)"] #[inline] pub fn chtif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 10) & 0x1) as u8) } // [10] } #[doc="Returns true if CHTIF1 != 0"] #[inline] pub fn test_chtif1(&self) -> bool { self.chtif1() != 0 } #[doc="Sets the CHTIF1 field."] #[inline] pub fn set_chtif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 10); self.0 |= value << 10; self } #[doc="Stream x clear transfer error interrupt flag (x = 3..0)"] #[inline] pub fn cteif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 9) & 0x1) as u8) } // [9] } #[doc="Returns true if CTEIF1 != 0"] #[inline] pub fn test_cteif1(&self) -> bool { self.cteif1() != 0 } #[doc="Sets the CTEIF1 field."] #[inline] pub fn set_cteif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 9); self.0 |= value << 9; self } #[doc="Stream x clear direct mode error interrupt flag (x = 3..0)"] #[inline] pub fn cdmeif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 8) & 0x1) as u8) } // [8] } #[doc="Returns true if CDMEIF1 != 0"] #[inline] pub fn test_cdmeif1(&self) -> bool { self.cdmeif1() != 0 } #[doc="Sets the CDMEIF1 field."] #[inline] pub fn set_cdmeif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 8); self.0 |= value << 8; self } #[doc="Stream x clear FIFO error interrupt flag (x = 3..0)"] #[inline] pub fn cfeif1(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 6) & 0x1) as u8) } // [6] } #[doc="Returns true if CFEIF1 != 0"] #[inline] pub fn test_cfeif1(&self) -> bool { self.cfeif1() != 0 } #[doc="Sets the CFEIF1 field."] #[inline] pub fn set_cfeif1<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 6); self.0 |= value << 6; self } #[doc="Stream x clear transfer complete interrupt flag (x = 3..0)"] #[inline] pub fn ctcif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 5) & 0x1) as u8) } // [5] } #[doc="Returns true if CTCIF0 != 0"] #[inline] pub fn test_ctcif0(&self) -> bool { self.ctcif0() != 0 } #[doc="Sets the CTCIF0 field."] #[inline] pub fn set_ctcif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 5); self.0 |= value << 5; self } #[doc="Stream x clear half transfer interrupt flag (x = 3..0)"] #[inline] pub fn chtif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 4) & 0x1) as u8) } // [4] } #[doc="Returns true if CHTIF0 != 0"] #[inline] pub fn test_chtif0(&self) -> bool { self.chtif0() != 0 } #[doc="Sets the CHTIF0 field."] #[inline] pub fn set_chtif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 4); self.0 |= value << 4; self } #[doc="Stream x clear transfer error interrupt flag (x = 3..0)"] #[inline] pub fn cteif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 3) & 0x1) as u8) } // [3] } #[doc="Returns true if CTEIF0 != 0"] #[inline] pub fn test_cteif0(&self) -> bool { self.cteif0() != 0 } #[doc="Sets the CTEIF0 field."] #[inline] pub fn set_cteif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 3); self.0 |= value << 3; self } #[doc="Stream x clear direct mode error interrupt flag (x = 3..0)"] #[inline] pub fn cdmeif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 2) & 0x1) as u8) } // [2] } #[doc="Returns true if CDMEIF0 != 0"] #[inline] pub fn test_cdmeif0(&self) -> bool { self.cdmeif0() != 0 } #[doc="Sets the CDMEIF0 field."] #[inline] pub fn set_cdmeif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 2); self.0 |= value << 2; self } #[doc="Stream x clear FIFO error interrupt flag (x = 3..0)"] #[inline] pub fn cfeif0(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x1) as u8) } // [0] } #[doc="Returns true if CFEIF0 != 0"] #[inline] pub fn test_cfeif0(&self) -> bool { self.cfeif0() != 0 } #[doc="Sets the CFEIF0 field."] #[inline] pub fn set_cfeif0<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 0); self.0 |= value << 0; self } } impl From<u32> for Lifcr { #[inline] fn from(other: u32) -> Self { Lifcr(other) } } impl ::core::fmt::Display for Lifcr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Lifcr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); if self.ctcif3() != 0 { try!(write!(f, " ctcif3"))} if self.chtif3() != 0 { try!(write!(f, " chtif3"))} if self.cteif3() != 0 { try!(write!(f, " cteif3"))} if self.cdmeif3() != 0 { try!(write!(f, " cdmeif3"))} if self.cfeif3() != 0 { try!(write!(f, " cfeif3"))} if self.ctcif2() != 0 { try!(write!(f, " ctcif2"))} if self.chtif2() != 0 { try!(write!(f, " chtif2"))} if self.cteif2() != 0 { try!(write!(f, " cteif2"))} if self.cdmeif2() != 0 { try!(write!(f, " cdmeif2"))} if self.cfeif2() != 0 { try!(write!(f, " cfeif2"))} if self.ctcif1() != 0 { try!(write!(f, " ctcif1"))} if self.chtif1() != 0 { try!(write!(f, " chtif1"))} if self.cteif1() != 0 { try!(write!(f, " cteif1"))} if self.cdmeif1() != 0 { try!(write!(f, " cdmeif1"))} if self.cfeif1() != 0 { try!(write!(f, " cfeif1"))} if self.ctcif0() != 0 { try!(write!(f, " ctcif0"))} if self.chtif0() != 0 { try!(write!(f, " chtif0"))} if self.cteif0() != 0 { try!(write!(f, " cteif0"))} if self.cdmeif0() != 0 { try!(write!(f, " cdmeif0"))} if self.cfeif0() != 0 { try!(write!(f, " cfeif0"))} try!(write!(f, "]")); Ok(()) } } #[doc="high interrupt flag clear register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Hifcr(pub u32); impl Hifcr { #[doc="Stream x clear transfer complete interrupt flag (x = 7..4)"] #[inline] pub fn ctcif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 27) & 0x1) as u8) } // [27] } #[doc="Returns true if CTCIF7 != 0"] #[inline] pub fn test_ctcif7(&self) -> bool { self.ctcif7() != 0 } #[doc="Sets the CTCIF7 field."] #[inline] pub fn set_ctcif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 27); self.0 |= value << 27; self } #[doc="Stream x clear half transfer interrupt flag (x = 7..4)"] #[inline] pub fn chtif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 26) & 0x1) as u8) } // [26] } #[doc="Returns true if CHTIF7 != 0"] #[inline] pub fn test_chtif7(&self) -> bool { self.chtif7() != 0 } #[doc="Sets the CHTIF7 field."] #[inline] pub fn set_chtif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 26); self.0 |= value << 26; self } #[doc="Stream x clear transfer error interrupt flag (x = 7..4)"] #[inline] pub fn cteif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 25) & 0x1) as u8) } // [25] } #[doc="Returns true if CTEIF7 != 0"] #[inline] pub fn test_cteif7(&self) -> bool
#[doc="Sets the CTEIF7 field."] #[inline] pub fn set_cteif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 25); self.0 |= value << 25; self } #[doc="Stream x clear direct mode error interrupt flag (x = 7..4)"] #[inline] pub fn cdmeif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 24) & 0x1) as u8) } // [24] } #[doc="Returns true if CDMEIF7 != 0"] #[inline] pub fn test_cdmeif7(&self) -> bool { self.cdmeif7() != 0 } #[doc="Sets the CDMEIF7 field."] #[inline] pub fn set_cdmeif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 24); self.0 |= value << 24; self } #[doc="Stream x clear FIFO error interrupt flag (x = 7..4)"] #[inline] pub fn cfeif7(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 22) & 0x1) as u8) } // [22] } #[doc="Returns true if CFEIF7 != 0"] #[inline] pub fn test_cfeif7(&self) -> bool { self.cfeif7() != 0 } #[doc="Sets the CFEIF7 field."] #[inline] pub fn set_cfeif7<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 22); self.0 |= value << 22; self } #[doc="Stream x clear transfer complete interrupt flag (x = 7..4)"] #[inline] pub fn ctcif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 21) & 0x1) as u8) } // [21] } #[doc="Returns true if CTCIF6 != 0"] #[inline] pub fn test_ctcif6(&self) -> bool { self.ctcif6() != 0 } #[doc="Sets the CTCIF6 field."] #[inline] pub fn set_ctcif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 21); self.0 |= value << 21; self } #[doc="Stream x clear half transfer interrupt flag (x = 7..4)"] #[inline] pub fn chtif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 20) & 0x1) as u8) } // [20] } #[doc="Returns true if CHTIF6 != 0"] #[inline] pub fn test_chtif6(&self) -> bool { self.chtif6() != 0 } #[doc="Sets the CHTIF6 field."] #[inline] pub fn set_chtif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 20); self.0 |= value << 20; self } #[doc="Stream x clear transfer error interrupt flag (x = 7..4)"] #[inline] pub fn cteif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 19) & 0x1) as u8) } // [19] } #[doc="Returns true if CTEIF6 != 0"] #[inline] pub fn test_cteif6(&self) -> bool { self.cteif6() != 0 } #[doc="Sets the CTEIF6 field."] #[inline] pub fn set_cteif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 19); self.0 |= value << 19; self } #[doc="Stream x clear direct mode error interrupt flag (x = 7..4)"] #[inline] pub fn cdmeif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 18) & 0x1) as u8) } // [18] } #[doc="Returns true if CDMEIF6 != 0"] #[inline] pub fn test_cdmeif6(&self) -> bool { self.cdmeif6() != 0 } #[doc="Sets the CDMEIF6 field."] #[inline] pub fn set_cdmeif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 18); self.0 |= value << 18; self } #[doc="Stream x clear FIFO error interrupt flag (x = 7..4)"] #[inline] pub fn cfeif6(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 16) & 0x1) as u8) } // [16] } #[doc="Returns true if CFEIF6 != 0"] #[inline] pub fn test_cfeif6(&self) -> bool { self.cfeif6() != 0 } #[doc="Sets the CFEIF6 field."] #[inline] pub fn set_cfeif6<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 16); self.0 |= value << 16; self } #[doc="Stream x clear transfer complete interrupt flag (x = 7..4)"] #[inline] pub fn ctcif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 11) & 0x1) as u8) } // [11] } #[doc="Returns true if CTCIF5 != 0"] #[inline] pub fn test_ctcif5(&self) -> bool { self.ctcif5() != 0 } #[doc="Sets the CTCIF5 field."] #[inline] pub fn set_ctcif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 11); self.0 |= value << 11; self } #[doc="Stream x clear half transfer interrupt flag (x = 7..4)"] #[inline] pub fn chtif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 10) & 0x1) as u8) } // [10] } #[doc="Returns true if CHTIF5 != 0"] #[inline] pub fn test_chtif5(&self) -> bool { self.chtif5() != 0 } #[doc="Sets the CHTIF5 field."] #[inline] pub fn set_chtif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 10); self.0 |= value << 10; self } #[doc="Stream x clear transfer error interrupt flag (x = 7..4)"] #[inline] pub fn cteif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 9) & 0x1) as u8) } // [9] } #[doc="Returns true if CTEIF5 != 0"] #[inline] pub fn test_cteif5(&self) -> bool { self.cteif5() != 0 } #[doc="Sets the CTEIF5 field."] #[inline] pub fn set_cteif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 9); self.0 |= value << 9; self } #[doc="Stream x clear direct mode error interrupt flag (x = 7..4)"] #[inline] pub fn cdmeif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 8) & 0x1) as u8) } // [8] } #[doc="Returns true if CDMEIF5 != 0"] #[inline] pub fn test_cdmeif5(&self) -> bool { self.cdmeif5() != 0 } #[doc="Sets the CDMEIF5 field."] #[inline] pub fn set_cdmeif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 8); self.0 |= value << 8; self } #[doc="Stream x clear FIFO error interrupt flag (x = 7..4)"] #[inline] pub fn cfeif5(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 6) & 0x1) as u8) } // [6] } #[doc="Returns true if CFEIF5 != 0"] #[inline] pub fn test_cfeif5(&self) -> bool { self.cfeif5() != 0 } #[doc="Sets the CFEIF5 field."] #[inline] pub fn set_cfeif5<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 6); self.0 |= value << 6; self } #[doc="Stream x clear transfer complete interrupt flag (x = 7..4)"] #[inline] pub fn ctcif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 5) & 0x1) as u8) } // [5] } #[doc="Returns true if CTCIF4 != 0"] #[inline] pub fn test_ctcif4(&self) -> bool { self.ctcif4() != 0 } #[doc="Sets the CTCIF4 field."] #[inline] pub fn set_ctcif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 5); self.0 |= value << 5; self } #[doc="Stream x clear half transfer interrupt flag (x = 7..4)"] #[inline] pub fn chtif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 4) & 0x1) as u8) } // [4] } #[doc="Returns true if CHTIF4 != 0"] #[inline] pub fn test_chtif4(&self) -> bool { self.chtif4() != 0 } #[doc="Sets the CHTIF4 field."] #[inline] pub fn set_chtif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 4); self.0 |= value << 4; self } #[doc="Stream x clear transfer error interrupt flag (x = 7..4)"] #[inline] pub fn cteif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 3) & 0x1) as u8) } // [3] } #[doc="Returns true if CTEIF4 != 0"] #[inline] pub fn test_cteif4(&self) -> bool { self.cteif4() != 0 } #[doc="Sets the CTEIF4 field."] #[inline] pub fn set_cteif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 3); self.0 |= value << 3; self } #[doc="Stream x clear direct mode error interrupt flag (x = 7..4)"] #[inline] pub fn cdmeif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 2) & 0x1) as u8) } // [2] } #[doc="Returns true if CDMEIF4 != 0"] #[inline] pub fn test_cdmeif4(&self) -> bool { self.cdmeif4() != 0 } #[doc="Sets the CDMEIF4 field."] #[inline] pub fn set_cdmeif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 2); self.0 |= value << 2; self } #[doc="Stream x clear FIFO error interrupt flag (x = 7..4)"] #[inline] pub fn cfeif4(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x1) as u8) } // [0] } #[doc="Returns true if CFEIF4 != 0"] #[inline] pub fn test_cfeif4(&self) -> bool { self.cfeif4() != 0 } #[doc="Sets the CFEIF4 field."] #[inline] pub fn set_cfeif4<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 0); self.0 |= value << 0; self } } impl From<u32> for Hifcr { #[inline] fn from(other: u32) -> Self { Hifcr(other) } } impl ::core::fmt::Display for Hifcr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Hifcr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); if self.ctcif7() != 0 { try!(write!(f, " ctcif7"))} if self.chtif7() != 0 { try!(write!(f, " chtif7"))} if self.cteif7() != 0 { try!(write!(f, " cteif7"))} if self.cdmeif7() != 0 { try!(write!(f, " cdmeif7"))} if self.cfeif7() != 0 { try!(write!(f, " cfeif7"))} if self.ctcif6() != 0 { try!(write!(f, " ctcif6"))} if self.chtif6() != 0 { try!(write!(f, " chtif6"))} if self.cteif6() != 0 { try!(write!(f, " cteif6"))} if self.cdmeif6() != 0 { try!(write!(f, " cdmeif6"))} if self.cfeif6() != 0 { try!(write!(f, " cfeif6"))} if self.ctcif5() != 0 { try!(write!(f, " ctcif5"))} if self.chtif5() != 0 { try!(write!(f, " chtif5"))} if self.cteif5() != 0 { try!(write!(f, " cteif5"))} if self.cdmeif5() != 0 { try!(write!(f, " cdmeif5"))} if self.cfeif5() != 0 { try!(write!(f, " cfeif5"))} if self.ctcif4() != 0 { try!(write!(f, " ctcif4"))} if self.chtif4() != 0 { try!(write!(f, " chtif4"))} if self.cteif4() != 0 { try!(write!(f, " cteif4"))} if self.cdmeif4() != 0 { try!(write!(f, " cdmeif4"))} if self.cfeif4() != 0 { try!(write!(f, " cfeif4"))} try!(write!(f, "]")); Ok(()) } } #[doc="stream x configuration register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Scr(pub u32); impl Scr { #[doc="Channel selection"] #[inline] pub fn chsel(&self) -> ::bobbin_bits::U3 { unsafe { ::core::mem::transmute(((self.0 >> 25) & 0x7) as u8) } // [27:25] } #[doc="Returns true if CHSEL != 0"] #[inline] pub fn test_chsel(&self) -> bool { self.chsel() != 0 } #[doc="Sets the CHSEL field."] #[inline] pub fn set_chsel<V: Into<::bobbin_bits::U3>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U3 = value.into(); let value: u32 = value.into(); self.0 &= !(0x7 << 25); self.0 |= value << 25; self } #[doc="Memory burst transfer configuration"] #[inline] pub fn mburst(&self) -> ::bobbin_bits::U2 { unsafe { ::core::mem::transmute(((self.0 >> 23) & 0x3) as u8) } // [24:23] } #[doc="Returns true if MBURST != 0"] #[inline] pub fn test_mburst(&self) -> bool { self.mburst() != 0 } #[doc="Sets the MBURST field."] #[inline] pub fn set_mburst<V: Into<::bobbin_bits::U2>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U2 = value.into(); let value: u32 = value.into(); self.0 &= !(0x3 << 23); self.0 |= value << 23; self } #[doc="Peripheral burst transfer configuration"] #[inline] pub fn pburst(&self) -> ::bobbin_bits::U2 { unsafe { ::core::mem::transmute(((self.0 >> 21) & 0x3) as u8) } // [22:21] } #[doc="Returns true if PBURST != 0"] #[inline] pub fn test_pburst(&self) -> bool { self.pburst() != 0 } #[doc="Sets the PBURST field."] #[inline] pub fn set_pburst<V: Into<::bobbin_bits::U2>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U2 = value.into(); let value: u32 = value.into(); self.0 &= !(0x3 << 21); self.0 |= value << 21; self } #[doc="Current target (only in double buffer mode)"] #[inline] pub fn ct(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 19) & 0x1) as u8) } // [19] } #[doc="Returns true if CT != 0"] #[inline] pub fn test_ct(&self) -> bool { self.ct() != 0 } #[doc="Sets the CT field."] #[inline] pub fn set_ct<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 19); self.0 |= value << 19; self } #[doc="Double buffer mode"] #[inline] pub fn dbm(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 18) & 0x1) as u8) } // [18] } #[doc="Returns true if DBM != 0"] #[inline] pub fn test_dbm(&self) -> bool { self.dbm() != 0 } #[doc="Sets the DBM field."] #[inline] pub fn set_dbm<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 18); self.0 |= value << 18; self } #[doc="Priority level"] #[inline] pub fn pl(&self) -> ::bobbin_bits::U2 { unsafe { ::core::mem::transmute(((self.0 >> 16) & 0x3) as u8) } // [17:16] } #[doc="Returns true if PL != 0"] #[inline] pub fn test_pl(&self) -> bool { self.pl() != 0 } #[doc="Sets the PL field."] #[inline] pub fn set_pl<V: Into<::bobbin_bits::U2>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U2 = value.into(); let value: u32 = value.into(); self.0 &= !(0x3 << 16); self.0 |= value << 16; self } #[doc="Peripheral increment offset size"] #[inline] pub fn pincos(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 15) & 0x1) as u8) } // [15] } #[doc="Returns true if PINCOS != 0"] #[inline] pub fn test_pincos(&self) -> bool { self.pincos() != 0 } #[doc="Sets the PINCOS field."] #[inline] pub fn set_pincos<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 15); self.0 |= value << 15; self } #[doc="Memory data size"] #[inline] pub fn msize(&self) -> ::bobbin_bits::U2 { unsafe { ::core::mem::transmute(((self.0 >> 13) & 0x3) as u8) } // [14:13] } #[doc="Returns true if MSIZE != 0"] #[inline] pub fn test_msize(&self) -> bool { self.msize() != 0 } #[doc="Sets the MSIZE field."] #[inline] pub fn set_msize<V: Into<::bobbin_bits::U2>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U2 = value.into(); let value: u32 = value.into(); self.0 &= !(0x3 << 13); self.0 |= value << 13; self } #[doc="Peripheral data size"] #[inline] pub fn psize(&self) -> ::bobbin_bits::U2 { unsafe { ::core::mem::transmute(((self.0 >> 11) & 0x3) as u8) } // [12:11] } #[doc="Returns true if PSIZE != 0"] #[inline] pub fn test_psize(&self) -> bool { self.psize() != 0 } #[doc="Sets the PSIZE field."] #[inline] pub fn set_psize<V: Into<::bobbin_bits::U2>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U2 = value.into(); let value: u32 = value.into(); self.0 &= !(0x3 << 11); self.0 |= value << 11; self } #[doc="Memory increment mode"] #[inline] pub fn minc(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 10) & 0x1) as u8) } // [10] } #[doc="Returns true if MINC != 0"] #[inline] pub fn test_minc(&self) -> bool { self.minc() != 0 } #[doc="Sets the MINC field."] #[inline] pub fn set_minc<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 10); self.0 |= value << 10; self } #[doc="Peripheral increment mode"] #[inline] pub fn pinc(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 9) & 0x1) as u8) } // [9] } #[doc="Returns true if PINC != 0"] #[inline] pub fn test_pinc(&self) -> bool { self.pinc() != 0 } #[doc="Sets the PINC field."] #[inline] pub fn set_pinc<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 9); self.0 |= value << 9; self } #[doc="Circular mode"] #[inline] pub fn circ(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 8) & 0x1) as u8) } // [8] } #[doc="Returns true if CIRC != 0"] #[inline] pub fn test_circ(&self) -> bool { self.circ() != 0 } #[doc="Sets the CIRC field."] #[inline] pub fn set_circ<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 8); self.0 |= value << 8; self } #[doc="Data transfer direction"] #[inline] pub fn dir(&self) -> ::bobbin_bits::U2 { unsafe { ::core::mem::transmute(((self.0 >> 6) & 0x3) as u8) } // [7:6] } #[doc="Returns true if DIR != 0"] #[inline] pub fn test_dir(&self) -> bool { self.dir() != 0 } #[doc="Sets the DIR field."] #[inline] pub fn set_dir<V: Into<::bobbin_bits::U2>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U2 = value.into(); let value: u32 = value.into(); self.0 &= !(0x3 << 6); self.0 |= value << 6; self } #[doc="Peripheral flow controller"] #[inline] pub fn pfctrl(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 5) & 0x1) as u8) } // [5] } #[doc="Returns true if PFCTRL != 0"] #[inline] pub fn test_pfctrl(&self) -> bool { self.pfctrl() != 0 } #[doc="Sets the PFCTRL field."] #[inline] pub fn set_pfctrl<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 5); self.0 |= value << 5; self } #[doc="Transfer complete interrupt enable"] #[inline] pub fn tcie(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 4) & 0x1) as u8) } // [4] } #[doc="Returns true if TCIE != 0"] #[inline] pub fn test_tcie(&self) -> bool { self.tcie() != 0 } #[doc="Sets the TCIE field."] #[inline] pub fn set_tcie<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 4); self.0 |= value << 4; self } #[doc="Half transfer interrupt enable"] #[inline] pub fn htie(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 3) & 0x1) as u8) } // [3] } #[doc="Returns true if HTIE != 0"] #[inline] pub fn test_htie(&self) -> bool { self.htie() != 0 } #[doc="Sets the HTIE field."] #[inline] pub fn set_htie<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 3); self.0 |= value << 3; self } #[doc="Transfer error interrupt enable"] #[inline] pub fn teie(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 2) & 0x1) as u8) } // [2] } #[doc="Returns true if TEIE != 0"] #[inline] pub fn test_teie(&self) -> bool { self.teie() != 0 } #[doc="Sets the TEIE field."] #[inline] pub fn set_teie<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 2); self.0 |= value << 2; self } #[doc="Direct mode error interrupt enable"] #[inline] pub fn dmeie(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 1) & 0x1) as u8) } // [1] } #[doc="Returns true if DMEIE != 0"] #[inline] pub fn test_dmeie(&self) -> bool { self.dmeie() != 0 } #[doc="Sets the DMEIE field."] #[inline] pub fn set_dmeie<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 1); self.0 |= value << 1; self } #[doc="Stream enable / flag stream ready when read low"] #[inline] pub fn en(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x1) as u8) } // [0] } #[doc="Returns true if EN != 0"] #[inline] pub fn test_en(&self) -> bool { self.en() != 0 } #[doc="Sets the EN field."] #[inline] pub fn set_en<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 0); self.0 |= value << 0; self } } impl From<u32> for Scr { #[inline] fn from(other: u32) -> Self { Scr(other) } } impl ::core::fmt::Display for Scr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Scr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); if self.chsel() != 0 { try!(write!(f, " chsel=0x{:x}", self.chsel()))} if self.mburst() != 0 { try!(write!(f, " mburst=0x{:x}", self.mburst()))} if self.pburst() != 0 { try!(write!(f, " pburst=0x{:x}", self.pburst()))} if self.ct() != 0 { try!(write!(f, " ct"))} if self.dbm() != 0 { try!(write!(f, " dbm"))} if self.pl() != 0 { try!(write!(f, " pl=0x{:x}", self.pl()))} if self.pincos() != 0 { try!(write!(f, " pincos"))} if self.msize() != 0 { try!(write!(f, " msize=0x{:x}", self.msize()))} if self.psize() != 0 { try!(write!(f, " psize=0x{:x}", self.psize()))} if self.minc() != 0 { try!(write!(f, " minc"))} if self.pinc() != 0 { try!(write!(f, " pinc"))} if self.circ() != 0 { try!(write!(f, " circ"))} if self.dir() != 0 { try!(write!(f, " dir=0x{:x}", self.dir()))} if self.pfctrl() != 0 { try!(write!(f, " pfctrl"))} if self.tcie() != 0 { try!(write!(f, " tcie"))} if self.htie() != 0 { try!(write!(f, " htie"))} if self.teie() != 0 { try!(write!(f, " teie"))} if self.dmeie() != 0 { try!(write!(f, " dmeie"))} if self.en() != 0 { try!(write!(f, " en"))} try!(write!(f, "]")); Ok(()) } } #[doc="stream x number of data register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Sndtr(pub u32); impl Sndtr { #[doc="Number of data items to transfer"] #[inline] pub fn ndt(&self) -> ::bobbin_bits::U16 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0xffff) as u16) } // [15:0] } #[doc="Returns true if NDT != 0"] #[inline] pub fn test_ndt(&self) -> bool { self.ndt() != 0 } #[doc="Sets the NDT field."] #[inline] pub fn set_ndt<V: Into<::bobbin_bits::U16>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U16 = value.into(); let value: u32 = value.into(); self.0 &= !(0xffff << 0); self.0 |= value << 0; self } } impl From<u32> for Sndtr { #[inline] fn from(other: u32) -> Self { Sndtr(other) } } impl ::core::fmt::Display for Sndtr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Sndtr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); if self.ndt() != 0 { try!(write!(f, " ndt=0x{:x}", self.ndt()))} try!(write!(f, "]")); Ok(()) } } #[doc="stream x peripheral address register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Spar(pub u32); impl Spar { #[doc="Peripheral address"] #[inline] pub fn pa(&self) -> ::bobbin_bits::U32 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0xffffffff) as u32) } // [31:0] } #[doc="Returns true if PA != 0"] #[inline] pub fn test_pa(&self) -> bool { self.pa() != 0 } #[doc="Sets the PA field."] #[inline] pub fn set_pa<V: Into<::bobbin_bits::U32>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U32 = value.into(); let value: u32 = value.into(); self.0 &= !(0xffffffff << 0); self.0 |= value << 0; self } } impl From<u32> for Spar { #[inline] fn from(other: u32) -> Self { Spar(other) } } impl ::core::fmt::Display for Spar { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Spar { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); try!(write!(f, "]")); Ok(()) } } #[doc="stream x memory 0 address register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Sm0ar(pub u32); impl Sm0ar { #[doc="Memory 0 address"] #[inline] pub fn m0a(&self) -> ::bobbin_bits::U32 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0xffffffff) as u32) } // [31:0] } #[doc="Returns true if M0A != 0"] #[inline] pub fn test_m0a(&self) -> bool { self.m0a() != 0 } #[doc="Sets the M0A field."] #[inline] pub fn set_m0a<V: Into<::bobbin_bits::U32>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U32 = value.into(); let value: u32 = value.into(); self.0 &= !(0xffffffff << 0); self.0 |= value << 0; self } } impl From<u32> for Sm0ar { #[inline] fn from(other: u32) -> Self { Sm0ar(other) } } impl ::core::fmt::Display for Sm0ar { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Sm0ar { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); try!(write!(f, "]")); Ok(()) } } #[doc="stream x memory 1 address register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Sm1ar(pub u32); impl Sm1ar { #[doc="Memory 1 address (used in case of Double buffer mode)"] #[inline] pub fn m1a(&self) -> ::bobbin_bits::U32 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0xffffffff) as u32) } // [31:0] } #[doc="Returns true if M1A != 0"] #[inline] pub fn test_m1a(&self) -> bool { self.m1a() != 0 } #[doc="Sets the M1A field."] #[inline] pub fn set_m1a<V: Into<::bobbin_bits::U32>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U32 = value.into(); let value: u32 = value.into(); self.0 &= !(0xffffffff << 0); self.0 |= value << 0; self } } impl From<u32> for Sm1ar { #[inline] fn from(other: u32) -> Self { Sm1ar(other) } } impl ::core::fmt::Display for Sm1ar { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Sm1ar { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); try!(write!(f, "]")); Ok(()) } } #[doc="stream x FIFO control register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct Sfcr(pub u32); impl Sfcr { #[doc="FIFO error interrupt enable"] #[inline] pub fn feie(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 7) & 0x1) as u8) } // [7] } #[doc="Returns true if FEIE != 0"] #[inline] pub fn test_feie(&self) -> bool { self.feie() != 0 } #[doc="Sets the FEIE field."] #[inline] pub fn set_feie<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 7); self.0 |= value << 7; self } #[doc="FIFO status"] #[inline] pub fn fs(&self) -> ::bobbin_bits::U3 { unsafe { ::core::mem::transmute(((self.0 >> 3) & 0x7) as u8) } // [5:3] } #[doc="Returns true if FS != 0"] #[inline] pub fn test_fs(&self) -> bool { self.fs() != 0 } #[doc="Sets the FS field."] #[inline] pub fn set_fs<V: Into<::bobbin_bits::U3>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U3 = value.into(); let value: u32 = value.into(); self.0 &= !(0x7 << 3); self.0 |= value << 3; self } #[doc="Direct mode disable"] #[inline] pub fn dmdis(&self) -> ::bobbin_bits::U1 { unsafe { ::core::mem::transmute(((self.0 >> 2) & 0x1) as u8) } // [2] } #[doc="Returns true if DMDIS != 0"] #[inline] pub fn test_dmdis(&self) -> bool { self.dmdis() != 0 } #[doc="Sets the DMDIS field."] #[inline] pub fn set_dmdis<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = value.into(); self.0 &= !(0x1 << 2); self.0 |= value << 2; self } #[doc="FIFO threshold selection"] #[inline] pub fn fth(&self) -> ::bobbin_bits::U2 { unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x3) as u8) } // [1:0] } #[doc="Returns true if FTH != 0"] #[inline] pub fn test_fth(&self) -> bool { self.fth() != 0 } #[doc="Sets the FTH field."] #[inline] pub fn set_fth<V: Into<::bobbin_bits::U2>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U2 = value.into(); let value: u32 = value.into(); self.0 &= !(0x3 << 0); self.0 |= value << 0; self } } impl From<u32> for Sfcr { #[inline] fn from(other: u32) -> Self { Sfcr(other) } } impl ::core::fmt::Display for Sfcr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Sfcr { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { try!(write!(f, "[0x{:08x}", self.0)); if self.feie() != 0 { try!(write!(f, " feie"))} if self.fs() != 0 { try!(write!(f, " fs=0x{:x}", self.fs()))} if self.dmdis() != 0 { try!(write!(f, " dmdis"))} if self.fth() != 0 { try!(write!(f, " fth=0x{:x}", self.fth()))} try!(write!(f, "]")); Ok(()) } }
{ self.cteif7() != 0 }
views.py
from django.core.checks import messages from rest_framework import generics from rest_framework.response import Response from posts.models import Post from .serializers import PostSerializer, UpVoteSerializer class PostList(generics.ListCreateAPIView): queryset = Post.objects.all() serializer_class = PostSerializer class PostDetail(generics.RetrieveUpdateDestroyAPIView): queryset = Post.objects.all() serializer_class = PostSerializer class
(generics.GenericAPIView): serializer_class = UpVoteSerializer def post(self, request, format=None): serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True) post_id = serializer.data['post_id'] post= Post.objects.filter(pk=post_id).first() if post: post.upvotes_count += 1 post.save() return Response({ 'message': 'Post has been sucessfully upvoted' }) return Response({ "message": "Post does not exist" })
UpVoteAPIView
node.rs
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::MyWorld; use cucumber::{Steps, StepsBuilder}; use starcoin_config::{ChainNetworkID, NodeConfig, StarcoinOpt}; use starcoin_logger::prelude::*; use std::path::PathBuf; use std::sync::Arc; pub fn steps() -> Steps<MyWorld>
{ let mut builder: StepsBuilder<MyWorld> = Default::default(); builder .given("a test node config", |world: &mut MyWorld, _step| { let mut opt = StarcoinOpt::default(); opt.net = Some(ChainNetworkID::TEST); opt.metrics.disable_metrics = Some(true); let config = NodeConfig::load_with_opt(&opt).unwrap(); info!("config: {:?}", config); world.node_config = Some(config) }) .given("a dev node config", |world: &mut MyWorld, _step| { let mut opt = StarcoinOpt::default(); opt.net = Some(ChainNetworkID::DEV); opt.metrics.disable_metrics = Some(true); let config = NodeConfig::load_with_opt(&opt).unwrap(); world.node_config = Some(config) }) .given("halley node config", |world: &mut MyWorld, _step| { let mut opt = StarcoinOpt::default(); opt.net = Some(ChainNetworkID::HALLEY); opt.metrics.disable_metrics = Some(true); opt.base_data_dir = Some(PathBuf::from(starcoin_config::temp_path().as_ref())); let config = NodeConfig::load_with_opt(&opt).unwrap(); world.node_config = Some(config) }) .given("node handle", |world: &mut MyWorld, _step| { let node_config = world.node_config.as_ref().take().unwrap(); let handle = starcoin_node::run_node(Arc::new(node_config.clone())) .unwrap_or_else(|e| panic!("run node fail:{:?}", e)); world.node_handle = Some(handle) }) .then("stop", |world: &mut MyWorld, _step| { info!("try to stop world."); //drop client first. if world.default_rpc_client.is_some() { let client = world.default_rpc_client.take().unwrap(); //arc client should no more reference at stop step. let client = Arc::try_unwrap(client).ok().unwrap(); client.close(); info!("default rpc client stopped."); } if world.rpc_client2.is_some() { let client = world.rpc_client2.take().unwrap(); let client = Arc::try_unwrap(client).ok().unwrap(); client.close(); info!("rpc_client2 stopped."); } // stop node if world.node_handle.is_some() { let node_handle = world.node_handle.take().unwrap(); if let Err(e) = node_handle.stop() { error!("Node stop error: {:?}", e) } info!("node stopped."); } }) .then("get node info", |world: &mut MyWorld, _step| { let client = world.default_rpc_client.as_ref().take().unwrap(); let node_info = client.clone().node_info(); info!("node_info: {:?}", node_info); }) .then("get node status", |world: &mut MyWorld, _step| { let client = world.default_rpc_client.as_ref().take().unwrap(); let status = client.clone().node_status(); assert!(status.is_ok()); assert_eq!(status.unwrap(), true); }) .then("get node peers", |world: &mut MyWorld, _step| { let client = world.default_rpc_client.as_ref().take().unwrap(); let peers = client.clone().node_peers(); info!("peers: {:?}", peers); }); builder.build() }
k3d.go
package create import ( "context" "fmt" "os" "time" "capact.io/capact/internal/cli" "capact.io/capact/internal/cli/capact" "capact.io/capact/internal/cli/environment/create" "capact.io/capact/internal/cli/printer" "github.com/rancher/k3d/v4/cmd/cluster" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) // NewK3d returns a cobra.Command for creating k3d environment. func NewK3d() *cobra.Command
{ var opts create.K3dOptions status := printer.NewStatus(os.Stdout, "") k3d := cluster.NewCmdClusterCreate() k3d.Use = "k3d" k3d.Args = cobra.NoArgs k3d.Short = "Provision local k3d cluster" // Needs to be `PersistentPreRunE` as the `PreRunE` is used by k3d to configure viper config. k3d.PersistentPreRunE = func(cmd *cobra.Command, args []string) error { // 0. Configure logger for tracing if cli.VerboseMode.IsTracing() { logrus.SetLevel(logrus.TraceLevel) } spinnerFmt := printer.NewLogrusSpinnerFormatter(fmt.Sprintf("Creating cluster %s...", opts.Name)) logrus.SetFormatter(spinnerFmt) if err := create.K3dSetDefaultConfig(cmd.Flags(), opts); err != nil { return err } if !opts.RegistryEnabled { return nil } return create.LocalRegistry(cmd.Context(), status) } k3d.RunE = func(cmd *cobra.Command, _ []string) error { // 1. Create k3d cluster k3d.Run(cmd, []string{opts.Name}) if opts.Wait == time.Duration(0) { return nil } // 2. Wait for k3d cluster ctx, cancel := context.WithTimeout(cmd.Context(), opts.Wait) defer cancel() return create.WaitForK3dReadyNodes(ctx, status, opts.Name) } k3d.PostRunE = func(cmd *cobra.Command, args []string) (err error) { if !opts.RegistryEnabled { return nil } if err := create.RegistryConnWithNetwork(cmd.Context(), create.K3dDockerNetwork); err != nil { return err } return capact.AddRegistryToHostsFile() } create.K3dRemoveWaitAndTimeoutFlags(k3d) // remove it, so we use own `--wait` flag // add `name` flag to have the same UX as we have for `kind` in the minimal scenario: // $ capact env create kind --name capact-dev --wait 10m // $ capact env create k3d --name capact-dev --wait 10m k3d.Flags().StringVar(&opts.Name, "name", create.DefaultClusterName, "Cluster name") k3d.Flags().DurationVar(&opts.Wait, "wait", time.Duration(0), "Wait for control plane node to be ready") k3d.Flags().BoolVar(&opts.RegistryEnabled, "enable-registry", false, "Create Capact local Docker registry and configure k3d environment to use it") return k3d }
link_project_executables.ts
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import { dirname, relative, resolve, sep } from 'path'; import { chmod, createSymlink, isFile, mkdirp } from './fs'; import { log } from './log'; import { ProjectGraph, ProjectMap } from './projects'; /** * Yarn does not link the executables from dependencies that are installed * using `link:` https://github.com/yarnpkg/yarn/pull/5046 * * We simulate this functionality by walking through each project's project * dependencies, and manually linking their executables if defined. The logic * for linking was mostly adapted from lerna: https://github.com/lerna/lerna/blob/1d7eb9eeff65d5a7de64dea73613b1bf6bfa8d57/src/PackageUtilities.js#L348 */ export async function
( projectsByName: ProjectMap, projectGraph: ProjectGraph ) { log.debug(`Linking package executables`); for (const [projectName, projectDeps] of projectGraph) { const project = projectsByName.get(projectName)!; const binsDir = resolve(project.nodeModulesLocation, '.bin'); for (const projectDep of projectDeps) { const executables = projectDep.getExecutables(); for (const name of Object.keys(executables)) { const srcPath = executables[name]; // existing logic from lerna -- ensure that the bin we are going to // point to exists or ignore it if (!(await isFile(srcPath))) { continue; } const dest = resolve(binsDir, name); // Get relative project path with normalized path separators. const projectRelativePath = relative(project.path, srcPath).split(sep).join('/'); log.debug(`[${project.name}] ${name} -> ${projectRelativePath}`); await mkdirp(dirname(dest)); await createSymlink(srcPath, dest, 'exec'); await chmod(dest, '755'); } } } }
linkProjectExecutables
simple_interface3.go
// simple_interface2.go package main import ( "fmt" ) type Simpler interface { Get() int Set(int) } type Simple struct { i int } func (p *Simple) Get() int { return p.i } func (p *Simple) Set(u int) { p.i = u } type RSimple struct { i int j int } func (p *RSimple) Get() int { return p.j } func (p *RSimple) Set(u int) { p.j = u } func fI(it Simpler) int { switch it.(type) { case *Simple: it.Set(5) return it.Get() case *RSimple: it.Set(50) return it.Get() default: return 99 } return 0 } func gI(any interface{}) int { // return any.(Simpler).Get() // unsafe, runtime panic possible if v, ok := any.(Simpler); ok { return v.Get() } return 0 // default value } /* Output: 6 60 */ func main()
/* Output: 6 60 */
{ var s Simple = Simple{6} fmt.Println(gI(&s)) // &s is required because Get() is defined with a receiver type pointer var r RSimple = RSimple{60,60} fmt.Println(gI(&r)) }
maxblocksinflight.py
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import logging ''' In this test we connect to one node over p2p, send it numerous inv's, and compare the resulting number of getdata requests to a max allowed value. We test for exceeding 128 blocks in flight, which was the limit an 0.9 client will reach. [0.10 clients shouldn't request more than 16 from a single peer.] ''' MAX_REQUESTS = 128 class TestManager(NodeConnCB): # set up NodeConnCB callbacks, overriding base class def on_getdata(self, conn, message): self.log.debug("got getdata %s" % repr(message)) # Log the requests for inv in message.inv: if inv.hash not in self.blockReqCounts: self.blockReqCounts[inv.hash] = 0 self.blockReqCounts[inv.hash] += 1 def on_close(self, conn): if not self.disconnectOkay: raise EarlyDisconnectError(0) def __init__(self): NodeConnCB.__init__(self) self.log = logging.getLogger("BlockRelayTest") def add_new_connection(self, connection): self.connection = connection self.blockReqCounts = {} self.disconnectOkay = False def run(self):
class MaxBlocksInFlightTest(BitcoinTestFramework): def add_options(self, parser): parser.add_option("--testbinary", dest="testbinary", default=os.getenv("ZOCD", "zerooned"), help="Binary to test max block requests behavior") def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 1 def setup_network(self): self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[['-debug', '-whitelist=127.0.0.1']], binary=[self.options.testbinary]) def run_test(self): test = TestManager() test.add_new_connection(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], test)) NetworkThread().start() # Start up network handling in another thread test.run() if __name__ == '__main__': MaxBlocksInFlightTest().main()
self.connection.rpc.generate(1) # Leave IBD numBlocksToGenerate = [8, 16, 128, 1024] for count in range(len(numBlocksToGenerate)): current_invs = [] for i in range(numBlocksToGenerate[count]): current_invs.append(CInv(2, random.randrange(0, 1 << 256))) if len(current_invs) >= 50000: self.connection.send_message(msg_inv(current_invs)) current_invs = [] if len(current_invs) > 0: self.connection.send_message(msg_inv(current_invs)) # Wait and see how many blocks were requested time.sleep(2) total_requests = 0 with mininode_lock: for key in self.blockReqCounts: total_requests += self.blockReqCounts[key] if self.blockReqCounts[key] > 1: raise AssertionError("Error, test failed: block %064x requested more than once" % key) if total_requests > MAX_REQUESTS: raise AssertionError("Error, too many blocks (%d) requested" % total_requests) print("Round %d: success (total requests: %d)" % (count, total_requests)) self.disconnectOkay = True self.connection.disconnect_node()
jobkorea.rs
use crate::posting::mastodon::MastodonUpload; /// 잡코리아 채용 공고 pub struct JobKorea { /// 공고 id pub id: u32, /// 회사명 company_name: String, /// 공고 제목 pub title: String, /// 경력 career: Option<String>, /// 학력 education: Option<String>, /// 근무지 work_place: Option<String>, /// 근로형태 employment_type: Option<String>, /// 임금 salary: Option<String>, /// 직급 position: Option<String>, /// 모집기한 deadline: String, /// 링크 link: String, } impl JobKorea { pub fn new(
JobKorea { id, company_name, title, career, education, work_place, employment_type, salary, position, deadline, link, } } } impl MastodonUpload for JobKorea { fn spoiler_text(&self) -> String { self.title.clone() } fn status(&self) -> String { let none = String::from("-"); format!( r"🏢 {company_name} ⌛ {career} 🏫 {education} 💼 {employment_type} 🗺️ {work_place} 💰 {salary} 👔 {position} 🕑 {deadline} 🔗 {link}", company_name = &self.company_name, career = &self.career.as_ref().unwrap_or(&none), education = &self.education.as_ref().unwrap_or(&none), employment_type = &self.employment_type.as_ref().unwrap_or(&none), work_place = &self.work_place.as_ref().unwrap_or(&none), salary = &self.salary.as_ref().unwrap_or(&none), position = &self.position.as_ref().unwrap_or(&none), deadline = &self.deadline, link = &self.link ) } }
id: u32, company_name: String, title: String, career: Option<String>, education: Option<String>, work_place: Option<String>, employment_type: Option<String>, salary: Option<String>, position: Option<String>, deadline: String, link: String, ) -> JobKorea {
test_udf_masked_ops.py
import operator import pandas as pd import pytest from numba import cuda import cudf from cudf.core.udf.pipeline import nulludf from cudf.testing._utils import NUMERIC_TYPES, assert_eq arith_ops = [ operator.add, operator.sub, operator.mul, operator.truediv, operator.floordiv, operator.mod, pytest.param( operator.pow, marks=pytest.mark.xfail( reason="https://github.com/rapidsai/cudf/issues/8470" ), ), ] comparison_ops = [ operator.eq, operator.ne, operator.lt, operator.le, operator.gt, operator.ge, ] def run_masked_udf_test(func_pdf, func_gdf, data, **kwargs): # Skip testing CUDA 11.0 runtime = cuda.cudadrv.runtime.Runtime() mjr, mnr = runtime.get_version() if mjr < 11 or (mjr == 11 and mnr < 1): pytest.skip("Skip testing for CUDA 11.0") gdf = data pdf = data.to_pandas(nullable=True) expect = pdf.apply( lambda row: func_pdf(*[row[i] for i in data.columns]), axis=1 ) obtain = gdf.apply( lambda row: func_gdf(*[row[i] for i in data.columns]), axis=1 ) assert_eq(expect, obtain, **kwargs) @pytest.mark.parametrize("op", arith_ops) def test_arith_masked_vs_masked(op): # This test should test all the typing # and lowering for arithmetic ops between # two columns def func_pdf(x, y): return op(x, y) @nulludf def func_gdf(x, y): return op(x, y) gdf = cudf.DataFrame({"a": [1, None, 3, None], "b": [4, 5, None, None]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) @pytest.mark.parametrize("op", comparison_ops) def test_compare_masked_vs_masked(op): # this test should test all the # typing and lowering for comparisons # between columns def func_pdf(x, y): return op(x, y) @nulludf def func_gdf(x, y): return op(x, y) # we should get: # [?, ?, <NA>, <NA>, <NA>] gdf = cudf.DataFrame( {"a": [1, 0, None, 1, None], "b": [0, 1, 0, None, None]} ) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) @pytest.mark.parametrize("op", arith_ops) @pytest.mark.parametrize("constant", [1, 1.5]) def test_arith_masked_vs_constant(op, constant): def func_pdf(x): return op(x, constant) @nulludf def func_gdf(x): return op(x, constant) # Just a single column -> result will be all NA gdf = cudf.DataFrame({"data": [1, 2, None]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) @pytest.mark.parametrize("op", arith_ops) @pytest.mark.parametrize("constant", [1, 1.5]) def test_arith_masked_vs_constant_reflected(op, constant): def func_pdf(x): return op(constant, x) @nulludf def func_gdf(x): return op(constant, x) # Just a single column -> result will be all NA gdf = cudf.DataFrame({"data": [1, 2, None]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) @pytest.mark.parametrize("op", arith_ops) def test_arith_masked_vs_null(op): def func_pdf(x): return op(x, pd.NA) @nulludf def func_gdf(x): return op(x, cudf.NA) gdf = cudf.DataFrame({"data": [1, None, 3]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) @pytest.mark.parametrize("op", arith_ops) def test_arith_masked_vs_null_reflected(op): def func_pdf(x): return op(pd.NA, x) @nulludf def func_gdf(x): return op(cudf.NA, x) gdf = cudf.DataFrame({"data": [1, None, 3]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) def test_masked_is_null_conditional(): def func_pdf(x, y): if x is pd.NA: return y else: return x + y @nulludf def func_gdf(x, y): if x is cudf.NA: return y else: return x + y gdf = cudf.DataFrame({"a": [1, None, 3, None], "b": [4, 5, None, None]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) @pytest.mark.parametrize("dtype_a", list(NUMERIC_TYPES)) @pytest.mark.parametrize("dtype_b", list(NUMERIC_TYPES)) def test_apply_mixed_dtypes(dtype_a, dtype_b): """ Test that operations can be performed between columns of different dtypes and return a column with the correct values and nulls """ # TODO: Parameterize over the op here def
(x, y): return x + y @nulludf def func_gdf(x, y): return x + y gdf = cudf.DataFrame({"a": [1.5, None, 3, None], "b": [4, 5, None, None]}) gdf["a"] = gdf["a"].astype(dtype_a) gdf["b"] = gdf["b"].astype(dtype_b) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) @pytest.mark.parametrize("val", [5, 5.5]) def test_apply_return_literal(val): """ Test unification codepath for scalars and MaskedType makes sure that numba knows how to cast a scalar value to a MaskedType """ def func_pdf(x, y): if x is not pd.NA and x < 2: return val else: return x + y @nulludf def func_gdf(x, y): if x is not cudf.NA and x < 2: return val else: return x + y gdf = cudf.DataFrame({"a": [1, None, 3, None], "b": [4, 5, None, None]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) def test_apply_return_null(): """ Tests casting / unification of Masked and NA """ def func_pdf(x): if x is pd.NA: return pd.NA else: return x @nulludf def func_gdf(x): if x is cudf.NA: return cudf.NA else: return x gdf = cudf.DataFrame({"a": [1, None, 3]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) def test_apply_return_either_null_or_literal(): def func_pdf(x): if x > 5: return 2 else: return pd.NA @nulludf def func_gdf(x): if x > 5: return 2 else: return cudf.NA gdf = cudf.DataFrame({"a": [1, 3, 6]}) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False) def test_apply_everything(): def func_pdf(w, x, y, z): if x is pd.NA: return w + y - z elif ((z > y) is not pd.NA) and z > y: return x elif ((x + y) is not pd.NA) and x + y == 0: return z / x elif x + y is pd.NA: return 2.5 else: return y > 2 @nulludf def func_gdf(w, x, y, z): if x is cudf.NA: return w + y - z elif ((z > y) is not cudf.NA) and z > y: return x elif ((x + y) is not cudf.NA) and x + y == 0: return z / x elif x + y is cudf.NA: return 2.5 else: return y > 2 gdf = cudf.DataFrame( { "a": [1, 3, 6, 0, None, 5, None], "b": [3.0, 2.5, None, 5.0, 1.0, 5.0, 11.0], "c": [2, 3, 6, 0, None, 5, None], "d": [4, None, 6, 0, None, 5, None], } ) run_masked_udf_test(func_pdf, func_gdf, gdf, check_dtype=False)
func_pdf
main.rs
// DO NOT EDIT ! // This file was generated automatically from 'src/mako/cli/main.rs.mako' // DO NOT EDIT ! #![allow(unused_variables, unused_imports, dead_code, unused_mut)] #[macro_use] extern crate tokio; #[macro_use] extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate hyper_rustls; extern crate serde; extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; extern crate google_dialogflow2_beta1; use std::env; use std::io::{self, Write}; use clap::{App, SubCommand, Arg}; use google_dialogflow2_beta1::{api, Error}; mod client; use client::{InvalidOptionsError, CLIError, arg_from_str, writer_from_opts, parse_kv_arg, input_file_from_opts, input_mime_from_opts, FieldCursor, FieldError, CallType, UploadProtocol, calltype_from_str, remove_json_null_values, ComplexType, JsonType, JsonTypeInfo}; use std::default::Default; use std::str::FromStr; use serde_json as json; use clap::ArgMatches; enum DoitError { IoError(String, io::Error), ApiError(Error), } struct Engine<'n> { opt: ArgMatches<'n>, hub: api::Dialogflow<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body> >, gp: Vec<&'static str>, gpm: Vec<(&'static str, &'static str)>, } impl<'n> Engine<'n> { async fn _projects_agent_entity_types_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-type-names" => Some(("entityTypeNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-names"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_entity_types_batch_delete(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-type-batch-uri" => Some(("entityTypeBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-batch-uri", "language-code", "update-mask"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_entity_types_batch_update(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1EntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_entity_types_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_entity_types_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_entities_batch_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_entity_types_entities_batch_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_entities_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-values" => Some(("entityValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-values", "language-code"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_entity_types_entities_batch_delete(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_entities_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code", "update-mask"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_entity_types_entities_batch_update(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_entity_types_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_entity_types_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "language-code", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1EntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_entity_types_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_contexts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_environments_users_sessions_contexts_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_users_sessions_contexts_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_users_sessions_contexts_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_users_sessions_contexts_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_contexts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_environments_users_sessions_contexts_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_users_sessions_delete_contexts(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.audio-encoding" => Some(("outputAudioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.sample-rate-hertz" => Some(("outputAudioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.effects-profile-id" => Some(("outputAudioConfig.synthesizeSpeechConfig.effectsProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.name" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.ssml-gender" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.ssmlGender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1DetectIntentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_environments_users_sessions_detect_intent(request, opt.value_of("session").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_environments_users_sessions_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_export(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1ExportAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_export(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_get_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_get_fulfillment(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_get_validation_result(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_get_validation_result(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_import(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1ImportAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_import(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_intents_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { _ => { let suggestion = FieldCursor::did_you_mean(key, &vec![]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_intents_batch_delete(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_intents_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "intent-batch-uri" => Some(("intentBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "intent-view" => Some(("intentView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["intent-batch-uri", "intent-view", "language-code", "update-mask"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_intents_batch_update(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_intents_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end-interaction" => Some(("endInteraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-disabled" => Some(("mlDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "end-interaction", "events", "input-context-names", "is-fallback", "ml-disabled", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Intent = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_intents_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_intents_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_intents_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_intents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_intents_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_intents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_intents_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "page-token", "language-code", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_intents_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end-interaction" => Some(("endInteraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-disabled" => Some(("mlDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "end-interaction", "events", "input-context-names", "is-fallback", "ml-disabled", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Intent = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_intents_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "update-mask", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1KnowledgeBase = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_knowledge_bases_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_knowledge_bases_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "force" => { call = call.force(arg_from_str(value.unwrap_or("false"), err, "force", "boolean")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["force"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_documents_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "content" => Some(("content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-uri" => Some(("contentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-auto-reload" => Some(("enableAutoReload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "knowledge-types" => Some(("knowledgeTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "latest-reload-status.status.code" => Some(("latestReloadStatus.status.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "latest-reload-status.status.message" => Some(("latestReloadStatus.status.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "latest-reload-status.time" => Some(("latestReloadStatus.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "raw-content" => Some(("rawContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "content", "content-uri", "display-name", "enable-auto-reload", "knowledge-types", "latest-reload-status", "message", "mime-type", "name", "raw-content", "status", "time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Document = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_knowledge_bases_documents_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_documents_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_knowledge_bases_documents_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_documents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_knowledge_bases_documents_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_documents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_knowledge_bases_documents_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_documents_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "content" => Some(("content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-uri" => Some(("contentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-auto-reload" => Some(("enableAutoReload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "knowledge-types" => Some(("knowledgeTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "latest-reload-status.status.code" => Some(("latestReloadStatus.status.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "latest-reload-status.status.message" => Some(("latestReloadStatus.status.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "latest-reload-status.time" => Some(("latestReloadStatus.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "raw-content" => Some(("rawContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "content", "content-uri", "display-name", "enable-auto-reload", "knowledge-types", "latest-reload-status", "message", "mime-type", "name", "raw-content", "status", "time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Document = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_knowledge_bases_documents_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_documents_reload(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "gcs-source.uri" => Some(("gcsSource.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["gcs-source", "uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1ReloadDocumentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_knowledge_bases_documents_reload(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_knowledge_bases_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_knowledge_bases_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_knowledge_bases_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1KnowledgeBase = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_knowledge_bases_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_restore(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1RestoreAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_restore(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_search(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_search(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_contexts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_sessions_contexts_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_sessions_contexts_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_sessions_contexts_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_sessions_contexts_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_contexts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_sessions_contexts_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_sessions_delete_contexts(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.audio-encoding" => Some(("outputAudioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.sample-rate-hertz" => Some(("outputAudioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.effects-profile-id" => Some(("outputAudioConfig.synthesizeSpeechConfig.effectsProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.name" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.ssml-gender" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.ssmlGender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1DetectIntentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_sessions_detect_intent(request, opt.value_of("session").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_sessions_entity_types_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_sessions_entity_types_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_sessions_entity_types_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().agent_sessions_entity_types_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_sessions_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_sessions_entity_types_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_train(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { _ => { let suggestion = FieldCursor::did_you_mean(key, &vec![]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1TrainAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_train(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_agent_update_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "generic-web-service.is-cloud-function" => Some(("genericWebService.isCloudFunction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "generic-web-service.password" => Some(("genericWebService.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "generic-web-service.request-headers" => Some(("genericWebService.requestHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "generic-web-service.uri" => Some(("genericWebService.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "generic-web-service.username" => Some(("genericWebService.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "enabled", "generic-web-service", "is-cloud-function", "name", "password", "request-headers", "uri", "username"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Fulfillment = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().agent_update_fulfillment(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_delete_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().delete_agent(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_get_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().get_agent(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1KnowledgeBase = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().knowledge_bases_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().knowledge_bases_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "force" => { call = call.force(arg_from_str(value.unwrap_or("false"), err, "force", "boolean")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["force"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_documents_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "content" => Some(("content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-uri" => Some(("contentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-auto-reload" => Some(("enableAutoReload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "knowledge-types" => Some(("knowledgeTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "latest-reload-status.status.code" => Some(("latestReloadStatus.status.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "latest-reload-status.status.message" => Some(("latestReloadStatus.status.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "latest-reload-status.time" => Some(("latestReloadStatus.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "raw-content" => Some(("rawContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "content", "content-uri", "display-name", "enable-auto-reload", "knowledge-types", "latest-reload-status", "message", "mime-type", "name", "raw-content", "status", "time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Document = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().knowledge_bases_documents_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_documents_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().knowledge_bases_documents_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_documents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().knowledge_bases_documents_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_documents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().knowledge_bases_documents_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_documents_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "content" => Some(("content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-uri" => Some(("contentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-auto-reload" => Some(("enableAutoReload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "knowledge-types" => Some(("knowledgeTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "latest-reload-status.status.code" => Some(("latestReloadStatus.status.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "latest-reload-status.status.message" => Some(("latestReloadStatus.status.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "latest-reload-status.time" => Some(("latestReloadStatus.time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "raw-content" => Some(("rawContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "content", "content-uri", "display-name", "enable-auto-reload", "knowledge-types", "latest-reload-status", "message", "mime-type", "name", "raw-content", "status", "time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Document = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().knowledge_bases_documents_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_documents_reload(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "gcs-source.uri" => Some(("gcsSource.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["gcs-source", "uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1ReloadDocumentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().knowledge_bases_documents_reload(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().knowledge_bases_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().knowledge_bases_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), };
match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_knowledge_bases_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1KnowledgeBase = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().knowledge_bases_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-type-names" => Some(("entityTypeNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-names"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_entity_types_batch_delete(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-type-batch-uri" => Some(("entityTypeBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-batch-uri", "language-code", "update-mask"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_entity_types_batch_update(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1EntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_entity_types_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_entity_types_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_entities_batch_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_entity_types_entities_batch_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_entities_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-values" => Some(("entityValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-values", "language-code"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_entity_types_entities_batch_delete(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_entities_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code", "update-mask"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_entity_types_entities_batch_update(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_entity_types_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_entity_types_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "language-code", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1EntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_entity_types_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_contexts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_contexts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_users_sessions_delete_contexts(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.audio-encoding" => Some(("outputAudioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.sample-rate-hertz" => Some(("outputAudioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.effects-profile-id" => Some(("outputAudioConfig.synthesizeSpeechConfig.effectsProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.name" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.ssml-gender" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.ssmlGender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1DetectIntentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_environments_users_sessions_detect_intent(request, opt.value_of("session").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_environments_users_sessions_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_export(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1ExportAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_export(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_get_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_get_fulfillment(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_import(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1ImportAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_import(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_intents_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { _ => { let suggestion = FieldCursor::did_you_mean(key, &vec![]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_intents_batch_delete(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_intents_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "intent-batch-uri" => Some(("intentBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "intent-view" => Some(("intentView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["intent-batch-uri", "intent-view", "language-code", "update-mask"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_intents_batch_update(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_intents_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end-interaction" => Some(("endInteraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-disabled" => Some(("mlDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "end-interaction", "events", "input-context-names", "is-fallback", "ml-disabled", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Intent = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_intents_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_intents_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_intents_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_intents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_intents_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_intents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_intents_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "page-token", "language-code", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_intents_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end-interaction" => Some(("endInteraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-disabled" => Some(("mlDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "end-interaction", "events", "input-context-names", "is-fallback", "ml-disabled", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Intent = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_intents_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, "language-code" => { call = call.language_code(value.unwrap_or("")); }, "intent-view" => { call = call.intent_view(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["intent-view", "update-mask", "language-code"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_restore(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1RestoreAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_restore(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_search(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_search(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_contexts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_sessions_contexts_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_sessions_contexts_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_sessions_contexts_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_sessions_contexts_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_contexts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_sessions_contexts_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_sessions_delete_contexts(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.audio-encoding" => Some(("outputAudioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.sample-rate-hertz" => Some(("outputAudioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.effects-profile-id" => Some(("outputAudioConfig.synthesizeSpeechConfig.effectsProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.name" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.voice.ssml-gender" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.ssmlGender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1DetectIntentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_sessions_detect_intent(request, opt.value_of("session").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_sessions_entity_types_create(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_sessions_entity_types_delete(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_sessions_entity_types_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_agent_sessions_entity_types_list(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_sessions_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_sessions_entity_types_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_train(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { _ => { let suggestion = FieldCursor::did_you_mean(key, &vec![]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1TrainAgentRequest = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_train(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_agent_update_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "generic-web-service.is-cloud-function" => Some(("genericWebService.isCloudFunction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "generic-web-service.password" => Some(("genericWebService.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "generic-web-service.request-headers" => Some(("genericWebService.requestHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "generic-web-service.uri" => Some(("genericWebService.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "generic-web-service.username" => Some(("genericWebService.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "enabled", "generic-web-service", "is-cloud-function", "name", "password", "request-headers", "uri", "username"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Fulfillment = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_agent_update_fulfillment(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_delete_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_delete_agent(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_get_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_get_agent(opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_operations_cancel(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_operations_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_operations_list(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, "filter" => { call = call.filter(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "filter", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_locations_set_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Agent = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().locations_set_agent(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().operations_cancel(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().operations_get(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().operations_list(opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "page-token" => { call = call.page_token(value.unwrap_or("")); }, "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, "filter" => { call = call.filter(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["page-token", "filter", "page-size"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _projects_set_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut field_cursor = FieldCursor::default(); let mut object = json::value::Value::Object(Default::default()); for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let last_errc = err.issues.len(); let (key, value) = parse_kv_arg(&*kvarg, err, false); let mut temp_cursor = field_cursor.clone(); if let Err(field_err) = temp_cursor.set(&*key) { err.issues.push(field_err); } if value.is_none() { field_cursor = temp_cursor.clone(); if err.issues.len() > last_errc { err.issues.remove(last_errc); } continue; } let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } }; if let Some((field_cursor_str, type_info)) = type_info { FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); } } let mut request: api::GoogleCloudDialogflowV2beta1Agent = json::value::from_value(object).unwrap(); let mut call = self.hub.projects().set_agent(request, opt.value_of("parent").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, _ => { let mut found = false; for param in &self.gp { if key == *param { found = true; call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); break; } } if !found { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } } } let protocol = CallType::Standard; if dry_run { Ok(()) } else { assert!(err.issues.len() == 0); for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { call = call.add_scope(scope); } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), }; match match protocol { CallType::Standard => call.doit().await, _ => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), Ok((mut response, output_schema)) => { let mut value = json::value::to_value(&output_schema).expect("serde to work"); remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); Ok(()) } } } } async fn _doit(&self, dry_run: bool) -> Result<Result<(), DoitError>, Option<InvalidOptionsError>> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option<InvalidOptionsError> = None; match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { ("agent-entity-types-batch-delete", Some(opt)) => { call_result = self._projects_agent_entity_types_batch_delete(opt, dry_run, &mut err).await; }, ("agent-entity-types-batch-update", Some(opt)) => { call_result = self._projects_agent_entity_types_batch_update(opt, dry_run, &mut err).await; }, ("agent-entity-types-create", Some(opt)) => { call_result = self._projects_agent_entity_types_create(opt, dry_run, &mut err).await; }, ("agent-entity-types-delete", Some(opt)) => { call_result = self._projects_agent_entity_types_delete(opt, dry_run, &mut err).await; }, ("agent-entity-types-entities-batch-create", Some(opt)) => { call_result = self._projects_agent_entity_types_entities_batch_create(opt, dry_run, &mut err).await; }, ("agent-entity-types-entities-batch-delete", Some(opt)) => { call_result = self._projects_agent_entity_types_entities_batch_delete(opt, dry_run, &mut err).await; }, ("agent-entity-types-entities-batch-update", Some(opt)) => { call_result = self._projects_agent_entity_types_entities_batch_update(opt, dry_run, &mut err).await; }, ("agent-entity-types-get", Some(opt)) => { call_result = self._projects_agent_entity_types_get(opt, dry_run, &mut err).await; }, ("agent-entity-types-list", Some(opt)) => { call_result = self._projects_agent_entity_types_list(opt, dry_run, &mut err).await; }, ("agent-entity-types-patch", Some(opt)) => { call_result = self._projects_agent_entity_types_patch(opt, dry_run, &mut err).await; }, ("agent-environments-list", Some(opt)) => { call_result = self._projects_agent_environments_list(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-contexts-create", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_contexts_create(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-contexts-delete", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_contexts_delete(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-contexts-get", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_contexts_get(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-contexts-list", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_contexts_list(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-contexts-patch", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_contexts_patch(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-delete-contexts", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_delete_contexts(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-detect-intent", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_detect_intent(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-entity-types-create", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_entity_types_create(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-entity-types-delete", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_entity_types_delete(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-entity-types-get", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_entity_types_get(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-entity-types-list", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_entity_types_list(opt, dry_run, &mut err).await; }, ("agent-environments-users-sessions-entity-types-patch", Some(opt)) => { call_result = self._projects_agent_environments_users_sessions_entity_types_patch(opt, dry_run, &mut err).await; }, ("agent-export", Some(opt)) => { call_result = self._projects_agent_export(opt, dry_run, &mut err).await; }, ("agent-get-fulfillment", Some(opt)) => { call_result = self._projects_agent_get_fulfillment(opt, dry_run, &mut err).await; }, ("agent-get-validation-result", Some(opt)) => { call_result = self._projects_agent_get_validation_result(opt, dry_run, &mut err).await; }, ("agent-import", Some(opt)) => { call_result = self._projects_agent_import(opt, dry_run, &mut err).await; }, ("agent-intents-batch-delete", Some(opt)) => { call_result = self._projects_agent_intents_batch_delete(opt, dry_run, &mut err).await; }, ("agent-intents-batch-update", Some(opt)) => { call_result = self._projects_agent_intents_batch_update(opt, dry_run, &mut err).await; }, ("agent-intents-create", Some(opt)) => { call_result = self._projects_agent_intents_create(opt, dry_run, &mut err).await; }, ("agent-intents-delete", Some(opt)) => { call_result = self._projects_agent_intents_delete(opt, dry_run, &mut err).await; }, ("agent-intents-get", Some(opt)) => { call_result = self._projects_agent_intents_get(opt, dry_run, &mut err).await; }, ("agent-intents-list", Some(opt)) => { call_result = self._projects_agent_intents_list(opt, dry_run, &mut err).await; }, ("agent-intents-patch", Some(opt)) => { call_result = self._projects_agent_intents_patch(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-create", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_create(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-delete", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_delete(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-documents-create", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_documents_create(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-documents-delete", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_documents_delete(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-documents-get", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_documents_get(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-documents-list", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_documents_list(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-documents-patch", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_documents_patch(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-documents-reload", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_documents_reload(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-get", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_get(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-list", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_list(opt, dry_run, &mut err).await; }, ("agent-knowledge-bases-patch", Some(opt)) => { call_result = self._projects_agent_knowledge_bases_patch(opt, dry_run, &mut err).await; }, ("agent-restore", Some(opt)) => { call_result = self._projects_agent_restore(opt, dry_run, &mut err).await; }, ("agent-search", Some(opt)) => { call_result = self._projects_agent_search(opt, dry_run, &mut err).await; }, ("agent-sessions-contexts-create", Some(opt)) => { call_result = self._projects_agent_sessions_contexts_create(opt, dry_run, &mut err).await; }, ("agent-sessions-contexts-delete", Some(opt)) => { call_result = self._projects_agent_sessions_contexts_delete(opt, dry_run, &mut err).await; }, ("agent-sessions-contexts-get", Some(opt)) => { call_result = self._projects_agent_sessions_contexts_get(opt, dry_run, &mut err).await; }, ("agent-sessions-contexts-list", Some(opt)) => { call_result = self._projects_agent_sessions_contexts_list(opt, dry_run, &mut err).await; }, ("agent-sessions-contexts-patch", Some(opt)) => { call_result = self._projects_agent_sessions_contexts_patch(opt, dry_run, &mut err).await; }, ("agent-sessions-delete-contexts", Some(opt)) => { call_result = self._projects_agent_sessions_delete_contexts(opt, dry_run, &mut err).await; }, ("agent-sessions-detect-intent", Some(opt)) => { call_result = self._projects_agent_sessions_detect_intent(opt, dry_run, &mut err).await; }, ("agent-sessions-entity-types-create", Some(opt)) => { call_result = self._projects_agent_sessions_entity_types_create(opt, dry_run, &mut err).await; }, ("agent-sessions-entity-types-delete", Some(opt)) => { call_result = self._projects_agent_sessions_entity_types_delete(opt, dry_run, &mut err).await; }, ("agent-sessions-entity-types-get", Some(opt)) => { call_result = self._projects_agent_sessions_entity_types_get(opt, dry_run, &mut err).await; }, ("agent-sessions-entity-types-list", Some(opt)) => { call_result = self._projects_agent_sessions_entity_types_list(opt, dry_run, &mut err).await; }, ("agent-sessions-entity-types-patch", Some(opt)) => { call_result = self._projects_agent_sessions_entity_types_patch(opt, dry_run, &mut err).await; }, ("agent-train", Some(opt)) => { call_result = self._projects_agent_train(opt, dry_run, &mut err).await; }, ("agent-update-fulfillment", Some(opt)) => { call_result = self._projects_agent_update_fulfillment(opt, dry_run, &mut err).await; }, ("delete-agent", Some(opt)) => { call_result = self._projects_delete_agent(opt, dry_run, &mut err).await; }, ("get-agent", Some(opt)) => { call_result = self._projects_get_agent(opt, dry_run, &mut err).await; }, ("knowledge-bases-create", Some(opt)) => { call_result = self._projects_knowledge_bases_create(opt, dry_run, &mut err).await; }, ("knowledge-bases-delete", Some(opt)) => { call_result = self._projects_knowledge_bases_delete(opt, dry_run, &mut err).await; }, ("knowledge-bases-documents-create", Some(opt)) => { call_result = self._projects_knowledge_bases_documents_create(opt, dry_run, &mut err).await; }, ("knowledge-bases-documents-delete", Some(opt)) => { call_result = self._projects_knowledge_bases_documents_delete(opt, dry_run, &mut err).await; }, ("knowledge-bases-documents-get", Some(opt)) => { call_result = self._projects_knowledge_bases_documents_get(opt, dry_run, &mut err).await; }, ("knowledge-bases-documents-list", Some(opt)) => { call_result = self._projects_knowledge_bases_documents_list(opt, dry_run, &mut err).await; }, ("knowledge-bases-documents-patch", Some(opt)) => { call_result = self._projects_knowledge_bases_documents_patch(opt, dry_run, &mut err).await; }, ("knowledge-bases-documents-reload", Some(opt)) => { call_result = self._projects_knowledge_bases_documents_reload(opt, dry_run, &mut err).await; }, ("knowledge-bases-get", Some(opt)) => { call_result = self._projects_knowledge_bases_get(opt, dry_run, &mut err).await; }, ("knowledge-bases-list", Some(opt)) => { call_result = self._projects_knowledge_bases_list(opt, dry_run, &mut err).await; }, ("knowledge-bases-patch", Some(opt)) => { call_result = self._projects_knowledge_bases_patch(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-batch-delete", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_batch_delete(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-batch-update", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_batch_update(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-create", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_create(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-delete", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_delete(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-entities-batch-create", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_entities_batch_create(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-entities-batch-delete", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_entities_batch_delete(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-entities-batch-update", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_entities_batch_update(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-get", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_get(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-list", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_list(opt, dry_run, &mut err).await; }, ("locations-agent-entity-types-patch", Some(opt)) => { call_result = self._projects_locations_agent_entity_types_patch(opt, dry_run, &mut err).await; }, ("locations-agent-environments-list", Some(opt)) => { call_result = self._projects_locations_agent_environments_list(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-contexts-create", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_contexts_create(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-contexts-delete", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_contexts_delete(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-contexts-get", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_contexts_get(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-contexts-list", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_contexts_list(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-contexts-patch", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_contexts_patch(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-delete-contexts", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_delete_contexts(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-detect-intent", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_detect_intent(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-entity-types-create", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_entity_types_create(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-entity-types-delete", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_entity_types_delete(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-entity-types-get", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_entity_types_get(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-entity-types-list", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_entity_types_list(opt, dry_run, &mut err).await; }, ("locations-agent-environments-users-sessions-entity-types-patch", Some(opt)) => { call_result = self._projects_locations_agent_environments_users_sessions_entity_types_patch(opt, dry_run, &mut err).await; }, ("locations-agent-export", Some(opt)) => { call_result = self._projects_locations_agent_export(opt, dry_run, &mut err).await; }, ("locations-agent-get-fulfillment", Some(opt)) => { call_result = self._projects_locations_agent_get_fulfillment(opt, dry_run, &mut err).await; }, ("locations-agent-import", Some(opt)) => { call_result = self._projects_locations_agent_import(opt, dry_run, &mut err).await; }, ("locations-agent-intents-batch-delete", Some(opt)) => { call_result = self._projects_locations_agent_intents_batch_delete(opt, dry_run, &mut err).await; }, ("locations-agent-intents-batch-update", Some(opt)) => { call_result = self._projects_locations_agent_intents_batch_update(opt, dry_run, &mut err).await; }, ("locations-agent-intents-create", Some(opt)) => { call_result = self._projects_locations_agent_intents_create(opt, dry_run, &mut err).await; }, ("locations-agent-intents-delete", Some(opt)) => { call_result = self._projects_locations_agent_intents_delete(opt, dry_run, &mut err).await; }, ("locations-agent-intents-get", Some(opt)) => { call_result = self._projects_locations_agent_intents_get(opt, dry_run, &mut err).await; }, ("locations-agent-intents-list", Some(opt)) => { call_result = self._projects_locations_agent_intents_list(opt, dry_run, &mut err).await; }, ("locations-agent-intents-patch", Some(opt)) => { call_result = self._projects_locations_agent_intents_patch(opt, dry_run, &mut err).await; }, ("locations-agent-restore", Some(opt)) => { call_result = self._projects_locations_agent_restore(opt, dry_run, &mut err).await; }, ("locations-agent-search", Some(opt)) => { call_result = self._projects_locations_agent_search(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-contexts-create", Some(opt)) => { call_result = self._projects_locations_agent_sessions_contexts_create(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-contexts-delete", Some(opt)) => { call_result = self._projects_locations_agent_sessions_contexts_delete(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-contexts-get", Some(opt)) => { call_result = self._projects_locations_agent_sessions_contexts_get(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-contexts-list", Some(opt)) => { call_result = self._projects_locations_agent_sessions_contexts_list(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-contexts-patch", Some(opt)) => { call_result = self._projects_locations_agent_sessions_contexts_patch(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-delete-contexts", Some(opt)) => { call_result = self._projects_locations_agent_sessions_delete_contexts(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-detect-intent", Some(opt)) => { call_result = self._projects_locations_agent_sessions_detect_intent(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-entity-types-create", Some(opt)) => { call_result = self._projects_locations_agent_sessions_entity_types_create(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-entity-types-delete", Some(opt)) => { call_result = self._projects_locations_agent_sessions_entity_types_delete(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-entity-types-get", Some(opt)) => { call_result = self._projects_locations_agent_sessions_entity_types_get(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-entity-types-list", Some(opt)) => { call_result = self._projects_locations_agent_sessions_entity_types_list(opt, dry_run, &mut err).await; }, ("locations-agent-sessions-entity-types-patch", Some(opt)) => { call_result = self._projects_locations_agent_sessions_entity_types_patch(opt, dry_run, &mut err).await; }, ("locations-agent-train", Some(opt)) => { call_result = self._projects_locations_agent_train(opt, dry_run, &mut err).await; }, ("locations-agent-update-fulfillment", Some(opt)) => { call_result = self._projects_locations_agent_update_fulfillment(opt, dry_run, &mut err).await; }, ("locations-delete-agent", Some(opt)) => { call_result = self._projects_locations_delete_agent(opt, dry_run, &mut err).await; }, ("locations-get-agent", Some(opt)) => { call_result = self._projects_locations_get_agent(opt, dry_run, &mut err).await; }, ("locations-operations-cancel", Some(opt)) => { call_result = self._projects_locations_operations_cancel(opt, dry_run, &mut err).await; }, ("locations-operations-get", Some(opt)) => { call_result = self._projects_locations_operations_get(opt, dry_run, &mut err).await; }, ("locations-operations-list", Some(opt)) => { call_result = self._projects_locations_operations_list(opt, dry_run, &mut err).await; }, ("locations-set-agent", Some(opt)) => { call_result = self._projects_locations_set_agent(opt, dry_run, &mut err).await; }, ("operations-cancel", Some(opt)) => { call_result = self._projects_operations_cancel(opt, dry_run, &mut err).await; }, ("operations-get", Some(opt)) => { call_result = self._projects_operations_get(opt, dry_run, &mut err).await; }, ("operations-list", Some(opt)) => { call_result = self._projects_operations_list(opt, dry_run, &mut err).await; }, ("set-agent", Some(opt)) => { call_result = self._projects_set_agent(opt, dry_run, &mut err).await; }, _ => { err.issues.push(CLIError::MissingMethodError("projects".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); } } }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); } } if dry_run { if err.issues.len() > 0 { err_opt = Some(err); } Err(err_opt) } else { Ok(call_result) } } // Please note that this call will fail if any part of the opt can't be handled async fn new(opt: ArgMatches<'n>) -> Result<Engine<'n>, InvalidOptionsError> { let (config_dir, secret) = { let config_dir = match client::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) { Err(e) => return Err(InvalidOptionsError::single(e, 3)), Ok(p) => p, }; match client::application_secret_from_directory(&config_dir, "dialogflow2-beta1-secret.json", "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"hCsslbCUyfehWMmbkG8vTYxG\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"620010449518-9ngf7o4dhs0dka470npqvor6dc5lqb9b.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}") { Ok(secret) => (config_dir, secret), Err(e) => return Err(InvalidOptionsError::single(e, 4)) } }; let auth = yup_oauth2::InstalledFlowAuthenticator::builder( secret, yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect, ).persist_tokens_to_disk(format!("{}/dialogflow2-beta1", config_dir)).build().await.unwrap(); let client = if opt.is_present("debug") { hyper::Client::with_connector(mock::TeeConnector { connector: hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new()) }) } else { hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) }; let engine = Engine { opt: opt, hub: api::Dialogflow::new(client, auth), gp: vec!["$-xgafv", "access-token", "alt", "callback", "fields", "key", "oauth-token", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ ("$-xgafv", "$.xgafv"), ("access-token", "access_token"), ("oauth-token", "oauth_token"), ("pretty-print", "prettyPrint"), ("quota-user", "quotaUser"), ("upload-type", "uploadType"), ("upload-protocol", "upload_protocol"), ] }; match engine._doit(true).await { Err(Some(err)) => Err(err), Err(None) => Ok(engine), Ok(_) => unreachable!(), } } async fn doit(&self) -> Result<(), DoitError> { match self._doit(false).await { Ok(res) => res, Err(_) => unreachable!(), } } } #[tokio::main] async fn main() { let mut exit_status = 0i32; let arg_data = [ ("projects", "methods: 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-environments-list', 'agent-environments-users-sessions-contexts-create', 'agent-environments-users-sessions-contexts-delete', 'agent-environments-users-sessions-contexts-get', 'agent-environments-users-sessions-contexts-list', 'agent-environments-users-sessions-contexts-patch', 'agent-environments-users-sessions-delete-contexts', 'agent-environments-users-sessions-detect-intent', 'agent-environments-users-sessions-entity-types-create', 'agent-environments-users-sessions-entity-types-delete', 'agent-environments-users-sessions-entity-types-get', 'agent-environments-users-sessions-entity-types-list', 'agent-environments-users-sessions-entity-types-patch', 'agent-export', 'agent-get-fulfillment', 'agent-get-validation-result', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-knowledge-bases-create', 'agent-knowledge-bases-delete', 'agent-knowledge-bases-documents-create', 'agent-knowledge-bases-documents-delete', 'agent-knowledge-bases-documents-get', 'agent-knowledge-bases-documents-list', 'agent-knowledge-bases-documents-patch', 'agent-knowledge-bases-documents-reload', 'agent-knowledge-bases-get', 'agent-knowledge-bases-list', 'agent-knowledge-bases-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'agent-update-fulfillment', 'delete-agent', 'get-agent', 'knowledge-bases-create', 'knowledge-bases-delete', 'knowledge-bases-documents-create', 'knowledge-bases-documents-delete', 'knowledge-bases-documents-get', 'knowledge-bases-documents-list', 'knowledge-bases-documents-patch', 'knowledge-bases-documents-reload', 'knowledge-bases-get', 'knowledge-bases-list', 'knowledge-bases-patch', 'locations-agent-entity-types-batch-delete', 'locations-agent-entity-types-batch-update', 'locations-agent-entity-types-create', 'locations-agent-entity-types-delete', 'locations-agent-entity-types-entities-batch-create', 'locations-agent-entity-types-entities-batch-delete', 'locations-agent-entity-types-entities-batch-update', 'locations-agent-entity-types-get', 'locations-agent-entity-types-list', 'locations-agent-entity-types-patch', 'locations-agent-environments-list', 'locations-agent-environments-users-sessions-contexts-create', 'locations-agent-environments-users-sessions-contexts-delete', 'locations-agent-environments-users-sessions-contexts-get', 'locations-agent-environments-users-sessions-contexts-list', 'locations-agent-environments-users-sessions-contexts-patch', 'locations-agent-environments-users-sessions-delete-contexts', 'locations-agent-environments-users-sessions-detect-intent', 'locations-agent-environments-users-sessions-entity-types-create', 'locations-agent-environments-users-sessions-entity-types-delete', 'locations-agent-environments-users-sessions-entity-types-get', 'locations-agent-environments-users-sessions-entity-types-list', 'locations-agent-environments-users-sessions-entity-types-patch', 'locations-agent-export', 'locations-agent-get-fulfillment', 'locations-agent-import', 'locations-agent-intents-batch-delete', 'locations-agent-intents-batch-update', 'locations-agent-intents-create', 'locations-agent-intents-delete', 'locations-agent-intents-get', 'locations-agent-intents-list', 'locations-agent-intents-patch', 'locations-agent-restore', 'locations-agent-search', 'locations-agent-sessions-contexts-create', 'locations-agent-sessions-contexts-delete', 'locations-agent-sessions-contexts-get', 'locations-agent-sessions-contexts-list', 'locations-agent-sessions-contexts-patch', 'locations-agent-sessions-delete-contexts', 'locations-agent-sessions-detect-intent', 'locations-agent-sessions-entity-types-create', 'locations-agent-sessions-entity-types-delete', 'locations-agent-sessions-entity-types-get', 'locations-agent-sessions-entity-types-list', 'locations-agent-sessions-entity-types-patch', 'locations-agent-train', 'locations-agent-update-fulfillment', 'locations-delete-agent', 'locations-get-agent', 'locations-operations-cancel', 'locations-operations-get', 'locations-operations-list', 'locations-set-agent', 'operations-cancel', 'operations-get', 'operations-list' and 'set-agent'", vec![ ("agent-entity-types-batch-delete", Some(r##"Deletes entity types in the specified agent. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-batch-delete", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to delete all entities types for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-batch-update", Some(r##"Updates/Creates multiple entity types in the specified agent. Operation <response: BatchUpdateEntityTypesResponse>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-batch-update", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to update or create entity types in. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-create", Some(r##"Creates an entity type in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to create a entity type for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-delete", Some(r##"Deletes the specified entity type."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-entities-batch-create", Some(r##"Creates multiple new entities in the specified entity type. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-entities-batch-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the entity type to create entities in. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-entities-batch-delete", Some(r##"Deletes entities in the specified entity type. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-entities-batch-delete", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the entity type to delete entries for. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-entities-batch-update", Some(r##"Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-entities-batch-update", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the entity type to update or create entities in. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-get", Some(r##"Retrieves the specified entity type."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-list", Some(r##"Returns the list of all entity types in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to list all entity types from. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-entity-types-patch", Some(r##"Updates the specified entity type."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-patch", vec![ (Some(r##"name"##), None, Some(r##"The unique identifier of the entity type. Required for EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes methods. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-list", Some(r##"Returns the list of all non-draft environments of the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to list all environments from. Format: - `projects/<Project Number / ID>/agent` - `projects/<Project Number / ID>/locations/<Location ID>/agent"##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-contexts-create", Some(r##"Creates a context. If the specified context already exists, overrides the context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-contexts-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a context for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-contexts-delete", Some(r##"Deletes the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-contexts-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-contexts-get", Some(r##"Retrieves the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-contexts-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-contexts-list", Some(r##"Returns the list of all contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-contexts-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-contexts-patch", Some(r##"Updates the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-contexts-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. The following context names are reserved for internal use by Dialogflow. You should not use these contexts or create contexts with these names: * `__system_counters__` * `*_id_dialog_context` * `*_dialog_params_size`"##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-delete-contexts", Some(r##"Deletes all active contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-delete-contexts", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the session to delete all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-detect-intent", Some(r##"Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-detect-intent", vec![ (Some(r##"session"##), None, Some(r##"Required. The name of the session this query is sent to. Format: `projects/<Project ID>/agent/sessions/<Session ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we are using "-". It's up to the API caller to choose an appropriate `Session ID` and `User Id`. They can be a random number or some type of user and session identifiers (preferably hashed). The length of the `Session ID` and `User ID` must not exceed 36 characters."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-entity-types-create", Some(r##"Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a session entity type for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-entity-types-delete", Some(r##"Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-entity-types-get", Some(r##"Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-entity-types-list", Some(r##"Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all session entity types from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-environments-users-sessions-entity-types-patch", Some(r##"Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of this session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. `<Entity Type Display Name>` must be the display name of an existing entity type in the same agent that will be overridden or supplemented."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-export", Some(r##"Exports the specified agent to a ZIP file. Operation <response: ExportAgentResponse>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-export", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to export is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-get-fulfillment", Some(r##"Retrieves the fulfillment."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-get-fulfillment", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the fulfillment. Format: `projects/<Project ID>/agent/fulfillment`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-get-validation-result", Some(r##"Gets agent validation result. Agent validation is performed during training time and is updated automatically when training is completed."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-get-validation-result", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-import", Some(r##"Imports the specified agent from a ZIP file. Uploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from ImportAgentRequest. After the import, the imported draft agent will be trained automatically (unless disabled in agent settings). However, once the import is done, training may not be completed yet. Please call TrainAgent and wait for the operation it returns in order to train explicitly. Operation <response: google.protobuf.Empty> An operation which tracks when importing is complete. It only tracks when the draft agent is updated not when it is done training."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-import", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to import is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-intents-batch-delete", Some(r##"Deletes intents in the specified agent. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-batch-delete", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to delete all entities types for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-intents-batch-update", Some(r##"Updates/Creates multiple intents in the specified agent. Operation <response: BatchUpdateIntentsResponse>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-batch-update", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to update or create intents in. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-intents-create", Some(r##"Creates an intent in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to create a intent for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-intents-delete", Some(r##"Deletes the specified intent and its direct or indirect followup intents."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the intent to delete. If this intent has direct or indirect followup intents, we also delete them. Format: `projects/<Project ID>/agent/intents/<Intent ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-intents-get", Some(r##"Retrieves the specified intent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the intent. Format: `projects/<Project ID>/agent/intents/<Intent ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-intents-list", Some(r##"Returns the list of all intents in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to list all intents from. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-intents-patch", Some(r##"Updates the specified intent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-patch", vec![ (Some(r##"name"##), None, Some(r##"Optional. The unique identifier of this intent. Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Format: `projects/<Project ID>/agent/intents/<Intent ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-create", Some(r##"Creates a knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project to create a knowledge base for. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-delete", Some(r##"Deletes the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the knowledge base to delete. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-documents-create", Some(r##"Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The knoweldge base to create a document for. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-documents-delete", Some(r##"Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the document to delete. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-documents-get", Some(r##"Retrieves the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the document to retrieve. Format `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-documents-list", Some(r##"Returns the list of all documents of the knowledge base. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The knowledge base to list all documents for. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-documents-patch", Some(r##"Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-patch", vec![ (Some(r##"name"##), None, Some(r##"Optional. The document resource name. The name must be empty when creating a document. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-documents-reload", Some(r##"Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-reload", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the document to reload. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`"##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-get", Some(r##"Retrieves the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the knowledge base to retrieve. Format `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-list", Some(r##"Returns the list of all knowledge bases of the specified agent. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project to list of knowledge bases for. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-knowledge-bases-patch", Some(r##"Updates the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-patch", vec![ (Some(r##"name"##), None, Some(r##"The knowledge base resource name. The name must be empty when creating a knowledge base. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-restore", Some(r##"Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. After the restore, the restored draft agent will be trained automatically (unless disabled in agent settings). However, once the restore is done, training may not be completed yet. Please call TrainAgent and wait for the operation it returns in order to train explicitly. Operation <response: google.protobuf.Empty> An operation which tracks when restoring is complete. It only tracks when the draft agent is updated not when it is done training."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-restore", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to restore is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-search", Some(r##"Returns the list of agents. Since there is at most one conversational agent per project, this method is useful primarily for listing all agents across projects the caller has access to. One can achieve that with a wildcard project collection id "-". Refer to [List Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections)."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-search", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project to list agents from. Format: `projects/<Project ID or '-'>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-contexts-create", Some(r##"Creates a context. If the specified context already exists, overrides the context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a context for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-contexts-delete", Some(r##"Deletes the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-contexts-get", Some(r##"Retrieves the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-contexts-list", Some(r##"Returns the list of all contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-contexts-patch", Some(r##"Updates the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. The following context names are reserved for internal use by Dialogflow. You should not use these contexts or create contexts with these names: * `__system_counters__` * `*_id_dialog_context` * `*_dialog_params_size`"##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-delete-contexts", Some(r##"Deletes all active contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-delete-contexts", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the session to delete all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-detect-intent", Some(r##"Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-detect-intent", vec![ (Some(r##"session"##), None, Some(r##"Required. The name of the session this query is sent to. Format: `projects/<Project ID>/agent/sessions/<Session ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we are using "-". It's up to the API caller to choose an appropriate `Session ID` and `User Id`. They can be a random number or some type of user and session identifiers (preferably hashed). The length of the `Session ID` and `User ID` must not exceed 36 characters."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-entity-types-create", Some(r##"Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a session entity type for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-entity-types-delete", Some(r##"Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-entity-types-get", Some(r##"Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-entity-types-list", Some(r##"Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all session entity types from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-sessions-entity-types-patch", Some(r##"Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of this session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. `<Entity Type Display Name>` must be the display name of an existing entity type in the same agent that will be overridden or supplemented."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-train", Some(r##"Trains the specified agent. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-train", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to train is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("agent-update-fulfillment", Some(r##"Updates the fulfillment."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-update-fulfillment", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of the fulfillment. Format: `projects/<Project ID>/agent/fulfillment`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("delete-agent", Some(r##"Deletes the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_delete-agent", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to delete is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("get-agent", Some(r##"Retrieves the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_get-agent", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to fetch is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-create", Some(r##"Creates a knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project to create a knowledge base for. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-delete", Some(r##"Deletes the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the knowledge base to delete. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-documents-create", Some(r##"Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The knoweldge base to create a document for. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-documents-delete", Some(r##"Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the document to delete. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-documents-get", Some(r##"Retrieves the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the document to retrieve. Format `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-documents-list", Some(r##"Returns the list of all documents of the knowledge base. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The knowledge base to list all documents for. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-documents-patch", Some(r##"Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-patch", vec![ (Some(r##"name"##), None, Some(r##"Optional. The document resource name. The name must be empty when creating a document. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-documents-reload", Some(r##"Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-reload", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the document to reload. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`"##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-get", Some(r##"Retrieves the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the knowledge base to retrieve. Format `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-list", Some(r##"Returns the list of all knowledge bases of the specified agent. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project to list of knowledge bases for. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("knowledge-bases-patch", Some(r##"Updates the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-patch", vec![ (Some(r##"name"##), None, Some(r##"The knowledge base resource name. The name must be empty when creating a knowledge base. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-batch-delete", Some(r##"Deletes entity types in the specified agent. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-batch-delete", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to delete all entities types for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-batch-update", Some(r##"Updates/Creates multiple entity types in the specified agent. Operation <response: BatchUpdateEntityTypesResponse>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-batch-update", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to update or create entity types in. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-create", Some(r##"Creates an entity type in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to create a entity type for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-delete", Some(r##"Deletes the specified entity type."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-entities-batch-create", Some(r##"Creates multiple new entities in the specified entity type. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-entities-batch-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the entity type to create entities in. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-entities-batch-delete", Some(r##"Deletes entities in the specified entity type. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-entities-batch-delete", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the entity type to delete entries for. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-entities-batch-update", Some(r##"Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-entities-batch-update", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the entity type to update or create entities in. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-get", Some(r##"Retrieves the specified entity type."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-list", Some(r##"Returns the list of all entity types in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to list all entity types from. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-entity-types-patch", Some(r##"Updates the specified entity type."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-patch", vec![ (Some(r##"name"##), None, Some(r##"The unique identifier of the entity type. Required for EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes methods. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-list", Some(r##"Returns the list of all non-draft environments of the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to list all environments from. Format: - `projects/<Project Number / ID>/agent` - `projects/<Project Number / ID>/locations/<Location ID>/agent"##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-contexts-create", Some(r##"Creates a context. If the specified context already exists, overrides the context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a context for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-contexts-delete", Some(r##"Deletes the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-contexts-get", Some(r##"Retrieves the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-contexts-list", Some(r##"Returns the list of all contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-contexts-patch", Some(r##"Updates the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. The following context names are reserved for internal use by Dialogflow. You should not use these contexts or create contexts with these names: * `__system_counters__` * `*_id_dialog_context` * `*_dialog_params_size`"##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-delete-contexts", Some(r##"Deletes all active contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-delete-contexts", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the session to delete all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-detect-intent", Some(r##"Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-detect-intent", vec![ (Some(r##"session"##), None, Some(r##"Required. The name of the session this query is sent to. Format: `projects/<Project ID>/agent/sessions/<Session ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we are using "-". It's up to the API caller to choose an appropriate `Session ID` and `User Id`. They can be a random number or some type of user and session identifiers (preferably hashed). The length of the `Session ID` and `User ID` must not exceed 36 characters."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-entity-types-create", Some(r##"Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a session entity type for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-entity-types-delete", Some(r##"Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-entity-types-get", Some(r##"Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-entity-types-list", Some(r##"Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all session entity types from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-environments-users-sessions-entity-types-patch", Some(r##"Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of this session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. `<Entity Type Display Name>` must be the display name of an existing entity type in the same agent that will be overridden or supplemented."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-export", Some(r##"Exports the specified agent to a ZIP file. Operation <response: ExportAgentResponse>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-export", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to export is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-get-fulfillment", Some(r##"Retrieves the fulfillment."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-get-fulfillment", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the fulfillment. Format: `projects/<Project ID>/agent/fulfillment`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-import", Some(r##"Imports the specified agent from a ZIP file. Uploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from ImportAgentRequest. After the import, the imported draft agent will be trained automatically (unless disabled in agent settings). However, once the import is done, training may not be completed yet. Please call TrainAgent and wait for the operation it returns in order to train explicitly. Operation <response: google.protobuf.Empty> An operation which tracks when importing is complete. It only tracks when the draft agent is updated not when it is done training."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-import", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to import is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-intents-batch-delete", Some(r##"Deletes intents in the specified agent. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-batch-delete", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to delete all entities types for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-intents-batch-update", Some(r##"Updates/Creates multiple intents in the specified agent. Operation <response: BatchUpdateIntentsResponse>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-batch-update", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the agent to update or create intents in. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-intents-create", Some(r##"Creates an intent in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to create a intent for. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-intents-delete", Some(r##"Deletes the specified intent and its direct or indirect followup intents."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the intent to delete. If this intent has direct or indirect followup intents, we also delete them. Format: `projects/<Project ID>/agent/intents/<Intent ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-intents-get", Some(r##"Retrieves the specified intent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the intent. Format: `projects/<Project ID>/agent/intents/<Intent ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-intents-list", Some(r##"Returns the list of all intents in the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The agent to list all intents from. Format: `projects/<Project ID>/agent`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-intents-patch", Some(r##"Updates the specified intent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-patch", vec![ (Some(r##"name"##), None, Some(r##"Optional. The unique identifier of this intent. Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Format: `projects/<Project ID>/agent/intents/<Intent ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-restore", Some(r##"Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. After the restore, the restored draft agent will be trained automatically (unless disabled in agent settings). However, once the restore is done, training may not be completed yet. Please call TrainAgent and wait for the operation it returns in order to train explicitly. Operation <response: google.protobuf.Empty> An operation which tracks when restoring is complete. It only tracks when the draft agent is updated not when it is done training."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-restore", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to restore is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-search", Some(r##"Returns the list of agents. Since there is at most one conversational agent per project, this method is useful primarily for listing all agents across projects the caller has access to. One can achieve that with a wildcard project collection id "-". Refer to [List Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections)."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-search", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project to list agents from. Format: `projects/<Project ID or '-'>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-contexts-create", Some(r##"Creates a context. If the specified context already exists, overrides the context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a context for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-contexts-delete", Some(r##"Deletes the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-contexts-get", Some(r##"Retrieves the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-contexts-list", Some(r##"Returns the list of all contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-contexts-patch", Some(r##"Updates the specified context."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of the context. Format: `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>`. The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. The following context names are reserved for internal use by Dialogflow. You should not use these contexts or create contexts with these names: * `__system_counters__` * `*_id_dialog_context` * `*_dialog_params_size`"##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-delete-contexts", Some(r##"Deletes all active contexts in the specified session."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-delete-contexts", vec![ (Some(r##"parent"##), None, Some(r##"Required. The name of the session to delete all contexts from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-detect-intent", Some(r##"Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-detect-intent", vec![ (Some(r##"session"##), None, Some(r##"Required. The name of the session this query is sent to. Format: `projects/<Project ID>/agent/sessions/<Session ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we are using "-". It's up to the API caller to choose an appropriate `Session ID` and `User Id`. They can be a random number or some type of user and session identifiers (preferably hashed). The length of the `Session ID` and `User ID` must not exceed 36 characters."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-entity-types-create", Some(r##"Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a session entity type for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-entity-types-delete", Some(r##"Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-entity-types-get", Some(r##"Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-entity-types-list", Some(r##"Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all session entity types from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-sessions-entity-types-patch", Some(r##"Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of this session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user. `<Entity Type Display Name>` must be the display name of an existing entity type in the same agent that will be overridden or supplemented."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-train", Some(r##"Trains the specified agent. Operation <response: google.protobuf.Empty>"##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-train", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to train is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-agent-update-fulfillment", Some(r##"Updates the fulfillment."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-update-fulfillment", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of the fulfillment. Format: `projects/<Project ID>/agent/fulfillment`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-delete-agent", Some(r##"Deletes the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-delete-agent", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to delete is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-get-agent", Some(r##"Retrieves the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-get-agent", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project that the agent to fetch is associated with. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-operations-cancel", Some(r##"Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-operations-cancel", vec![ (Some(r##"name"##), None, Some(r##"The name of the operation resource to be cancelled."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-operations-get", Some(r##"Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-operations-get", vec![ (Some(r##"name"##), None, Some(r##"The name of the operation resource."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-operations-list", Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-operations-list", vec![ (Some(r##"name"##), None, Some(r##"The name of the operation's parent resource."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("locations-set-agent", Some(r##"Creates/updates the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-set-agent", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project of this agent. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("operations-cancel", Some(r##"Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_operations-cancel", vec![ (Some(r##"name"##), None, Some(r##"The name of the operation resource to be cancelled."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("operations-get", Some(r##"Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_operations-get", vec![ (Some(r##"name"##), None, Some(r##"The name of the operation resource."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("operations-list", Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_operations-list", vec![ (Some(r##"name"##), None, Some(r##"The name of the operation's parent resource."##), Some(true), Some(false)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ("set-agent", Some(r##"Creates/updates the specified agent."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_set-agent", vec![ (Some(r##"parent"##), None, Some(r##"Required. The project of this agent. Format: `projects/<Project ID>`."##), Some(true), Some(false)), (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), Some(true)), (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), Some(false), Some(true)), (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), Some(false), Some(false)), ]), ]), ]; let mut app = App::new("dialogflow2-beta1") .author("Sebastian Thiel <[email protected]>") .version("1.0.14+20200706") .about("Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli") .arg(Arg::with_name("url") .long("scope") .help("Specify the authentication a method should be executed in. Each scope requires the user to grant this application permission to use it.If unset, it defaults to the shortest scope url for a particular method.") .multiple(true) .takes_value(true)) .arg(Arg::with_name("folder") .long("config-dir") .help("A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation.[default: ~/.google-service-cli") .multiple(false) .takes_value(true)) .arg(Arg::with_name("debug") .long("debug") .help("Output all server communication to standard error. `tx` and `rx` are placed into the same stream.") .multiple(false) .takes_value(false)) .arg(Arg::with_name("debug-auth") .long("debug-auth") .help("Output all communication related to authentication to standard error. `tx` and `rx` are placed into the same stream.") .multiple(false) .takes_value(false)); for &(main_command_name, about, ref subcommands) in arg_data.iter() { let mut mcmd = SubCommand::with_name(main_command_name).about(about); for &(sub_command_name, ref desc, url_info, ref args) in subcommands { let mut scmd = SubCommand::with_name(sub_command_name); if let &Some(desc) = desc { scmd = scmd.about(desc); } scmd = scmd.after_help(url_info); for &(ref arg_name, ref flag, ref desc, ref required, ref multi) in args { let arg_name_str = match (arg_name, flag) { (&Some(an), _ ) => an, (_ , &Some(f)) => f, _ => unreachable!(), }; let mut arg = Arg::with_name(arg_name_str) .empty_values(false); if let &Some(short_flag) = flag { arg = arg.short(short_flag); } if let &Some(desc) = desc { arg = arg.help(desc); } if arg_name.is_some() && flag.is_some() { arg = arg.takes_value(true); } if let &Some(required) = required { arg = arg.required(required); } if let &Some(multi) = multi { arg = arg.multiple(multi); } scmd = scmd.arg(arg); } mcmd = mcmd.subcommand(scmd); } app = app.subcommand(mcmd); } let matches = app.get_matches(); let debug = matches.is_present("debug"); match Engine::new(matches) { Err(err) => { exit_status = err.exit_code; writeln!(io::stderr(), "{}", err).ok(); }, Ok(engine) => { if let Err(doit_err) = engine.doit().await { exit_status = 1; match doit_err { DoitError::IoError(path, err) => { writeln!(io::stderr(), "Failed to open output file '{}': {}", path, err).ok(); }, DoitError::ApiError(err) => { if debug { writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } } } } } } std::process::exit(exit_status); }
organization_details.py
from __future__ import absolute_import import logging import six from rest_framework import serializers, status from uuid import uuid4 from sentry import roles from sentry.api.base import DocSection from sentry.api.bases.organization import OrganizationEndpoint from sentry.api.decorators import sudo_required from sentry.api.fields import AvatarField from sentry.api.fields.empty_integer import EmptyIntegerField from sentry.api.serializers import serialize from sentry.api.serializers.models import organization as org_serializers from sentry.api.serializers.rest_framework import ListField from sentry.constants import LEGACY_RATE_LIMIT_OPTIONS, RESERVED_ORGANIZATION_SLUGS from sentry.lang.native.utils import STORE_CRASH_REPORTS_DEFAULT, convert_crashreport_count from sentry.models import ( AuditLogEntryEvent, Authenticator, AuthProvider, Organization, OrganizationAvatar, OrganizationOption, OrganizationStatus, ) from sentry.tasks.deletion import delete_organization from sentry.utils.apidocs import scenario, attach_scenarios from sentry.utils.cache import memoize ERR_DEFAULT_ORG = "You cannot remove the default organization." ERR_NO_USER = "This request requires an authenticated user." ERR_NO_2FA = "Cannot require two-factor authentication without personal two-factor enabled." ERR_SSO_ENABLED = "Cannot require two-factor authentication with SSO enabled" ORG_OPTIONS = ( # serializer field name, option key name, type, default value ( "projectRateLimit", "sentry:project-rate-limit", int, org_serializers.PROJECT_RATE_LIMIT_DEFAULT, ), ( "accountRateLimit", "sentry:account-rate-limit", int, org_serializers.ACCOUNT_RATE_LIMIT_DEFAULT, ), ("dataScrubber", "sentry:require_scrub_data", bool, org_serializers.REQUIRE_SCRUB_DATA_DEFAULT), ("sensitiveFields", "sentry:sensitive_fields", list, org_serializers.SENSITIVE_FIELDS_DEFAULT), ("safeFields", "sentry:safe_fields", list, org_serializers.SAFE_FIELDS_DEFAULT), ( "scrapeJavaScript", "sentry:scrape_javascript", bool, org_serializers.SCRAPE_JAVASCRIPT_DEFAULT, ), ( "dataScrubberDefaults", "sentry:require_scrub_defaults", bool, org_serializers.REQUIRE_SCRUB_DEFAULTS_DEFAULT, ), ( "storeCrashReports", "sentry:store_crash_reports", convert_crashreport_count, STORE_CRASH_REPORTS_DEFAULT, ), ( "attachmentsRole", "sentry:attachments_role", six.text_type, org_serializers.ATTACHMENTS_ROLE_DEFAULT, ), ( "scrubIPAddresses", "sentry:require_scrub_ip_address", bool, org_serializers.REQUIRE_SCRUB_IP_ADDRESS_DEFAULT, ), ("trustedRelays", "sentry:trusted-relays", list, org_serializers.TRUSTED_RELAYS_DEFAULT), ("allowJoinRequests", "sentry:join_requests", bool, org_serializers.JOIN_REQUESTS_DEFAULT), ) delete_logger = logging.getLogger("sentry.deletions.api") DELETION_STATUSES = frozenset( [OrganizationStatus.PENDING_DELETION, OrganizationStatus.DELETION_IN_PROGRESS] ) @scenario("RetrieveOrganization") def retrieve_organization_scenario(runner): runner.request(method="GET", path="/organizations/%s/" % runner.org.slug) @scenario("UpdateOrganization") def update_organization_scenario(runner): with runner.isolated_org("Badly Misnamed") as org: runner.request( method="PUT", path="/organizations/%s/" % org.slug, data={"name": "Impeccably Designated", "slug": "impeccably-designated"}, ) class OrganizationSerializer(serializers.Serializer): name = serializers.CharField(max_length=64) slug = serializers.RegexField(r"^[a-z0-9_\-]+$", max_length=50) accountRateLimit = EmptyIntegerField( min_value=0, max_value=1000000, required=False, allow_null=True ) projectRateLimit = EmptyIntegerField( min_value=50, max_value=100, required=False, allow_null=True ) avatar = AvatarField(required=False, allow_null=True) avatarType = serializers.ChoiceField( choices=(("upload", "upload"), ("letter_avatar", "letter_avatar")), required=False, allow_null=True, ) openMembership = serializers.BooleanField(required=False) allowSharedIssues = serializers.BooleanField(required=False) enhancedPrivacy = serializers.BooleanField(required=False) dataScrubber = serializers.BooleanField(required=False) dataScrubberDefaults = serializers.BooleanField(required=False) sensitiveFields = ListField(child=serializers.CharField(), required=False) safeFields = ListField(child=serializers.CharField(), required=False) storeCrashReports = serializers.IntegerField(min_value=-1, max_value=20, required=False) attachmentsRole = serializers.CharField(required=True) scrubIPAddresses = serializers.BooleanField(required=False) scrapeJavaScript = serializers.BooleanField(required=False) isEarlyAdopter = serializers.BooleanField(required=False) require2FA = serializers.BooleanField(required=False) trustedRelays = ListField(child=serializers.CharField(), required=False) allowJoinRequests = serializers.BooleanField(required=False) @memoize def _has_legacy_rate_limits(self): org = self.context["organization"] return OrganizationOption.objects.filter( organization=org, key__in=LEGACY_RATE_LIMIT_OPTIONS ).exists() def _has_sso_enabled(self): org = self.context["organization"] return AuthProvider.objects.filter(organization=org).exists() def validate_slug(self, value): # Historically, the only check just made sure there was more than 1 # character for the slug, but since then, there are many slugs that # fit within this new imposed limit. We're not fixing existing, but # just preventing new bad values. if len(value) < 3: raise serializers.ValidationError( 'This slug "%s" is too short. Minimum of 3 characters.' % (value,) ) if value in RESERVED_ORGANIZATION_SLUGS: raise serializers.ValidationError( 'This slug "%s" is reserved and not allowed.' % (value,) ) qs = Organization.objects.filter(slug=value).exclude(id=self.context["organization"].id) if qs.exists(): raise serializers.ValidationError('The slug "%s" is already in use.' % (value,)) return value def validate_sensitiveFields(self, value): if value and not all(value): raise serializers.ValidationError("Empty values are not allowed.") return value def validate_safeFields(self, value): if value and not all(value): raise serializers.ValidationError("Empty values are not allowed.") return value def validate_attachmentsRole(self, value): try: roles.get(value) except KeyError: raise serializers.ValidationError("Invalid role") return value def validate_require2FA(self, value): user = self.context["user"] has_2fa = Authenticator.objects.user_has_2fa(user) if value and not has_2fa: raise serializers.ValidationError(ERR_NO_2FA) if value and self._has_sso_enabled(): raise serializers.ValidationError(ERR_SSO_ENABLED) return value def validate_trustedRelays(self, value): from sentry import features organization = self.context["organization"] request = self.context["request"] has_relays = features.has("organizations:relay", organization, actor=request.user) if not has_relays: raise serializers.ValidationError( "Organization does not have the relay feature enabled" ) return value def validate_accountRateLimit(self, value): if not self._has_legacy_rate_limits: raise serializers.ValidationError( "The accountRateLimit option cannot be configured for this organization" ) return value def validate_projectRateLimit(self, value): if not self._has_legacy_rate_limits: raise serializers.ValidationError( "The accountRateLimit option cannot be configured for this organization" ) return value def validate(self, attrs): attrs = super(OrganizationSerializer, self).validate(attrs) if attrs.get("avatarType") == "upload": has_existing_file = OrganizationAvatar.objects.filter( organization=self.context["organization"], file__isnull=False ).exists() if not has_existing_file and not attrs.get("avatar"): raise serializers.ValidationError( {"avatarType": "Cannot set avatarType to upload without avatar"} ) return attrs def save(self): org = self.context["organization"] changed_data = {} for key, option, type_, default_value in ORG_OPTIONS: if key not in self.initial_data: continue try: option_inst = OrganizationOption.objects.get(organization=org, key=option) except OrganizationOption.DoesNotExist: OrganizationOption.objects.set_value( organization=org, key=option, value=type_(self.initial_data[key]) ) if self.initial_data[key] != default_value: changed_data[key] = u"to {}".format(self.initial_data[key]) else: option_inst.value = self.initial_data[key] # check if ORG_OPTIONS changed if option_inst.has_changed("value"): old_val = option_inst.old_value("value") changed_data[key] = u"from {} to {}".format(old_val, option_inst.value) option_inst.save() if "openMembership" in self.initial_data: org.flags.allow_joinleave = self.initial_data["openMembership"] if "allowSharedIssues" in self.initial_data: org.flags.disable_shared_issues = not self.initial_data["allowSharedIssues"] if "enhancedPrivacy" in self.initial_data: org.flags.enhanced_privacy = self.initial_data["enhancedPrivacy"] if "isEarlyAdopter" in self.initial_data: org.flags.early_adopter = self.initial_data["isEarlyAdopter"] if "require2FA" in self.initial_data: org.flags.require_2fa = self.initial_data["require2FA"] if "name" in self.initial_data: org.name = self.initial_data["name"] if "slug" in self.initial_data: org.slug = self.initial_data["slug"] org_tracked_field = { "name": org.name, "slug": org.slug, "default_role": org.default_role, "flag_field": { "allow_joinleave": org.flags.allow_joinleave.is_set, "enhanced_privacy": org.flags.enhanced_privacy.is_set, "disable_shared_issues": org.flags.disable_shared_issues.is_set, "early_adopter": org.flags.early_adopter.is_set, "require_2fa": org.flags.require_2fa.is_set, }, } # check if fields changed for f, v in six.iteritems(org_tracked_field): if f != "flag_field": if org.has_changed(f): old_val = org.old_value(f) changed_data[f] = u"from {} to {}".format(old_val, v) else: # check if flag fields changed for f, v in six.iteritems(org_tracked_field["flag_field"]): if org.flag_has_changed(f): changed_data[f] = u"to {}".format(v) org.save() if "avatar" in self.initial_data or "avatarType" in self.initial_data: OrganizationAvatar.save_avatar( relation={"organization": org}, type=self.initial_data.get("avatarType", "upload"), avatar=self.initial_data.get("avatar"), filename=u"{}.png".format(org.slug), ) if "require2FA" in self.initial_data and self.initial_data["require2FA"] is True: org.handle_2fa_required(self.context["request"]) return org, changed_data class OwnerOrganizationSerializer(OrganizationSerializer): defaultRole = serializers.ChoiceField(choices=roles.get_choices()) cancelDeletion = serializers.BooleanField(required=False) def save(self, *args, **kwargs): org = self.context["organization"] cancel_deletion = "cancelDeletion" in self.initial_data and org.status in DELETION_STATUSES if "defaultRole" in self.initial_data: org.default_role = self.initial_data["defaultRole"] if cancel_deletion: org.status = OrganizationStatus.VISIBLE return super(OwnerOrganizationSerializer, self).save(*args, **kwargs) class OrganizationDetailsEndpoint(OrganizationEndpoint): doc_section = DocSection.ORGANIZATIONS @attach_scenarios([retrieve_organization_scenario]) def get(self, request, organization): """ Retrieve an Organization ```````````````````````` Return details on an individual organization including various details such as membership access, features, and teams. :pparam string organization_slug: the slug of the organization the team should be created for. :param string detailed: Specify '0' to retrieve details without projects and teams. :auth: required """ is_detailed = request.GET.get("detailed", "1") != "0" serializer = ( org_serializers.DetailedOrganizationSerializerWithProjectsAndTeams if is_detailed else org_serializers.DetailedOrganizationSerializer ) context = serialize(organization, request.user, serializer(), access=request.access) return self.respond(context) @attach_scenarios([update_organization_scenario]) def put(self, request, organization): """ Update an Organization `````````````````````` Update various attributes and configurable settings for the given organization. :pparam string organization_slug: the slug of the organization the team should be created for. :param string name: an optional new name for the organization. :param string slug: an optional new slug for the organization. Needs to be available and unique. :auth: required """ if request.access.has_scope("org:admin"): serializer_cls = OwnerOrganizationSerializer else: serializer_cls = OrganizationSerializer was_pending_deletion = organization.status in DELETION_STATUSES
serializer = serializer_cls( data=request.data, partial=True, context={"organization": organization, "user": request.user, "request": request}, ) if serializer.is_valid(): organization, changed_data = serializer.save() if was_pending_deletion: self.create_audit_entry( request=request, organization=organization, target_object=organization.id, event=AuditLogEntryEvent.ORG_RESTORE, data=organization.get_audit_log_data(), ) delete_logger.info( "object.delete.canceled", extra={"object_id": organization.id, "model": Organization.__name__}, ) elif changed_data: self.create_audit_entry( request=request, organization=organization, target_object=organization.id, event=AuditLogEntryEvent.ORG_EDIT, data=changed_data, ) return self.respond( serialize( organization, request.user, org_serializers.DetailedOrganizationSerializerWithProjectsAndTeams(), access=request.access, ) ) return self.respond(serializer.errors, status=status.HTTP_400_BAD_REQUEST) @sudo_required def delete(self, request, organization): """ Delete an Organization `````````````````````` Schedules an organization for deletion. This API endpoint cannot be invoked without a user context for security reasons. This means that at present an organization can only be deleted from the Sentry UI. Deletion happens asynchronously and therefor is not immediate. However once deletion has begun the state of a project changes and will be hidden from most public views. :pparam string organization_slug: the slug of the organization the team should be created for. :auth: required, user-context-needed """ if not request.user.is_authenticated(): return self.respond({"detail": ERR_NO_USER}, status=401) if organization.is_default: return self.respond({"detail": ERR_DEFAULT_ORG}, status=400) updated = Organization.objects.filter( id=organization.id, status=OrganizationStatus.VISIBLE ).update(status=OrganizationStatus.PENDING_DELETION) if updated: transaction_id = uuid4().hex countdown = 86400 entry = self.create_audit_entry( request=request, organization=organization, target_object=organization.id, event=AuditLogEntryEvent.ORG_REMOVE, data=organization.get_audit_log_data(), transaction_id=transaction_id, ) organization.send_delete_confirmation(entry, countdown) delete_organization.apply_async( kwargs={ "object_id": organization.id, "transaction_id": transaction_id, "actor_id": request.user.id, }, countdown=countdown, ) delete_logger.info( "object.delete.queued", extra={ "object_id": organization.id, "transaction_id": transaction_id, "model": Organization.__name__, }, ) context = serialize( organization, request.user, org_serializers.DetailedOrganizationSerializerWithProjectsAndTeams(), access=request.access, ) return self.respond(context, status=202)
app.module.js
import * as tslib_1 from "tslib"; import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AppRoutingModule } from './app-routing.module'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { AppComponent } from './app.component'; import { NavbarComponent } from './navbar/navbar.component'; import { SidebarComponent } from './sidebar/sidebar.component'; import { FooterComponent } from './footer/footer.component'; import { DashboardComponent } from './dashboard/dashboard.component'; import { TablesComponent } from './tables/tables.component'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatSortModule, MatTableModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatRippleModule, MatOptionModule, MatSelectModule, MatDialogModule, MatIconModule, MatExpansionModule, MatTabsModule, MatCheckboxModule, MatSidenavModule, MatToolbarModule, MatListModule, MatDatepickerModule, MatNativeDateModule, MatRadioModule } from '@angular/material'; import { DepartmentComponent } from './masterPages/department/department.component'; import { HttpClientModule } from '@angular/common/http'; import { CommonModule } from '@angular/common'; import { DesignationComponent } from './masterPages/designation/designation.component'; import { MasterPagesService } from './masterPages/shared/master-pages.service'; import { TeamComponent } from './masterPages/Team/team.component'; import { RoleComponent } from './masterPages/role/role.component'; import { AssetCategoryComponent } from './masterPages/assetCategory/assetCategory.component'; import { AssetSubCategoryComponent } from './masterPages/AssetSubCategory/assetSubCategory.component'; import { ProductComponent } from './masterPages/Product/product.component'; import { ProductTypeComponent } from './masterPages/ProductType/productType.component'; import { SoftwareTypeComponent } from './masterPages/SoftwareType/SoftwareType.component'; import { SoftwareCategoryComponent } from './masterPages/SoftwareCategory/SoftwareCategory.component'; import { TimezoneComponent } from './masterPages/TimeZone/TimeZone.component'; import { LocationGeneralComponent } from './commonViews/location-general/location-general.component'; import { CommonDepartmentComponent } from './commonViews/common-department/common-department.component'; import { CommonDesignationComponent } from './commonViews/common-designation/common-designation.component'; import { CommonTeamComponent } from './commonViews/common-team/common-team.component'; import { CommonAssetsComponent } from './commonViews/common-assets/common-assets.component'; import { CommonAssetHistoryComponent } from './commonViews/common-asset-history/common-asset-history.component'; import { CommonContactsComponent } from './commonViews/common-contacts/common-contacts.component'; import { CommonDocumentsComponent } from './commonViews/common-documents/common-documents.component'; import { CommonHistoryComponent } from './commonViews/common-history/common-history.component'; import { CommonTicketComponent } from './commonViews/common-ticket/common-ticket.component'; import { LocationViewComponent } from './view/locationView/locationView.component'; import { LocationListComponent } from './View/locationView/location-list/location-list.component'; import { ContactsViewComponent } from './view/contactsView/contactsView.component'; import { ContactsListComponent } from './view/contactsView/contacts-list/contacts-list.component'; import { AssetsViewComponent } from './view/assetsView/assetsView.component'; import { AssetsListComponent } from './view/assetsView/assets-list/assets-list.component'; import { TicketViewComponent } from './view/ticketView/ticketView.component'; import { TicketListComponent } from './view/ticketView/ticket-list/ticket-list.component'; import { DocumentViewComponent } from './view/documentView/documentView.component'; import { DocumentListComponent } from './view/documentView/document-list/document-list.component'; import { ContactsGeneralComponent } from './commonViews/contacts-general/contacts-general.component'; import { LocationGlobalComponent } from './commonViews/location-global/location-global.component'; import { ContactsGlobalComponent } from './commonViews/contacts-global/contacts-global.component'; import { AssetsGlobalComponent } from './commonViews/assets-global/assets-global.component'; import { AssetsGeneralComponent } from './commonViews/assets-general/assets-general.component'; import { DocumentsGlobalComponent } from './commonViews/documents-global/documents-global.component'; import { DocumentsGeneralComponent } from './commonViews/documents-general/documents-general.component'; import { TicketGeneralComponent } from './commonViews/ticket-general/ticket-general.component'; import { TicketGlobalComponent } from './commonViews/ticket-global/ticket-global.component'; import { TicketCategoryComponent } from './masterPages/ticketCategory/ticketCategory.component'; import { TicketSubCategoryComponent } from './masterPages/ticketSubCategory/ticketSubCategory.component'; import { A11yModule } from '@angular/cdk/a11y'; import { BidiModule } from '@angular/cdk/bidi'; import { ObserversModule } from '@angular/cdk/observers'; import { OverlayModule } from '@angular/cdk/overlay'; import { PlatformModule } from '@angular/cdk/platform'; import { PortalModule } from '@angular/cdk/portal';
import { ScrollDispatchModule } from '@angular/cdk/scrolling'; import { CdkStepperModule } from '@angular/cdk/stepper'; import { CdkTableModule } from '@angular/cdk/table'; import { DepartmentDialogBoxComponent } from './masterPages/department/department-dialog-box/department-dialog-box.component'; import { DesignationtDialogBoxComponent } from './masterPages/designation/designationt-dialog-box/designationt-dialog-box.component'; import { RoleDialogBoxComponent } from './masterPages/role/role-dialog-box/role-dialog-box.component'; import { AssetCategoryDialogBoxComponent } from './masterPages/assetCategory/asset-category-dialog-box/asset-category-dialog-box.component'; import { ProductDialogBoxComponent } from './masterPages/Product/product-dialog-box/product-dialog-box.component'; import { ProductTypeDialogBoxComponent } from './masterPages/ProductType/product-type-dialog-box/product-type-dialog-box.component'; import { SoftwareTypeDialogBoxComponent } from './masterPages/SoftwareType/software-type-dialog-box/software-type-dialog-box.component'; import { TeamDialogBoxComponent } from './masterPages/Team/team-dialog-box/team-dialog-box.component'; import { AssetSubCategoryDialogBoxComponent } from './masterPages/AssetSubCategory/asset-sub-category-dialog-box/asset-sub-category-dialog-box.component'; import { TicketSubCategoryDialogBoxComponent } from './masterPages/ticketSubCategory/ticket-sub-category-dialog-box/ticket-sub-category-dialog-box.component'; import { ToastrModule } from 'ngx-toastr'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TicketCategoryDialogBoxComponent } from './masterPages/ticketCategory/ticket-category-dialog-box/ticket-category-dialog-box.component'; let AppModule = class AppModule { }; AppModule = tslib_1.__decorate([ NgModule({ declarations: [ AppComponent, NavbarComponent, SidebarComponent, FooterComponent, DashboardComponent, TablesComponent, DepartmentComponent, DesignationComponent, TeamComponent, RoleComponent, AssetCategoryComponent, AssetSubCategoryComponent, ProductComponent, ProductTypeComponent, SoftwareTypeComponent, SoftwareCategoryComponent, TimezoneComponent, LocationGeneralComponent, CommonDepartmentComponent, CommonDesignationComponent, CommonTeamComponent, CommonAssetsComponent, CommonAssetHistoryComponent, CommonContactsComponent, CommonDocumentsComponent, CommonHistoryComponent, CommonTicketComponent, LocationViewComponent, LocationListComponent, ContactsViewComponent, ContactsListComponent, AssetsViewComponent, AssetsListComponent, TicketViewComponent, TicketListComponent, DocumentViewComponent, DocumentListComponent, ContactsGeneralComponent, LocationGlobalComponent, ContactsGlobalComponent, AssetsGlobalComponent, AssetsGeneralComponent, DocumentsGlobalComponent, DocumentsGeneralComponent, TicketGeneralComponent, TicketGlobalComponent, TicketCategoryComponent, TicketSubCategoryComponent, DepartmentDialogBoxComponent, DesignationtDialogBoxComponent, RoleDialogBoxComponent, AssetCategoryDialogBoxComponent, ProductDialogBoxComponent, ProductTypeDialogBoxComponent, SoftwareTypeDialogBoxComponent, TeamDialogBoxComponent, AssetSubCategoryDialogBoxComponent, TicketSubCategoryDialogBoxComponent, TicketCategoryDialogBoxComponent ], imports: [ BrowserAnimationsModule, ToastrModule.forRoot(), BrowserModule, RouterModule, AppRoutingModule, CommonModule, FormsModule, NgbModule.forRoot(), NoopAnimationsModule, BrowserAnimationsModule, ReactiveFormsModule, HttpClientModule, MatSortModule, MatTableModule, MatButtonModule, MatFormFieldModule, MatInputModule, MatRippleModule, MatOptionModule, MatSelectModule, MatButtonModule, MatDialogModule, MatIconModule, MatExpansionModule, MatTabsModule, MatCheckboxModule, MatSidenavModule, MatListModule, MatToolbarModule, MatDatepickerModule, MatNativeDateModule, MatRadioModule, MatCheckboxModule, A11yModule, BidiModule, ObserversModule, OverlayModule, PlatformModule, PortalModule, ScrollDispatchModule, CdkStepperModule, CdkTableModule, ], entryComponents: [ DepartmentDialogBoxComponent, DesignationtDialogBoxComponent, RoleDialogBoxComponent, AssetCategoryDialogBoxComponent, ProductDialogBoxComponent, ProductTypeDialogBoxComponent, SoftwareTypeDialogBoxComponent, TeamDialogBoxComponent, AssetSubCategoryDialogBoxComponent, TicketSubCategoryDialogBoxComponent, LocationGlobalComponent, ContactsGlobalComponent, AssetsGlobalComponent, TicketGlobalComponent, DocumentsGlobalComponent, TicketCategoryDialogBoxComponent ], providers: [MasterPagesService], bootstrap: [AppComponent] }) ], AppModule); export { AppModule }; //# sourceMappingURL=app.module.js.map
0003_auto_20160504_0937.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-05-04 13:37 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class
(migrations.Migration): dependencies = [ ('occurrence', '0002_auto_20160415_1549'), ] operations = [ migrations.AlterField( model_name='occurrence', name='basket', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='occurs', to='hit.Basket'), ), ]
Migration
genfiles.py
#!/usr/bin/env python import os import uuid from xml.sax.saxutils import escape scriptDir = os.path.dirname(os.path.normpath(os.path.abspath(__file__))) buildDir = os.path.join(os.path.dirname(os.path.dirname(scriptDir)), 'build') dirs = { 'ELECTRONDIR': 'BitcoenWallet-win32-x64', 'COREDIR': 'core', } def print2(str): # On Windows `print` sometimes causes "IOError [errno 0]". try: print(str) except: pass def toIdentifier(string): id = '' first = True for ch in string: c = ord(ch) if (c >= ord('a') and c <= ord('z')) or (c >= ord('A') and c <= ord('Z')) or ch == '_': id += ch elif (c >= ord('0') and c <= ord('9')) or ch == '.': #if first: # id += '_' id += ch else: id += '_' first = False return id def guidForFile(name): if os.path.exists('guids.lst'): with open('guids.lst', "r") as f: for line in f.readlines(): s = line.rstrip().split(' ', 1) if s[1] == name: return s[0] guid = uuid.uuid1() with open('guids.lst', "a") as f: f.write('%s %s\n' % (guid, name)) return guid def addDir(dirId, path, indent = ' '): print2(path) for file in os.listdir(os.path.join(buildDir, path)): if file == 'BitcoenWallet.exe': continue relpath = os.path.join(path, file) srcpath = os.path.join('..', '..', 'build', relpath) fileId = '%s.%s' % (dirId, toIdentifier(file)) if len(fileId) > 72: fileId = '_' + fileId[len(fileId)-71:] if os.path.isdir(srcpath): f.write('%s<Directory Id="%s" Name="%s">\n' % (indent, fileId, escape(file))) addDir(fileId, relpath, indent + ' ') f.write('%s</Directory>\n' % (indent)) else: allIds.append(fileId) guid = guidForFile(relpath)
allIds = [] with open("files.wxi", "w") as f: f.write('<?xml version="1.0" encoding="windows-1251"?>\n') f.write('<Include>\n') for dirId, path in dirs.items(): f.write(' <DirectoryRef Id="%s">\n' % dirId) addDir(dirId, path) f.write(' </DirectoryRef>\n') f.write(' <Feature\n') f.write(' Id="Complete"\n') f.write(' Level="1"\n') f.write(' Title="BitCoen Wallet"\n') f.write(' Description="The complete package."\n') f.write(' AllowAdvertise="no"\n') f.write(' InstallDefault="local"\n') f.write(' Absent="disallow"\n') f.write(' ConfigurableDirectory="INSTALLDIR">\n') f.write(' <ComponentRef Id="BitcoenWallet.exe" />\n') for id in allIds: f.write(' <ComponentRef Id="%s" />\n' % id) f.write(' <ComponentRef Id="ProgramMenuDir" />\n') f.write(' </Feature>\n') f.write('</Include>\n')
f.write('%s<Component Id="%s" Guid="%s">\n' % (indent, fileId, str(guid))) f.write('%s <File Id="%s" Name="%s" Source="%s" KeyPath="yes" />\n' % (indent, fileId, escape(file), escape(srcpath))) f.write('%s</Component>\n' % indent)
unistra.py
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import qualities class UnistraIE(InfoExtractor):
_VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)' _TESTS = [ { 'url': 'http://utv.unistra.fr/video.php?id_video=154', 'md5': '736f605cfdc96724d55bb543ab3ced24', 'info_dict': { 'id': '154', 'ext': 'mp4', 'title': 'M!ss Yella', 'description': 'md5:104892c71bd48e55d70b902736b81bbf', }, }, { 'url': 'http://utv.unistra.fr/index.php?id_video=437', 'md5': '1ddddd6cccaae76f622ce29b8779636d', 'info_dict': { 'id': '437', 'ext': 'mp4', 'title': 'Prix Louise Weiss 2014', 'description': 'md5:cc3a8735f079f4fb6b0b570fc10c135a', }, } ] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') webpage = self._download_webpage(url, video_id) files = set(re.findall(r'file\s*:\s*"([^"]+)"', webpage)) quality = qualities(['SD', 'HD']) formats = [] for file_path in files: format_id = 'HD' if file_path.endswith('-HD.mp4') else 'SD' formats.append({ 'url': 'http://vod-flash.u-strasbg.fr:8080%s' % file_path, 'format_id': format_id, 'quality': quality(format_id) }) title = self._html_search_regex( r'<title>UTV - (.*?)</', webpage, 'title') description = self._html_search_regex( r'<meta name="Description" content="(.*?)"', webpage, 'description', flags=re.DOTALL) thumbnail = self._search_regex( r'image: "(.*?)"', webpage, 'thumbnail') return { 'id': video_id, 'title': title, 'description': description, 'thumbnail': thumbnail, 'formats': formats }
rbd.py
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """RADOS Block Device Driver""" from __future__ import absolute_import import json import math import os import tempfile from eventlet import tpool from oslo_config import cfg from oslo_log import log as logging from oslo_utils import fileutils from oslo_utils import units import six from six.moves import urllib from cinder import exception from cinder.i18n import _ from cinder.image import image_utils from cinder import interface from cinder.objects import fields from cinder import utils from cinder.volume import configuration from cinder.volume import driver try: import rados import rbd except ImportError: rados = None rbd = None LOG = logging.getLogger(__name__) RBD_OPTS = [ cfg.StrOpt('rbd_cluster_name', default='ceph', help='The name of ceph cluster'), cfg.StrOpt('rbd_pool', default='rbd', help='The RADOS pool where rbd volumes are stored'), cfg.StrOpt('rbd_user', help='The RADOS client name for accessing rbd volumes ' '- only set when using cephx authentication'), cfg.StrOpt('rbd_ceph_conf', default='', # default determined by librados help='Path to the ceph configuration file'), cfg.StrOpt('rbd_keyring_conf', default='', help='Path to the ceph keyring file'), cfg.BoolOpt('rbd_flatten_volume_from_snapshot', default=False, help='Flatten volumes created from snapshots to remove ' 'dependency from volume to snapshot'), cfg.StrOpt('rbd_secret_uuid', help='The libvirt uuid of the secret for the rbd_user ' 'volumes'), cfg.IntOpt('rbd_max_clone_depth', default=5, help='Maximum number of nested volume clones that are ' 'taken before a flatten occurs. Set to 0 to disable ' 'cloning.'), cfg.IntOpt('rbd_store_chunk_size', default=4, help='Volumes will be chunked into objects of this size ' '(in megabytes).'), cfg.IntOpt('rados_connect_timeout', default=-1, help='Timeout value (in seconds) used when connecting to ' 'ceph cluster. If value < 0, no timeout is set and ' 'default librados value is used.'), cfg.IntOpt('rados_connection_retries', default=3, help='Number of retries if connection to ceph cluster ' 'failed.'), cfg.IntOpt('rados_connection_interval', default=5, help='Interval value (in seconds) between connection ' 'retries to ceph cluster.'), cfg.IntOpt('replication_connect_timeout', default=5, help='Timeout value (in seconds) used when connecting to ' 'ceph cluster to do a demotion/promotion of volumes. ' 'If value < 0, no timeout is set and default librados ' 'value is used.'), cfg.BoolOpt('report_dynamic_total_capacity', default=True, help='Set to True for driver to report total capacity as a ' 'dynamic value -used + current free- and to False to ' 'report a static value -quota max bytes if defined and ' 'global size of cluster if not-.'), ] CONF = cfg.CONF CONF.register_opts(RBD_OPTS, group=configuration.SHARED_CONF_GROUP) EXTRA_SPECS_REPL_ENABLED = "replication_enabled" class RBDVolumeProxy(object): """Context manager for dealing with an existing rbd volume. This handles connecting to rados and opening an ioctx automatically, and otherwise acts like a librbd Image object. The underlying librados client and ioctx can be accessed as the attributes 'client' and 'ioctx'. """ def __init__(self, driver, name, pool=None, snapshot=None, read_only=False, remote=None, timeout=None): client, ioctx = driver._connect_to_rados(pool, remote, timeout) if snapshot is not None: snapshot = utils.convert_str(snapshot) try: self.volume = driver.rbd.Image(ioctx, utils.convert_str(name), snapshot=snapshot, read_only=read_only) self.volume = tpool.Proxy(self.volume) except driver.rbd.Error: LOG.exception("error opening rbd image %s", name) driver._disconnect_from_rados(client, ioctx) raise self.driver = driver self.client = client self.ioctx = ioctx def __enter__(self): return self def __exit__(self, type_, value, traceback): try: self.volume.close() finally: self.driver._disconnect_from_rados(self.client, self.ioctx) def __getattr__(self, attrib): return getattr(self.volume, attrib) class RADOSClient(object): """Context manager to simplify error handling for connecting to ceph.""" def __init__(self, driver, pool=None): self.driver = driver self.cluster, self.ioctx = driver._connect_to_rados(pool) def __enter__(self): return self def __exit__(self, type_, value, traceback): self.driver._disconnect_from_rados(self.cluster, self.ioctx) @property def features(self): features = self.cluster.conf_get('rbd_default_features') if ((features is None) or (int(features) == 0)): features = self.driver.rbd.RBD_FEATURE_LAYERING return int(features) @interface.volumedriver class RBDDriver(driver.CloneableImageVD, driver.MigrateVD, driver.ManageableVD, driver.BaseVD): """Implements RADOS block device (RBD) volume commands.""" VERSION = '1.2.0' # ThirdPartySystems wiki page CI_WIKI_NAME = "Cinder_Jenkins" SYSCONFDIR = '/etc/ceph/' def __init__(self, active_backend_id=None, *args, **kwargs): super(RBDDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(RBD_OPTS) self._stats = {} # allow overrides for testing self.rados = kwargs.get('rados', rados) self.rbd = kwargs.get('rbd', rbd) # All string args used with librbd must be None or utf-8 otherwise # librbd will break. for attr in ['rbd_cluster_name', 'rbd_user', 'rbd_ceph_conf', 'rbd_pool']: val = getattr(self.configuration, attr) if val is not None: setattr(self.configuration, attr, utils.convert_str(val)) self._backend_name = (self.configuration.volume_backend_name or self.__class__.__name__) self._active_backend_id = active_backend_id self._active_config = {} self._is_replication_enabled = False self._replication_targets = [] self._target_names = [] def _get_target_config(self, target_id): """Get a replication target from known replication targets.""" for target in self._replication_targets: if target['name'] == target_id: return target if not target_id or target_id == 'default': return { 'name': self.configuration.rbd_cluster_name, 'conf': self.configuration.rbd_ceph_conf, 'user': self.configuration.rbd_user } raise exception.InvalidReplicationTarget( reason=_('RBD: Unknown failover target host %s.') % target_id) def do_setup(self, context): """Performs initialization steps that could raise exceptions.""" self._do_setup_replication() self._active_config = self._get_target_config(self._active_backend_id) def _do_setup_replication(self): replication_devices = self.configuration.safe_get( 'replication_device') if replication_devices: self._parse_replication_configs(replication_devices) self._is_replication_enabled = True self._target_names.append('default') def
(self, replication_devices): for replication_device in replication_devices: if 'backend_id' not in replication_device: msg = _('Missing backend_id in replication_device ' 'configuration.') raise exception.InvalidConfigurationValue(msg) name = replication_device['backend_id'] conf = replication_device.get('conf', self.SYSCONFDIR + name + '.conf') user = replication_device.get( 'user', self.configuration.rbd_user or 'cinder') # Pool has to be the same in all clusters replication_target = {'name': name, 'conf': utils.convert_str(conf), 'user': utils.convert_str(user)} LOG.info('Adding replication target: %s.', name) self._replication_targets.append(replication_target) self._target_names.append(name) def _get_config_tuple(self, remote=None): if not remote: remote = self._active_config return (remote.get('name'), remote.get('conf'), remote.get('user')) def check_for_setup_error(self): """Returns an error if prerequisites aren't met.""" if rados is None: msg = _('rados and rbd python libraries not found') raise exception.VolumeBackendAPIException(data=msg) for attr in ['rbd_cluster_name', 'rbd_pool']: val = getattr(self.configuration, attr) if not val: raise exception.InvalidConfigurationValue(option=attr, value=val) # WRS: Wait for RADOS to be ready, once driver is correctly # initialized then system can easily recover from temporary failures. # Otherwise, if we don't wait here, then cinder-volume will just abort # after 6 retries (~ 30mins). LOG.info("Checking Ceph cluster connectivity") while 1: try: # NOTE: Checking connection to ceph # RADOSClient __init__ method invokes _connect_to_rados # so no need to check for self.rados.Error here. with RADOSClient(self): LOG.info("Ceph cluster is up, continuing with " "driver initialization") break except exception.VolumeBackendAPIException: LOG.warning("Ceph is down, retrying") pass def RBDProxy(self): return tpool.Proxy(self.rbd.RBD()) def _ceph_args(self): args = [] name, conf, user = self._get_config_tuple() if user: args.extend(['--id', user]) if name: args.extend(['--cluster', name]) if conf: args.extend(['--conf', conf]) return args def _connect_to_rados(self, pool=None, remote=None, timeout=None): @utils.retry(exception.VolumeBackendAPIException, self.configuration.rados_connection_interval, self.configuration.rados_connection_retries) def _do_conn(pool, remote, timeout): name, conf, user = self._get_config_tuple(remote) if pool is not None: pool = utils.convert_str(pool) else: pool = self.configuration.rbd_pool if timeout is None: timeout = self.configuration.rados_connect_timeout LOG.debug("connecting to %(name)s (timeout=%(timeout)s).", {'name': name, 'timeout': timeout}) client = self.rados.Rados(rados_id=user, clustername=name, conffile=conf) try: if timeout >= 0: timeout = six.text_type(timeout) client.conf_set('rados_osd_op_timeout', timeout) client.conf_set('rados_mon_op_timeout', timeout) client.conf_set('client_mount_timeout', timeout) client.connect() ioctx = client.open_ioctx(pool) return client, ioctx except self.rados.Error: msg = _("Error connecting to ceph cluster.") LOG.exception(msg) client.shutdown() raise exception.VolumeBackendAPIException(data=msg) return _do_conn(pool, remote, timeout) def _disconnect_from_rados(self, client, ioctx): # closing an ioctx cannot raise an exception ioctx.close() client.shutdown() def _get_backup_snaps(self, rbd_image): """Get list of any backup snapshots that exist on this volume. There should only ever be one but accept all since they need to be deleted before the volume can be. """ # NOTE(dosaboy): we do the import here otherwise we get import conflict # issues between the rbd driver and the ceph backup driver. These # issues only seem to occur when NOT using them together and are # triggered when the ceph backup driver imports the rbd volume driver. from cinder.backup.drivers import ceph return ceph.CephBackupDriver.get_backup_snaps(rbd_image) def _get_mon_addrs(self): args = ['ceph', 'mon', 'dump', '--format=json'] args.extend(self._ceph_args()) out, _ = self._execute(*args) lines = out.split('\n') if lines[0].startswith('dumped monmap epoch'): lines = lines[1:] monmap = json.loads('\n'.join(lines)) addrs = [mon['addr'] for mon in monmap['mons']] hosts = [] ports = [] for addr in addrs: host_port = addr[:addr.rindex('/')] host, port = host_port.rsplit(':', 1) hosts.append(host.strip('[]')) ports.append(port) return hosts, ports def _get_usage_info(self): """Calculate provisioned volume space in GiB. Stats report should send provisioned size of volumes (snapshot must not be included) and not the physical size of those volumes. We must include all volumes, not only Cinder created volumes, because Cinder created volumes are reported by the Cinder core code as allocated_capacity_gb. """ total_provisioned = 0 with RADOSClient(self) as client: for t in self.RBDProxy().list(client.ioctx): with RBDVolumeProxy(self, t, read_only=True) as v: try: size = v.size() except self.rbd.ImageNotFound: LOG.debug("Image %s is not found.", t) else: total_provisioned += size total_provisioned = math.ceil(float(total_provisioned) / units.Gi) return total_provisioned def _get_pool_stats(self): """Gets pool free and total capacity in GiB. Calculate free and total capacity of the pool based on the pool's defined quota and pools stats. Returns a tuple with (free, total) where they are either unknown or a real number with a 2 digit precision. """ pool_name = self.configuration.rbd_pool with RADOSClient(self) as client: ret, df_outbuf, __ = client.cluster.mon_command( '{"prefix":"df", "format":"json"}', '') if ret: LOG.warning('Unable to get rados pool stats.') return 'unknown', 'unknown' ret, quota_outbuf, __ = client.cluster.mon_command( '{"prefix":"osd pool get-quota", "pool": "%s",' ' "format":"json"}' % pool_name, '') if ret: LOG.warning('Unable to get rados pool quotas.') return 'unknown', 'unknown' df_data = json.loads(df_outbuf) pool_stats = [pool for pool in df_data['pools'] if pool['name'] == pool_name][0]['stats'] bytes_quota = json.loads(quota_outbuf)['quota_max_bytes'] # With quota the total is the quota limit and free is quota - used if bytes_quota: total_capacity = bytes_quota free_capacity = max(min(total_capacity - pool_stats['bytes_used'], pool_stats['max_avail']), 0) # Without quota free is pools max available and total is global size else: total_capacity = df_data['stats']['total_bytes'] free_capacity = pool_stats['max_avail'] # If we want dynamic total capacity (default behavior) if self.configuration.safe_get('report_dynamic_total_capacity'): total_capacity = free_capacity + pool_stats['bytes_used'] free_capacity = round((float(free_capacity) / units.Gi), 2) total_capacity = round((float(total_capacity) / units.Gi), 2) return free_capacity, total_capacity def _update_volume_stats(self): stats = { 'vendor_name': 'Open Source', 'driver_version': self.VERSION, 'storage_protocol': 'ceph', 'total_capacity_gb': 'unknown', 'free_capacity_gb': 'unknown', 'provisioned_capacity_gb': 0, 'reserved_percentage': ( self.configuration.safe_get('reserved_percentage')), 'multiattach': False, 'thin_provisioning_support': True, 'max_over_subscription_ratio': ( self.configuration.safe_get('max_over_subscription_ratio')) } backend_name = self.configuration.safe_get('volume_backend_name') stats['volume_backend_name'] = backend_name or 'RBD' stats['replication_enabled'] = self._is_replication_enabled if self._is_replication_enabled: stats['replication_targets'] = self._target_names try: free_capacity, total_capacity = self._get_pool_stats() stats['free_capacity_gb'] = free_capacity stats['total_capacity_gb'] = total_capacity total_gbi = self._get_usage_info() stats['provisioned_capacity_gb'] = total_gbi except self.rados.Error: # just log and return unknown capacities LOG.exception('error refreshing volume stats') self._stats = stats def get_volume_stats(self, refresh=False): """Return the current state of the volume service. If 'refresh' is True, run the update first. """ if refresh: self._update_volume_stats() return self._stats def _get_clone_depth(self, client, volume_name, depth=0): """Returns the number of ancestral clones of the given volume.""" parent_volume = self.rbd.Image(client.ioctx, volume_name) try: _pool, parent, _snap = self._get_clone_info(parent_volume, volume_name) finally: parent_volume.close() if not parent: return depth # If clone depth was reached, flatten should have occurred so if it has # been exceeded then something has gone wrong. if depth > self.configuration.rbd_max_clone_depth: raise Exception(_("clone depth exceeds limit of %s") % (self.configuration.rbd_max_clone_depth)) return self._get_clone_depth(client, parent, depth + 1) def _extend_if_required(self, volume, src_vref): """Extends a volume if required In case src_vref size is smaller than the size if the requested new volume call _resize(). """ if volume.size != src_vref.size: LOG.debug("resize volume '%(dst_vol)s' from %(src_size)d to " "%(dst_size)d", {'dst_vol': volume.name, 'src_size': src_vref.size, 'dst_size': volume.size}) self._resize(volume) def create_cloned_volume(self, volume, src_vref): """Create a cloned volume from another volume. Since we are cloning from a volume and not a snapshot, we must first create a snapshot of the source volume. The user has the option to limit how long a volume's clone chain can be by setting rbd_max_clone_depth. If a clone is made of another clone and that clone has rbd_max_clone_depth clones behind it, the source volume will be flattened. """ src_name = utils.convert_str(src_vref.name) dest_name = utils.convert_str(volume.name) flatten_parent = False # Do full copy if requested if self.configuration.rbd_max_clone_depth <= 0: with RBDVolumeProxy(self, src_name, read_only=True) as vol: vol.copy(vol.ioctx, dest_name) self._extend_if_required(volume, src_vref) return # Otherwise do COW clone. with RADOSClient(self) as client: depth = self._get_clone_depth(client, src_name) # If source volume is a clone and rbd_max_clone_depth reached, # flatten the source before cloning. Zero rbd_max_clone_depth # means infinite is allowed. if depth == self.configuration.rbd_max_clone_depth: LOG.debug("maximum clone depth (%d) has been reached - " "flattening source volume", self.configuration.rbd_max_clone_depth) flatten_parent = True src_volume = self.rbd.Image(client.ioctx, src_name) try: # First flatten source volume if required. if flatten_parent: _pool, parent, snap = self._get_clone_info(src_volume, src_name) # Flatten source volume LOG.debug("flattening source volume %s", src_name) src_volume.flatten() # Delete parent clone snap parent_volume = self.rbd.Image(client.ioctx, parent) try: parent_volume.unprotect_snap(snap) parent_volume.remove_snap(snap) finally: parent_volume.close() # Create new snapshot of source volume clone_snap = "%s.clone_snap" % dest_name LOG.debug("creating snapshot='%s'", clone_snap) src_volume.create_snap(clone_snap) src_volume.protect_snap(clone_snap) except Exception: # Only close if exception since we still need it. src_volume.close() raise # Now clone source volume snapshot try: LOG.debug("cloning '%(src_vol)s@%(src_snap)s' to " "'%(dest)s'", {'src_vol': src_name, 'src_snap': clone_snap, 'dest': dest_name}) self.RBDProxy().clone(client.ioctx, src_name, clone_snap, client.ioctx, dest_name, features=client.features) except Exception: src_volume.unprotect_snap(clone_snap) src_volume.remove_snap(clone_snap) src_volume.close() raise try: volume_update = self._enable_replication_if_needed(volume) except Exception: self.RBDProxy().remove(client.ioctx, dest_name) err_msg = (_('Failed to enable image replication')) raise exception.ReplicationError(reason=err_msg, volume_id=volume.id) finally: src_volume.close() self._extend_if_required(volume, src_vref) LOG.debug("clone created successfully") return volume_update def _enable_replication(self, volume): """Enable replication for a volume. Returns required volume update. """ vol_name = utils.convert_str(volume.name) with RBDVolumeProxy(self, vol_name) as image: had_exclusive_lock = (image.features() & self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK) had_journaling = image.features() & self.rbd.RBD_FEATURE_JOURNALING if not had_exclusive_lock: image.update_features(self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK, True) if not had_journaling: image.update_features(self.rbd.RBD_FEATURE_JOURNALING, True) image.mirror_image_enable() driver_data = self._dumps({ 'had_journaling': bool(had_journaling), 'had_exclusive_lock': bool(had_exclusive_lock) }) return {'replication_status': fields.ReplicationStatus.ENABLED, 'replication_driver_data': driver_data} def _is_replicated_type(self, volume_type): # We do a safe attribute get because volume_type could be None specs = getattr(volume_type, 'extra_specs', {}) return specs.get(EXTRA_SPECS_REPL_ENABLED) == "<is> True" def _enable_replication_if_needed(self, volume): if self._is_replicated_type(volume.volume_type): return self._enable_replication(volume) if self._is_replication_enabled: return {'replication_status': fields.ReplicationStatus.DISABLED} return None def create_volume(self, volume): """Creates a logical volume.""" if volume.encryption_key_id: message = _("Encryption is not yet supported.") raise exception.VolumeDriverException(message=message) size = int(volume.size) * units.Gi LOG.debug("creating volume '%s'", volume.name) chunk_size = self.configuration.rbd_store_chunk_size * units.Mi order = int(math.log(chunk_size, 2)) vol_name = utils.convert_str(volume.name) with RADOSClient(self) as client: self.RBDProxy().create(client.ioctx, vol_name, size, order, old_format=False, features=client.features) try: volume_update = self._enable_replication_if_needed(volume) except Exception: self.RBDProxy().remove(client.ioctx, vol_name) err_msg = (_('Failed to enable image replication')) raise exception.ReplicationError(reason=err_msg, volume_id=volume.id) return volume_update def _flatten(self, pool, volume_name): LOG.debug('flattening %(pool)s/%(img)s', dict(pool=pool, img=volume_name)) with RBDVolumeProxy(self, volume_name, pool) as vol: vol.flatten() def _clone(self, volume, src_pool, src_image, src_snap): LOG.debug('cloning %(pool)s/%(img)s@%(snap)s to %(dst)s', dict(pool=src_pool, img=src_image, snap=src_snap, dst=volume.name)) chunk_size = self.configuration.rbd_store_chunk_size * units.Mi order = int(math.log(chunk_size, 2)) vol_name = utils.convert_str(volume.name) with RADOSClient(self, src_pool) as src_client: with RADOSClient(self) as dest_client: self.RBDProxy().clone(src_client.ioctx, utils.convert_str(src_image), utils.convert_str(src_snap), dest_client.ioctx, vol_name, features=src_client.features, order=order) try: volume_update = self._enable_replication_if_needed(volume) except Exception: self.RBDProxy().remove(dest_client.ioctx, vol_name) err_msg = (_('Failed to enable image replication')) raise exception.ReplicationError(reason=err_msg, volume_id=volume.id) return volume_update or {} def _resize(self, volume, **kwargs): size = kwargs.get('size', None) if not size: size = int(volume.size) * units.Gi with RBDVolumeProxy(self, volume.name) as vol: vol.resize(size) def create_volume_from_snapshot(self, volume, snapshot): """Creates a volume from a snapshot.""" volume_update = self._clone(volume, self.configuration.rbd_pool, snapshot.volume_name, snapshot.name) if self.configuration.rbd_flatten_volume_from_snapshot: self._flatten(self.configuration.rbd_pool, volume.name) if int(volume.size): self._resize(volume) return volume_update def _delete_backup_snaps(self, rbd_image): backup_snaps = self._get_backup_snaps(rbd_image) if backup_snaps: for snap in backup_snaps: rbd_image.remove_snap(snap['name']) else: LOG.debug("volume has no backup snaps") def _get_clone_info(self, volume, volume_name, snap=None): """If volume is a clone, return its parent info. Returns a tuple of (pool, parent, snap). A snapshot may optionally be provided for the case where a cloned volume has been flattened but it's snapshot still depends on the parent. """ try: if snap: volume.set_snap(snap) pool, parent, parent_snap = tuple(volume.parent_info()) if snap: volume.set_snap(None) # Strip the tag off the end of the volume name since it will not be # in the snap name. if volume_name.endswith('.deleted'): volume_name = volume_name[:-len('.deleted')] # Now check the snap name matches. if parent_snap == "%s.clone_snap" % volume_name: return pool, parent, parent_snap except self.rbd.ImageNotFound: LOG.debug("Volume %s is not a clone.", volume_name) volume.set_snap(None) return (None, None, None) def _get_children_info(self, volume, snap): """List children for the given snapshot of a volume(image). Returns a list of (pool, image). """ children_list = [] if snap: volume.set_snap(snap) children_list = volume.list_children() volume.set_snap(None) return children_list def _delete_clone_parent_refs(self, client, parent_name, parent_snap): """Walk back up the clone chain and delete references. Deletes references i.e. deleted parent volumes and snapshots. """ parent_rbd = self.rbd.Image(client.ioctx, parent_name) parent_has_snaps = False try: # Check for grandparent _pool, g_parent, g_parent_snap = self._get_clone_info(parent_rbd, parent_name, parent_snap) LOG.debug("deleting parent snapshot %s", parent_snap) parent_rbd.unprotect_snap(parent_snap) parent_rbd.remove_snap(parent_snap) parent_has_snaps = bool(list(parent_rbd.list_snaps())) finally: parent_rbd.close() # If parent has been deleted in Cinder, delete the silent reference and # keep walking up the chain if it is itself a clone. if (not parent_has_snaps) and parent_name.endswith('.deleted'): LOG.debug("deleting parent %s", parent_name) self.RBDProxy().remove(client.ioctx, parent_name) # Now move up to grandparent if there is one if g_parent: self._delete_clone_parent_refs(client, g_parent, g_parent_snap) def delete_volume(self, volume): """Deletes a logical volume.""" # NOTE(dosaboy): this was broken by commit cbe1d5f. Ensure names are # utf-8 otherwise librbd will barf. volume_name = utils.convert_str(volume.name) with RADOSClient(self) as client: try: rbd_image = self.rbd.Image(client.ioctx, volume_name) except self.rbd.ImageNotFound: LOG.info("volume %s no longer exists in backend", volume_name) return clone_snap = None parent = None # Ensure any backup snapshots are deleted self._delete_backup_snaps(rbd_image) # If the volume has non-clone snapshots this delete is expected to # raise VolumeIsBusy so do so straight away. try: snaps = rbd_image.list_snaps() for snap in snaps: if snap['name'].endswith('.clone_snap'): LOG.debug("volume has clone snapshot(s)") # We grab one of these and use it when fetching parent # info in case the volume has been flattened. clone_snap = snap['name'] break raise exception.VolumeIsBusy(volume_name=volume_name) # Determine if this volume is itself a clone _pool, parent, parent_snap = self._get_clone_info(rbd_image, volume_name, clone_snap) finally: rbd_image.close() @utils.retry(self.rbd.ImageBusy, self.configuration.rados_connection_interval, self.configuration.rados_connection_retries) def _try_remove_volume(client, volume_name): self.RBDProxy().remove(client.ioctx, volume_name) if clone_snap is None: LOG.debug("deleting rbd volume %s", volume_name) try: _try_remove_volume(client, volume_name) except self.rbd.ImageBusy: msg = (_("ImageBusy error raised while deleting rbd " "volume. This may have been caused by a " "connection from a client that has crashed and, " "if so, may be resolved by retrying the delete " "after 30 seconds has elapsed.")) LOG.warning(msg) # Now raise this so that volume stays available so that we # delete can be retried. raise exception.VolumeIsBusy(msg, volume_name=volume_name) except self.rbd.ImageNotFound: LOG.info("RBD volume %s not found, allowing delete " "operation to proceed.", volume_name) return # If it is a clone, walk back up the parent chain deleting # references. if parent: LOG.debug("volume is a clone so cleaning references") self._delete_clone_parent_refs(client, parent, parent_snap) else: # If the volume has copy-on-write clones we will not be able to # delete it. Instead we will keep it as a silent volume which # will be deleted when it's snapshot and clones are deleted. new_name = "%s.deleted" % (volume_name) self.RBDProxy().rename(client.ioctx, volume_name, new_name) def create_snapshot(self, snapshot): """Creates an rbd snapshot.""" with RBDVolumeProxy(self, snapshot.volume_name) as volume: snap = utils.convert_str(snapshot.name) volume.create_snap(snap) volume.protect_snap(snap) def delete_snapshot(self, snapshot): """Deletes an rbd snapshot.""" # NOTE(dosaboy): this was broken by commit cbe1d5f. Ensure names are # utf-8 otherwise librbd will barf. volume_name = utils.convert_str(snapshot.volume_name) snap_name = utils.convert_str(snapshot.name) with RBDVolumeProxy(self, volume_name) as volume: try: volume.unprotect_snap(snap_name) except self.rbd.InvalidArgument: LOG.info( "InvalidArgument: Unable to unprotect snapshot %s.", snap_name) except self.rbd.ImageNotFound: LOG.info( "ImageNotFound: Unable to unprotect snapshot %s.", snap_name) except self.rbd.ImageBusy: children_list = self._get_children_info(volume, snap_name) if children_list: for (pool, image) in children_list: LOG.info('Image %(pool)s/%(image)s is dependent ' 'on the snapshot %(snap)s.', {'pool': pool, 'image': image, 'snap': snap_name}) raise exception.SnapshotIsBusy(snapshot_name=snap_name) try: volume.remove_snap(snap_name) except self.rbd.ImageNotFound: LOG.info("Snapshot %s does not exist in backend.", snap_name) def _disable_replication(self, volume): """Disable replication on the given volume.""" vol_name = utils.convert_str(volume.name) with RBDVolumeProxy(self, vol_name) as image: image.mirror_image_disable(False) driver_data = json.loads(volume.replication_driver_data) # If 'journaling' and/or 'exclusive-lock' have # been enabled in '_enable_replication', # they will be disabled here. If not, it will keep # what it was before. if not driver_data['had_journaling']: image.update_features(self.rbd.RBD_FEATURE_JOURNALING, False) if not driver_data['had_exclusive_lock']: image.update_features(self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK, False) return {'replication_status': fields.ReplicationStatus.DISABLED, 'replication_driver_data': None} def retype(self, context, volume, new_type, diff, host): """Retype from one volume type to another on the same backend.""" old_vol_replicated = self._is_replicated_type(volume.volume_type) new_vol_replicated = self._is_replicated_type(new_type) if old_vol_replicated and not new_vol_replicated: try: return True, self._disable_replication(volume) except Exception: err_msg = (_('Failed to disable image replication')) raise exception.ReplicationError(reason=err_msg, volume_id=volume.id) elif not old_vol_replicated and new_vol_replicated: try: return True, self._enable_replication(volume) except Exception: err_msg = (_('Failed to enable image replication')) raise exception.ReplicationError(reason=err_msg, volume_id=volume.id) if not new_vol_replicated and self._is_replication_enabled: update = {'replication_status': fields.ReplicationStatus.DISABLED} else: update = None return True, update def _dumps(self, obj): return json.dumps(obj, separators=(',', ':'), sort_keys=True) def _exec_on_volume(self, volume_name, remote, operation, *args, **kwargs): @utils.retry(rbd.ImageBusy, self.configuration.rados_connection_interval, self.configuration.rados_connection_retries) def _do_exec(): timeout = self.configuration.replication_connect_timeout with RBDVolumeProxy(self, volume_name, self.configuration.rbd_pool, remote=remote, timeout=timeout) as rbd_image: return getattr(rbd_image, operation)(*args, **kwargs) return _do_exec() def _failover_volume(self, volume, remote, is_demoted, replication_status): """Process failover for a volume. There are 3 different cases that will return different update values for the volume: - Volume has replication enabled and failover succeeded: Set replication status to failed-over. - Volume has replication enabled and failover fails: Set status to error, replication status to failover-error, and store previous status in previous_status field. - Volume replication is disabled: Set status to error, and store status in previous_status field. """ # Failover is allowed when volume has it enabled or it has already # failed over, because we may want to do a second failover. if self._is_replicated_type(volume.volume_type): vol_name = utils.convert_str(volume.name) try: self._exec_on_volume(vol_name, remote, 'mirror_image_promote', not is_demoted) return {'volume_id': volume.id, 'updates': {'replication_status': replication_status}} except Exception as e: replication_status = fields.ReplicationStatus.FAILOVER_ERROR LOG.error('Failed to failover volume %(volume)s with ' 'error: %(error)s.', {'volume': volume.name, 'error': e}) else: replication_status = fields.ReplicationStatus.NOT_CAPABLE LOG.debug('Skipping failover for non replicated volume ' '%(volume)s with status: %(status)s', {'volume': volume.name, 'status': volume.status}) # Failover did not happen error_result = { 'volume_id': volume.id, 'updates': { 'status': 'error', 'previous_status': volume.status, 'replication_status': replication_status } } return error_result def _demote_volumes(self, volumes, until_failure=True): """Try to demote volumes on the current primary cluster.""" result = [] try_demoting = True for volume in volumes: demoted = False if try_demoting and self._is_replicated_type(volume.volume_type): vol_name = utils.convert_str(volume.name) try: self._exec_on_volume(vol_name, self._active_config, 'mirror_image_demote') demoted = True except Exception as e: LOG.debug('Failed to demote %(volume)s with error: ' '%(error)s.', {'volume': volume.name, 'error': e}) try_demoting = not until_failure result.append(demoted) return result def _get_failover_target_config(self, secondary_id=None): if not secondary_id: # In auto mode exclude failback and active candidates = set(self._target_names).difference( ('default', self._active_backend_id)) if not candidates: raise exception.InvalidReplicationTarget( reason=_('RBD: No available failover target host.')) secondary_id = candidates.pop() return secondary_id, self._get_target_config(secondary_id) def failover_host(self, context, volumes, secondary_id=None, groups=None): """Failover to replication target.""" LOG.info('RBD driver failover started.') if not self._is_replication_enabled: raise exception.UnableToFailOver( reason=_('RBD: Replication is not enabled.')) if secondary_id == 'default': replication_status = fields.ReplicationStatus.ENABLED else: replication_status = fields.ReplicationStatus.FAILED_OVER secondary_id, remote = self._get_failover_target_config(secondary_id) # Try to demote the volumes first demotion_results = self._demote_volumes(volumes) # Do the failover taking into consideration if they have been demoted updates = [self._failover_volume(volume, remote, is_demoted, replication_status) for volume, is_demoted in zip(volumes, demotion_results)] self._active_backend_id = secondary_id self._active_config = remote LOG.info('RBD driver failover completed.') return secondary_id, updates, [] def ensure_export(self, context, volume): """Synchronously recreates an export for a logical volume.""" pass def create_export(self, context, volume, connector): """Exports the volume.""" pass def remove_export(self, context, volume): """Removes an export for a logical volume.""" pass def _get_keyring_contents(self): # NOTE(danpawlik) If keyring is not provided in Cinder configuration, # os-brick library will take keyring from default path. keyring_file = self.configuration.rbd_keyring_conf keyring_data = None try: if os.path.isfile(keyring_file): with open(keyring_file, 'r') as k_file: keyring_data = k_file.read() except IOError: LOG.debug('Cannot read RBD keyring file: %s.', keyring_file) return keyring_data def initialize_connection(self, volume, connector): hosts, ports = self._get_mon_addrs() data = { 'driver_volume_type': 'rbd', 'data': { 'name': '%s/%s' % (self.configuration.rbd_pool, volume.name), 'hosts': hosts, 'ports': ports, 'cluster_name': self.configuration.rbd_cluster_name, 'auth_enabled': (self.configuration.rbd_user is not None), 'auth_username': self.configuration.rbd_user, 'secret_type': 'ceph', 'secret_uuid': self.configuration.rbd_secret_uuid, 'volume_id': volume.id, "discard": True, 'keyring': self._get_keyring_contents(), } } LOG.debug('connection data: %s', data) return data def terminate_connection(self, volume, connector, **kwargs): pass def _parse_location(self, location): prefix = 'rbd://' if not location.startswith(prefix): reason = _('Not stored in rbd') raise exception.ImageUnacceptable(image_id=location, reason=reason) pieces = [urllib.parse.unquote(loc) for loc in location[len(prefix):].split('/')] if any(map(lambda p: p == '', pieces)): reason = _('Blank components') raise exception.ImageUnacceptable(image_id=location, reason=reason) if len(pieces) != 4: reason = _('Not an rbd snapshot') raise exception.ImageUnacceptable(image_id=location, reason=reason) return pieces def _get_fsid(self): with RADOSClient(self) as client: return client.cluster.get_fsid() def _is_cloneable(self, image_location, image_meta): try: fsid, pool, image, snapshot = self._parse_location(image_location) except exception.ImageUnacceptable as e: LOG.debug('not cloneable: %s.', e) return False if self._get_fsid() != fsid: LOG.debug('%s is in a different ceph cluster.', image_location) return False if image_meta['disk_format'] != 'raw': LOG.debug("rbd image clone requires image format to be " "'raw' but image %(image)s is '%(format)s'", {"image": image_location, "format": image_meta['disk_format']}) return False # check that we can read the image try: with RBDVolumeProxy(self, image, pool=pool, snapshot=snapshot, read_only=True): return True except self.rbd.Error as e: LOG.debug('Unable to open image %(loc)s: %(err)s.', dict(loc=image_location, err=e)) return False def _get_cached_location(self, image_meta): """Extract the url provided by Glance RAW caching if present""" properties = image_meta.get('properties') if (properties and properties.get('cache_raw', '') == 'True' and properties.get('cache_raw_status', '') == 'Cached'): return properties.get('cache_raw_url') return None def clone_image(self, context, volume, image_location, image_meta, image_service): if image_location: # Note: image_location[0] is glance image direct_url. # image_location[1] contains the list of all locations (including # direct_url) or None if show_multiple_locations is False in # glance configuration. if image_location[1]: url_locations = [location['url'] for location in image_location[1]] else: url_locations = [image_location[0]] # Use RAW cache if available cached_location = self._get_cached_location(image_meta) if cached_location: url_locations = [cached_location] # The cached image is raw, update meta image_meta['disk_format'] = 'raw' # Remove raw caching related metadata as it can lead # to confusions with images created from volumes, snapshots # or instances. try: for k in ['cache_raw', 'cache_raw_status', 'cache_raw_url', 'cache_raw_size']: del image_meta['properties'][k] except KeyError: pass # iterate all locations to look for a cloneable one. for url_location in url_locations: if url_location and self._is_cloneable( url_location, image_meta): _prefix, pool, image, snapshot = \ self._parse_location(url_location) volume_update = self._clone(volume, pool, image, snapshot) volume_update['provider_location'] = None self._resize(volume) return volume_update, True return ({}, False) def _image_conversion_dir(self): tmpdir = (CONF.image_conversion_dir or tempfile.gettempdir()) # ensure temporary directory exists if not os.path.exists(tmpdir): os.makedirs(tmpdir) return tmpdir def copy_image_to_volume(self, context, volume, image_service, image_id): tmp_dir = self._image_conversion_dir() with tempfile.NamedTemporaryFile(dir=tmp_dir) as tmp: image_utils.fetch_to_raw(context, image_service, image_id, tmp.name, self.configuration.volume_dd_blocksize, size=volume.size) self.delete_volume(volume) chunk_size = self.configuration.rbd_store_chunk_size * units.Mi order = int(math.log(chunk_size, 2)) # keep using the command line import instead of librbd since it # detects zeroes to preserve sparseness in the image args = ['rbd', 'import', '--pool', self.configuration.rbd_pool, '--order', order, tmp.name, volume.name, '--new-format'] args.extend(self._ceph_args()) self._try_execute(*args) self._resize(volume) # We may need to re-enable replication because we have deleted the # original image and created a new one using the command line import. try: self._enable_replication_if_needed(volume) except Exception: err_msg = (_('Failed to enable image replication')) raise exception.ReplicationError(reason=err_msg, volume_id=volume.id) def copy_volume_to_image(self, context, volume, image_service, image_meta): tmp_dir = self._image_conversion_dir() tmp_file = os.path.join(tmp_dir, volume.name + '-' + image_meta['id']) with fileutils.remove_path_on_error(tmp_file): args = ['rbd', 'export', '--pool', self.configuration.rbd_pool, volume.name, tmp_file] args.extend(self._ceph_args()) self._try_execute(*args) image_utils.upload_volume(context, image_service, image_meta, tmp_file) os.unlink(tmp_file) def extend_volume(self, volume, new_size): """Extend an existing volume.""" old_size = volume.size try: size = int(new_size) * units.Gi self._resize(volume, size=size) except Exception: msg = _('Failed to Extend Volume ' '%(volname)s') % {'volname': volume.name} LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) LOG.debug("Extend volume from %(old_size)s GB to %(new_size)s GB.", {'old_size': old_size, 'new_size': new_size}) def manage_existing(self, volume, existing_ref): """Manages an existing image. Renames the image name to match the expected name for the volume. Error checking done by manage_existing_get_size is not repeated. :param volume: volume ref info to be set :param existing_ref: existing_ref is a dictionary of the form: {'source-name': <name of rbd image>} """ # Raise an exception if we didn't find a suitable rbd image. with RADOSClient(self) as client: rbd_name = existing_ref['source-name'] self.RBDProxy().rename(client.ioctx, utils.convert_str(rbd_name), utils.convert_str(volume.name)) def manage_existing_get_size(self, volume, existing_ref): """Return size of an existing image for manage_existing. :param volume: volume ref info to be set :param existing_ref: existing_ref is a dictionary of the form: {'source-name': <name of rbd image>} """ # Check that the reference is valid if 'source-name' not in existing_ref: reason = _('Reference must contain source-name element.') raise exception.ManageExistingInvalidReference( existing_ref=existing_ref, reason=reason) rbd_name = utils.convert_str(existing_ref['source-name']) with RADOSClient(self) as client: # Raise an exception if we didn't find a suitable rbd image. try: rbd_image = self.rbd.Image(client.ioctx, rbd_name) except self.rbd.ImageNotFound: kwargs = {'existing_ref': rbd_name, 'reason': 'Specified rbd image does not exist.'} raise exception.ManageExistingInvalidReference(**kwargs) image_size = rbd_image.size() rbd_image.close() # RBD image size is returned in bytes. Attempt to parse # size as a float and round up to the next integer. try: convert_size = int(math.ceil(float(image_size) / units.Gi)) return convert_size except ValueError: exception_message = (_("Failed to manage existing volume " "%(name)s, because reported size " "%(size)s was not a floating-point" " number.") % {'name': rbd_name, 'size': image_size}) raise exception.VolumeBackendAPIException( data=exception_message) def unmanage(self, volume): pass def update_migrated_volume(self, ctxt, volume, new_volume, original_volume_status): """Return model update from RBD for migrated volume. This method should rename the back-end volume name(id) on the destination host back to its original name(id) on the source host. :param ctxt: The context used to run the method update_migrated_volume :param volume: The original volume that was migrated to this backend :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume :returns: model_update to update DB with any needed changes """ name_id = None provider_location = None existing_name = CONF.volume_name_template % new_volume.id wanted_name = CONF.volume_name_template % volume.id with RADOSClient(self) as client: try: self.RBDProxy().rename(client.ioctx, utils.convert_str(existing_name), utils.convert_str(wanted_name)) except self.rbd.ImageNotFound: LOG.error('Unable to rename the logical volume ' 'for volume %s.', volume.id) # If the rename fails, _name_id should be set to the new # volume id and provider_location should be set to the # one from the new volume as well. name_id = new_volume._name_id or new_volume.id provider_location = new_volume['provider_location'] return {'_name_id': name_id, 'provider_location': provider_location} def migrate_volume(self, context, volume, host): return (False, None) def manage_existing_snapshot_get_size(self, snapshot, existing_ref): """Return size of an existing image for manage_existing. :param snapshot: snapshot ref info to be set :param existing_ref: existing_ref is a dictionary of the form: {'source-name': <name of snapshot>} """ # Check that the reference is valid if not isinstance(existing_ref, dict): existing_ref = {"source-name": existing_ref} if 'source-name' not in existing_ref: reason = _('Reference must contain source-name element.') raise exception.ManageExistingInvalidReference( existing_ref=existing_ref, reason=reason) volume_name = utils.convert_str(snapshot.volume_name) snapshot_name = utils.convert_str(existing_ref['source-name']) with RADOSClient(self) as client: # Raise an exception if we didn't find a suitable rbd image. try: rbd_snapshot = self.rbd.Image(client.ioctx, volume_name, snapshot=snapshot_name) except self.rbd.ImageNotFound: kwargs = {'existing_ref': snapshot_name, 'reason': 'Specified snapshot does not exist.'} raise exception.ManageExistingInvalidReference(**kwargs) snapshot_size = rbd_snapshot.size() rbd_snapshot.close() # RBD image size is returned in bytes. Attempt to parse # size as a float and round up to the next integer. try: convert_size = int(math.ceil(float(snapshot_size) / units.Gi)) return convert_size except ValueError: exception_message = (_("Failed to manage existing snapshot " "%(name)s, because reported size " "%(size)s was not a floating-point" " number.") % {'name': snapshot_name, 'size': snapshot_size}) raise exception.VolumeBackendAPIException( data=exception_message) def manage_existing_snapshot(self, snapshot, existing_ref): """Manages an existing snapshot. Renames the snapshot name to match the expected name for the snapshot. Error checking done by manage_existing_get_size is not repeated. :param snapshot: snapshot ref info to be set :param existing_ref: existing_ref is a dictionary of the form: {'source-name': <name of rbd snapshot>} """ if not isinstance(existing_ref, dict): existing_ref = {"source-name": existing_ref} volume_name = utils.convert_str(snapshot.volume_name) with RBDVolumeProxy(self, volume_name) as volume: snapshot_name = existing_ref['source-name'] volume.rename_snap(utils.convert_str(snapshot_name), utils.convert_str(snapshot.name)) def copy_volume_to_file(self, context, volume, dest_file): """Copies a volume to a file.""" with fileutils.remove_path_on_error(dest_file): args = ['rbd', 'export', '--pool', self.configuration.rbd_pool, volume['name'], dest_file] args.extend(self._ceph_args()) self._try_execute(*args) def copy_file_to_volume(self, context, src_file, volume): """Copies a file to a volume.""" # Delete the volume before importing self.delete_volume(volume) # keep using the command line import instead of librbd since it # detects zeroes to preserve sparseness in the image args = ['rbd', 'import', '--pool', self.configuration.rbd_pool, src_file, volume['name'], '--new-format'] args.extend(self._ceph_args()) self._try_execute(*args) def copy_snapshot_to_file(self, snapshot, dest_file): """Copies a snapshot to a file.""" with fileutils.remove_path_on_error(dest_file): args = ['rbd', 'export', '--pool', self.configuration.rbd_pool, snapshot['volume_name'], '--snap', snapshot['name'], dest_file] args.extend(self._ceph_args()) self._try_execute(*args)
_parse_replication_configs
snconv1d.py
# coding=utf-8 import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules import conv from torch.nn.modules.utils import _single from ..functions.max_sv import max_singular_value class SNConv1d(conv._ConvNd): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True): kernel_size = _single(kernel_size) stride = _single(stride) padding = _single(padding) dilation = _single(dilation) super(SNConv1d, self).__init__( in_channels, out_channels, kernel_size, stride, padding, dilation, False, _single(0), groups, bias) self.register_buffer('u', torch.Tensor(1, out_channels).normal_()) @property def W_(self):
def forward(self, input): return F.conv1d(input, self.W_, self.bias, self.stride, self.padding, self.dilation, self.groups)
w_mat = self.weight.view(self.weight.size(0), -1) sigma, _u = max_singular_value(w_mat, self.u) self.u.copy_(_u) return self.weight / sigma
form.go
package helpers import ( "net/http" "net/url" "reflect" "strconv" "github.com/stivens13/go/support/errors" ) // FromRequest will populate destination fields using http.Request post values. func FromRequest(r *http.Request, destination interface{}) error { rvalue := reflect.ValueOf(destination).Elem() typ := rvalue.Type() for i := 0; i < rvalue.NumField(); i++ { tag := typ.Field(i).Tag.Get("form") switch tag { case "": case "-": continue default: value := r.PostFormValue(tag) if value == "" { continue } switch rvalue.Field(i).Kind() { case reflect.Bool: b, err := strconv.ParseBool(value) if err != nil { return err } rvalue.Field(i).SetBool(b) case reflect.String: rvalue.Field(i).SetString(value) default: return errors.New("Invalid value: " + value + " type for type: " + tag) } } } s, special := destination.(SpecialValuesConvertable) if special
return nil } // ToValues will create url.Values from source. func ToValues(source interface{}) url.Values { values := make(url.Values) rvalue := reflect.ValueOf(source).Elem() typ := rvalue.Type() for i := 0; i < rvalue.NumField(); i++ { field := rvalue.Field(i) tag := typ.Field(i).Tag.Get("form") if tag == "" || tag == "-" { continue } switch field.Interface().(type) { case bool: value := rvalue.Field(i).Bool() values.Set(tag, strconv.FormatBool(value)) case string: value := rvalue.Field(i).String() if value == "" { continue } values.Set(tag, value) } } s, special := source.(SpecialValuesConvertable) if special { s.ToValuesSpecial(values) } return values }
{ err := s.FromRequestSpecial(r, destination) if err != nil { return errors.Wrap(err, "Error from FromRequestSpecial") } }
knapsack_0-1.rs
// http://rosettacode.org/wiki/Knapsack_problem/0-1 use std::cmp::max; use std::iter::repeat; // This struct is used to store our items that we want in our knap-sack. // // Show is for displaying the fields. // allow(dead_code) removes a dead code warning when the name of the struct is not // used (as in this case happens in the tests) #[derive(Copy)]
weight: usize, value: usize } // Global, immutable allocation of our items. This is so we can reference // this in multiple functions. const ITEMS: &'static [Want<'static>] = &[ Want {name: "map", weight: 9, value: 150}, Want {name: "compass", weight: 13, value: 35}, Want {name: "water", weight: 153, value: 200}, Want {name: "sandwich", weight: 50, value: 160}, Want {name: "glucose", weight: 15, value: 60}, Want {name: "tin", weight: 68, value: 45}, Want {name: "banana", weight: 27, value: 60}, Want {name: "apple", weight: 39, value: 40}, Want {name: "cheese", weight: 23, value: 30}, Want {name: "beer", weight: 52, value: 10}, Want {name: "suntancream", weight: 11, value: 70}, Want {name: "camera", weight: 32, value: 30}, Want {name: "T-shirt", weight: 24, value: 15}, Want {name: "trousers", weight: 48, value: 10}, Want {name: "umbrella", weight: 73, value: 40}, Want {name: "waterproof trousers", weight: 42, value: 70}, Want {name: "waterproof overclothes", weight: 43, value: 75}, Want {name: "note-case", weight: 22, value: 80}, Want {name: "sunglasses", weight: 7, value: 20}, Want {name: "towel", weight: 18, value: 12}, Want {name: "socks", weight: 4, value: 50}, Want {name: "book", weight: 30, value: 10} ]; // This is a bottom-up dynamic programming solution to the 0-1 knap-sack problem. // maximize value // subject to weights <= max_weight fn knap_01_dp<'a>(xs: &[Want<'a>], max_weight: usize) -> Vec<Want<'a>> { // Save this value, so we don't have to make repeated calls. let xs_len = xs.len(); // Imagine we wrote a recursive function(item, max_weight) that returns a // usize corresponding to the maximum cumulative value by considering a // subset of items such that the combined weight <= max_weight. // // fn best_value(item: usize, max_weight: usize) -> usize{ // if item == 0 { // return 0; // } // if xs[item - 1].weight > max_weight { // return best_value(item - 1, max_weight, xs); // } // return max(best_value(item - 1, max_weight, xs), // best_value(item - 1, max_weight - xs[item - 1].weight, xs) // + xs[item - 1].value); // } // // best_value(xs_len, max_weight) is equal to the maximum value that we // can add to the bag. // // The problem with using this function is that it performs redudant // calculations. // // The dynamic programming solution is to precompute all of the values we // need and put them into a 2D array. // // In a similar vein, the top-down solution would be to memoize the // function then compute the results on demand. let zero_vec: Vec<usize> = repeat(0us).take(max_weight + 1).collect(); let mut best_value: Vec<Vec<usize>> = repeat(zero_vec) .take(xs_len + 1).collect(); // loop over the items for i in (0..xs_len) { // loop over the weights for w in (1..max_weight + 1) { // do we have room in our knapsack? if xs[i].weight > w { // if we don't, then we'll say that the value doesn't change // when considering this item best_value[i + 1][w] = best_value[i][w].clone(); } else { // if we do, then we have to see if the value we gain by adding // the item, given the weight, is better than not adding the item best_value[i + 1][w] = max(best_value[i][w].clone(), best_value[i][w - xs[i].weight] + xs[i].value); } } } // a variable representing the weight left in the bag let mut left_weight = max_weight.clone(); // a possibly over-allocated dynamically sized vector to push results to let mut result = Vec::with_capacity(xs_len); // we built up the solution space through a forward pass over the data, // now we have to traverse backwards to get the solution for i in (1..xs_len+1).rev() { // We can check if an item should be added to the knap-sack by comparing // best_value with and without this item. If best_value added this // item then so should we. if best_value[i][left_weight] != best_value[i - 1][left_weight] { result.push(xs[i - 1]); // we remove the weight of the object from the remaining weight // we can add to the bag left_weight -= xs[i - 1].weight; } } return result; } #[cfg(not(test))] fn main () { let xs = knap_01_dp(ITEMS, 400); // Print the items. We have to reverse the order because we solved the // problem backward. for i in xs.iter().rev() { println!("Item: {}, Weight: {}, Value: {}", i.name, i.weight, i.value); } // Print the sum of weights. let weights = xs.iter().fold(0, |a, &b| a + b.weight); println!("Total Weight: {}", weights); // Print the sum of the values. let values = xs.iter().fold(0, |a, &b| a + b.value); println!("Total Value: {}", values); } #[test] fn test_dp_results() { let dp_results = knap_01_dp(ITEMS, 400); let dp_weights= dp_results.iter().fold(0, |a, &b| a + b.weight); let dp_values = dp_results.iter().fold(0, |a, &b| a + b.value); assert_eq!(dp_weights, 396); assert_eq!(dp_values, 1030); }
struct Want<'a> { #[allow(dead_code)] name: &'a str,
test_edit.py
from unittest import TestCase import numpy as np from pyecsca.sca import Trace, trim, reverse, pad class EditTests(TestCase): def setUp(self): self._trace = Trace(np.array([10, 20, 30, 40, 50], dtype=np.dtype("i1"))) def test_trim(self): result = trim(self._trace, 2) self.assertIsNotNone(result) np.testing.assert_equal(result.samples, np.array([30, 40, 50], dtype=np.dtype("i1"))) result = trim(self._trace, end=3) self.assertIsNotNone(result) np.testing.assert_equal(result.samples, np.array([10, 20, 30], dtype=np.dtype("i1"))) with self.assertRaises(ValueError): trim(self._trace, 5, 1) def
(self): result = reverse(self._trace) self.assertIsNotNone(result) np.testing.assert_equal(result.samples, np.array([50, 40, 30, 20, 10], dtype=np.dtype("i1"))) def test_pad(self): result = pad(self._trace, 2) self.assertIsNotNone(result) np.testing.assert_equal(result.samples, np.array([0, 0, 10, 20, 30, 40, 50, 0, 0], dtype=np.dtype("i1"))) result = pad(self._trace, (1, 3)) self.assertIsNotNone(result) np.testing.assert_equal(result.samples, np.array([0, 10, 20, 30, 40, 50, 0, 0, 0], dtype=np.dtype("i1")))
test_reverse
test_unit_load_weights_lenet.py
import os.path import re import sys import math import numpy as np import google.protobuf.text_format import pytest import glob # Local files current_file = os.path.realpath(__file__) current_dir = os.path.dirname(current_file) sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python')) import tools # ============================================== # Options # ============================================== # Training options num_epochs = 4 num_ckpt_epochs = int(float(num_epochs)/2) num_restart_epochs = num_epochs - num_ckpt_epochs mini_batch_size = 64 num_nodes = 1 lenet_fraction = 0.01 random_seed = 20191206 test_name_base='test_unit_load_weights_lenet' checkpoint_dir='ckpt' save_model_dir='model_weights' # ============================================== # Setup LBANN experiment # ============================================== def setup_experiment(lbann): """Construct LBANN experiment. Args: lbann (module): Module for LBANN Python frontend """ trainer = lbann.Trainer(mini_batch_size=mini_batch_size, random_seed=random_seed) # Checkpoint after every epoch trainer.callbacks = [ lbann.CallbackCheckpoint( checkpoint_dir=checkpoint_dir, checkpoint_epochs=1, checkpoint_steps=845 ) ] model = construct_model(lbann) data_reader = construct_data_reader(lbann) optimizer = lbann.SGD(learn_rate=0.01, momentum=0.9) return trainer, model, data_reader, optimizer def construct_model(lbann): """Construct LBANN model. Args: lbann (module): Module for LBANN Python frontend """ # TODO (tym): Figure out how to switch between LBANN builds. See # GitHub Issue #1289. import lbann.models # Manually override the global count so that each model is named the same lbann.models.LeNet.global_count = 0 lbann.Layer.global_count = 0 # Layer graph input_ = lbann.Input(target_mode='classification') images = lbann.Identity(input_) labels = lbann.Identity(input_) x = lbann.models.LeNet(10)(images) probs = lbann.Softmax(x) loss = lbann.CrossEntropy(probs, labels) acc = lbann.CategoricalAccuracy(probs, labels) # Make sure all layers are on CPU for layer in lbann.traverse_layer_graph(input_): layer.device = 'cpu' # Objects for LBANN model callbacks = [lbann.CallbackPrint(), lbann.CallbackTimer(), lbann.CallbackSaveModel(dir=save_model_dir)] metrics = [lbann.Metric(acc, name='accuracy', unit='%')] # Construct model return lbann.Model(num_epochs, layers=lbann.traverse_layer_graph(input_), objective_function=loss, metrics=metrics, callbacks=callbacks) def construct_data_reader(lbann):
# ============================================== # Setup PyTest # ============================================== def create_test_func(test_func): """Augment test function to cascade multiple tests and parse results. `tools.create_tests` creates functions that run an LBANN experiment. This function creates augmented functions that parse the log files after LBANN finishes running, e.g. to check metrics or runtimes. Note: The naive approach is to define the augmented test functions in a loop. However, Python closures are late binding. In other words, the function would be overwritten every time we define it. We get around this overwriting problem by defining the augmented function in the local scope of another function. Args: test_func (function): Test function created by `tools.create_tests`. Returns: function: Test that can interact with PyTest. """ test_name = test_func.__name__ # Define test function def func(cluster, dirname, weekly): # Run LBANN experiment baseline print('\n################################################################################') print('Running model halfway ') print('################################################################################\n') baseline_test_output = test_func(cluster, dirname) baseline_training_metrics = tools.collect_metrics_from_log_func(baseline_test_output['stdout_log_file'], 'training epoch [0-9]+ objective function') baseline_validation_metrics = tools.collect_metrics_from_log_func(baseline_test_output['stdout_log_file'], 'validation objective function') baseline_test_metrics = tools.collect_metrics_from_log_func(baseline_test_output['stdout_log_file'], 'test objective function') # Run LBANN model to checkpoint print('\n################################################################################') print('Running model to checkpointed weights') print('################################################################################\n') test_func_checkpoint = tools.create_tests( setup_experiment, __file__, test_name_base=test_name_base, nodes=num_nodes, work_subdir='reload_weights_from_checkpoint', lbann_args=['--disable_cuda', '--num_epochs='+str(num_restart_epochs), '--load_model_weights_dir='+ os.path.join(baseline_test_output['work_dir'], checkpoint_dir, 'trainer0')], ) checkpoint_test_output = test_func_checkpoint[0](cluster, dirname) checkpoint_training_metrics = tools.collect_metrics_from_log_func(checkpoint_test_output['stdout_log_file'], 'training epoch [0-9]+ objective function') checkpoint_validation_metrics = tools.collect_metrics_from_log_func(checkpoint_test_output['stdout_log_file'], 'validation objective function') checkpoint_test_metrics = tools.collect_metrics_from_log_func(checkpoint_test_output['stdout_log_file'], 'test objective function') print('\n################################################################################') print('Running model from save_model weights') print('################################################################################\n') test_func_restart = tools.create_tests( setup_experiment, __file__, test_name_base=test_name_base, nodes=num_nodes, work_subdir='reload_weights_from_save_model_cb', lbann_args=['--disable_cuda', '--num_epochs='+str(num_restart_epochs), '--load_model_weights_dir='+ os.path.join(baseline_test_output['work_dir'], save_model_dir, 'trainer0', 'model0/'), '--load_model_weights_dir_is_complete'], ) # Restart LBANN model and run to completion restart_test_output = test_func_restart[0](cluster, dirname) restart_training_metrics = tools.collect_metrics_from_log_func(restart_test_output['stdout_log_file'], 'training epoch [0-9]+ objective function') restart_validation_metrics = tools.collect_metrics_from_log_func(restart_test_output['stdout_log_file'], 'validation objective function') restart_test_metrics = tools.collect_metrics_from_log_func(restart_test_output['stdout_log_file'], 'test objective function') print('\n################################################################################') print('Comparing results of models') print('################################################################################\n') # Check if metrics are same in baseline and test experiments # Note: "Print statistics" callback will print up to 6 digits # of metric values. # Comparing training objective functions tools.compare_metrics(checkpoint_training_metrics, restart_training_metrics) # Comparing validation objective functions tools.compare_metrics(checkpoint_validation_metrics, restart_validation_metrics) # Comparing test objective functions tools.compare_metrics(checkpoint_test_metrics, restart_test_metrics) baseline_ckpt=os.path.join(baseline_test_output['work_dir'], checkpoint_dir) checkpoint_ckpt=os.path.join(checkpoint_test_output['work_dir'], checkpoint_dir) restart_ckpt=os.path.join(restart_test_output['work_dir'], checkpoint_dir) err = 0 err_dirs = '' fileList = glob.glob('{base}/trainer0/*'.format(base=checkpoint_ckpt)) fileList, tmp_err, tmp_err_str = tools.multidir_diff(checkpoint_ckpt, restart_ckpt, fileList) err += tmp_err err_dirs += tmp_err_str err_msg = "\nUnmatched checkpoints:\n" for f in fileList: err_msg += f + "\n" assert len(fileList) == 0, \ 'Extra checkpoint data in baseline directory: ' + err_msg assert err == 0, err_dirs # Return test function from factory function func.__name__ = test_name return func # Create test functions that can interact with PyTest for _test_func in tools.create_tests(setup_experiment, __file__, test_name_base=test_name_base, nodes=num_nodes, work_subdir='baseline', lbann_args=['--disable_cuda', ' --num_epochs='+str(num_ckpt_epochs)]): globals()[_test_func.__name__] = create_test_func(_test_func)
"""Construct Protobuf message for Python data reader. The Python data reader will import the current Python file to access the sample access functions. Args: lbann (module): Module for LBANN Python frontend """ # TODO (tym): Figure out how to switch between LBANN builds. See # GitHub Issue #1289. import lbann.contrib.lc.paths # Load data readers from prototext dirname = os.path.dirname lbann_dir = dirname(dirname(dirname(os.path.realpath(__file__)))) pb_file = os.path.join(lbann_dir, 'model_zoo', 'data_readers', 'data_reader_mnist.prototext') message = lbann.lbann_pb2.LbannPB() with open(pb_file, 'r') as f: google.protobuf.text_format.Merge(f.read(), message) message = message.data_reader # Set location of MNIST data for reader in message.reader: reader.data_filedir = lbann.contrib.lc.paths.mnist_dir() reader.percent_of_data_to_use = lenet_fraction # Validation set message.reader[0].validation_percent = 0.1 return message
PlotLetterROC.py
#!/usr/env/python """ Author: Ralf Hauenschild E-Mail: [email protected] """ import sys import os import numpy import matplotlib import matplotlib as mpl import matplotlib.pyplot as plt import pylab as py import matplotlib.cm as cm import math c = [] sens = [] # sens (recall) senserror = []
perror = [] for i in range(1, len(sys.argv)): if sys.argv[i] != "distinct": c.append([]) sens.append([]) # sens (recall) senserror.append([]) specloss.append([]) # 1-spec specerror.append([]) p.append([]) # ppv (precision) perror.append([]) infile = open(sys.argv[i], "r") line = infile.readline() while len(line) > 4: splitlist = line[:-1].split("\t") if "distinct" in sys.argv[i]: c[i-1].append(float(splitlist[1])) sens[i-1].append(float(splitlist[21])) senserror[i-1].append(float(splitlist[23])) specloss[i-1].append(1-float(splitlist[33])) specerror[i-1].append(float(splitlist[35])) p[i-1].append(float(splitlist[27])) perror[i-1].append(float(splitlist[29])) else: c[i-1].append(float(splitlist[1])) sens[i-1].append(float(splitlist[3])) senserror[i-1].append(float(splitlist[5])) specloss[i-1].append(1-float(splitlist[15])) specerror[i-1].append(float(splitlist[17])) p[i-1].append(float(splitlist[9])) perror[i-1].append(float(splitlist[11])) line = infile.readline() infile.close() fig = py.figure(1, figsize=(12, 6)) py.subplots_adjust(top=0.8) linestyles = ["-", "--"] #colors=[cb.to_rgba(value) for value in c] norm=mpl.colors.Normalize(vmin=min(c[0]), vmax=max(c[0])) fig.suptitle("Anonymization performance assessment under sliding PPV threshold\nfor words leading X-ed out training content") #labels = ["-1 leader only", "-1 & -2 leader indep."] labels = ["X-out events", "word-distinct X-out events"] handles = [] m = cm.ScalarMappable(norm=norm, cmap=cm.jet) ax = fig.add_subplot(121) for column in range(0, len(specloss)): for i in range(1, len(specloss[column])): aplot, = ax.plot(specloss[column][i-1:i+1], sens[column][i-1:i+1], linestyles[column], color=m.to_rgba(numpy.mean(c[column][i-1:i+1])), linewidth=3) for i in range(0, len(specloss[column])): ax.errorbar(specloss[column][i:i+1], sens[column][i:i+1], xerr=specerror[column][i:i+1], yerr=senserror[column][i:i+1], marker='o', fmt='-o', linewidth=3, color=m.to_rgba(c[column][i])) group1 = ax.scatter(specloss[column], sens[column], c=c[column], cmap=cm.jet, norm=norm, alpha=0) import matplotlib.ticker as ticker #, format=ticker.FormatStrFormatter('%.0f') cb = py.colorbar(group1) cb.set_alpha(1) cb.draw_all() cb.ax.set_ylabel("PPV threshold for feature to be considered in model") py.xlim(xmin=0) py.ylim(ymin=0) py.xlabel("FPR (1-specificity)") py.ylabel("TPR (sensitivity)") py.title("ROC") a, = ax.plot([-1, -1], [-1, -1], linestyles[0], color=m.to_rgba(c[column][0]), linewidth=3) b, = ax.plot([-1, -1], [-1, -1], linestyles[1], color=m.to_rgba(c[column][0]), linewidth=3) #plt.legend([a, b], labels, loc='lower right') #plt.legend(handles=handles, labels=labels) ax = fig.add_subplot(122) for column in range(0, len(specloss)): print sens[column] for i in range(1, len(specloss[column])): ax.plot(sens[column][i-1:i+1], p[column][i-1:i+1], linestyles[column], color=m.to_rgba(numpy.mean(c[column][i-1:i+1])), linewidth=3) for i in range(0, len(specloss[column])): ax.errorbar(sens[column][i:i+1], p[column][i:i+1], xerr=senserror[column][i:i+1], yerr=perror[column][i:i+1], marker='o', fmt='-o', linewidth=3, color=m.to_rgba(c[column][i])) cb = py.colorbar(group1) cb.set_alpha(1) cb.draw_all() cb.ax.set_ylabel("PPV threshold for feature to be considered in model") py.xlim(xmin=0, xmax=1) py.ylim(ymin=0, ymax=1) py.xlabel("sensitivity (recall)") py.ylabel("PPV (precision)") py.title("P/R (precision by recall)") a, = ax.plot([-1, -1], [-1, -1], linestyles[0], color=m.to_rgba(c[column][0]), linewidth=3) b, = ax.plot([-1, -1], [-1, -1], linestyles[1], color=m.to_rgba(c[column][0]), linewidth=3) #plt.legend([a, b], labels, loc='lower left') auc = round(numpy.trapz(y=[item for item in sens[0][::-1]], x=[item for item in specloss[0][::-1]]) / numpy.trapz(y=[1.0 for item in sens[0][::-1]], x=[item for item in specloss[0][::-1]]), 4) print "AUC:", auc plt.savefig(sys.argv[1] + ".roc" + "_auc_" + str(auc) + ".svg") plt.show() plt.close()
specloss = [] # 1-spec specerror = [] p = [] # ppv (precision)
warn_metric_ack_modal.test.tsx
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; import {shallow} from 'enzyme'; import {Modal} from 'react-bootstrap'; import {UserProfile} from 'matterfoss-redux/types/users'; import WarnMetricAckModal from 'components/warn_metric_ack_modal/warn_metric_ack_modal'; describe('components/WarnMetricAckModal', () => { const serverError = 'some error'; const baseProps = { stats: { registered_users: 200, }, user: { id: 'someUserId', first_name: 'Fake', last_name: 'Person', email: '[email protected]', } as UserProfile, show: false, telemetryId: 'diag_0', closeParentComponent: jest.fn(), warnMetricStatus: { id: 'metric1', limit: 500, acked: false, }, actions: { closeModal: jest.fn(), getStandardAnalytics: jest.fn(), sendWarnMetricAck: jest.fn().mockResolvedValue({}), }, }; test('should match snapshot, init', () => { const wrapper = shallow<WarnMetricAckModal>( <WarnMetricAckModal {...baseProps}/>, ); expect(wrapper).toMatchSnapshot(); }); test('error display', () => { const wrapper = shallow<WarnMetricAckModal>( <WarnMetricAckModal {...baseProps}/>, ); wrapper.setState({serverError}); expect(wrapper).toMatchSnapshot(); }); test('should match state when onHide is called', () => { const wrapper = shallow<WarnMetricAckModal>( <WarnMetricAckModal {...baseProps}/>, ); wrapper.setState({saving: true}); wrapper.instance().onHide(); expect(wrapper.state('saving')).toEqual(false); }); test('should match state when onHideWithParent is called', () => { const wrapper = shallow<WarnMetricAckModal>( <WarnMetricAckModal {...baseProps}/>, ); wrapper.setState({saving: true}); wrapper.instance().onHide(); expect(baseProps.closeParentComponent).toHaveBeenCalledTimes(1); expect(wrapper.state('saving')).toEqual(false); }); test('send ack on acknowledge button click', () => { const props = {...baseProps}; const wrapper = shallow<WarnMetricAckModal>( <WarnMetricAckModal {...props}/>, ); wrapper.setState({saving: false}); wrapper.find('.save-button').simulate('click'); expect(props.actions.sendWarnMetricAck).toHaveBeenCalledTimes(1);
test('should have called props.onHide when Modal.onExited is called', () => { const props = {...baseProps}; const wrapper = shallow( <WarnMetricAckModal {...props}/>, ); wrapper.find(Modal).props().onExited!(document.createElement('div')); expect(baseProps.actions.closeModal).toHaveBeenCalledTimes(1); }); });
});
setup.py
#!/usr/bin/env python
setuptools.setup( setup_requires=['pbr', 'pytest-runner'], tests_require=['pytest'], pbr=True)
import re import setuptools import sys
service.go
package k8s import ( "context" "github.com/iancoleman/strcase" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8sapiv1 "github.com/lyft/clutch/backend/api/k8s/v1" ) func (s *svc) DescribeService(ctx context.Context, clientset, cluster, namespace, name string) (*k8sapiv1.Service, error) { cs, err := s.manager.GetK8sClientset(ctx, clientset, cluster, namespace) if err != nil { return nil, err } services, err := cs.CoreV1().Services(cs.Namespace()).List(ctx, metav1.ListOptions{ FieldSelector: "metadata.name=" + name, }) if err != nil { return nil, err } if len(services.Items) == 1 { return ProtoForService(cs.Cluster(), &services.Items[0]), nil } else if len(services.Items) > 1 { return nil, status.Error(codes.FailedPrecondition, "located multiple services") } return nil, status.Error(codes.NotFound, "unable to locate specified service") }
if err != nil { return err } opts := metav1.DeleteOptions{} return cs.CoreV1().Services(cs.Namespace()).Delete(ctx, name, opts) } func ProtoForService(cluster string, k8sservice *corev1.Service) *k8sapiv1.Service { clusterName := k8sservice.ClusterName if clusterName == "" { clusterName = cluster } return &k8sapiv1.Service{ Cluster: clusterName, Namespace: k8sservice.Namespace, Name: k8sservice.Name, Type: protoForServiceType(k8sservice.Spec.Type), Labels: k8sservice.Labels, Annotations: k8sservice.Annotations, } } func protoForServiceType(serviceType corev1.ServiceType) k8sapiv1.Service_Type { // Look up value in generated enum map after ensuring consistent case with generated code. val, ok := k8sapiv1.Service_Type_value[strcase.ToScreamingSnake(string(serviceType))] if !ok { return k8sapiv1.Service_UNKNOWN } return k8sapiv1.Service_Type(val) }
func (s *svc) DeleteService(ctx context.Context, clientset, cluster, namespace, name string) error { cs, err := s.manager.GetK8sClientset(ctx, clientset, cluster, namespace)
ZhihuCircleFill.d.ts
import { IconDefinition } from '../types'; export declare const ZhihuCircleFill: IconDefinition;
app.module.ts
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt'; import { HttpModule } from '@angular/http'; import { HttpClientModule } from '@angular/common/http'; import { IonicStorageModule } from '@ionic/storage'; import { TpAdminClient, TpOtherClient, TpUserClient, TpProfileClient, TpPunchClient, TpPuClient, API_BASE_URL } from './services/client-proxy'; import { TpClientConfig } from './timepuncher-client-config'; import { PunchService, BUILD_INFO } from './services/puncher/punch.service'; import { AuthGuard } from './services/auth/auth.guard'; import { AuthService } from './services/auth/auth.service'; import { AlertService } from './services/alert/alert.service'; import { AlertDirective } from './directives/alert/alert.directive'; import { AppRoutingModule } from './app.routing'; import { MainRoutingModule } from './pages/main.rounting.module'; import { CoreModule } from '../app/core/core.module'; import { SharedModule } from '../app/shared/shared.module'; import { AppComponent } from './app.component'; import { DialogComponent } from './dialog/dialog.component'; import { PunchEditComponent } from './dialog/punchedit.component'; import { MainComponent } from './pages/main/main.component'; import { LoginComponent } from './pages/login/login.component'; import { RegistrationComponent } from './pages/registration/registration.component'; import { OverviewComponent } from './pages/overview/overview.component'; import { SysadminComponent } from './pages/sysadmin/sysadmin.component'; import { TimeadminComponent } from './pages/timeadmin/timeadmin.component'; import { ProfileComponent } from './pages/profile/profile.component'; import { LogoutComponent } from './pages/logout/logout.component'; export function jwtOptionsFactory(tokenService) { return { tokenGetter: () => { return tokenService.getToken(); }, whitelistedDomains: ['localhost:5000', 'api.timepuncher.ch'] } } @NgModule({ declarations: [ AppComponent, DialogComponent, PunchEditComponent, LoginComponent, RegistrationComponent, AlertDirective, MainComponent, OverviewComponent, ProfileComponent, LogoutComponent, SysadminComponent, TimeadminComponent ], imports: [ BrowserModule, CoreModule, SharedModule, FormsModule, HttpModule, HttpClientModule, MainRoutingModule, AppRoutingModule, IonicStorageModule.forRoot({ name: '__tpmaterial', driverOrder: ['indexeddb', 'sqlite', 'websql'] }), JwtModule.forRoot({ jwtOptionsProvider: { provide: JWT_OPTIONS, useFactory: jwtOptionsFactory, deps: [AuthService] } })], providers: [ AuthGuard, TpAdminClient, TpOtherClient, TpUserClient, TpProfileClient, TpPuClient, TpPunchClient, AlertService, PunchService, AuthService,
provide: API_BASE_URL, useValue: TpClientConfig.baserurl }, { provide: BUILD_INFO, useValue: TpClientConfig.bts }, ], entryComponents: [DialogComponent, PunchEditComponent], bootstrap: [AppComponent], exports: [ ] }) export class AppModule { }
{
help_command.py
# -*- coding: utf-8 -*- """ jishaku.help_command ~~~~~~~~~~~~~~~~~~~~ HelpCommand subclasses with jishaku features :copyright: (c) 2021 Devon (Gorialis) R :license: MIT, see LICENSE for more details. """ from hashcord.ext import commands from jishaku.paginators import PaginatorEmbedInterface, PaginatorInterface class DefaultPaginatorHelp(commands.DefaultHelpCommand): """ A subclass of :class:`commands.DefaultHelpCommand` that uses a PaginatorInterface for pages. """ def __init__(self, **options): paginator = options.pop('paginator', commands.Paginator(max_size=1985)) super().__init__(paginator=paginator, **options) async def send_pages(self): destination = self.get_destination() interface = PaginatorInterface(self.context.bot, self.paginator, owner=self.context.author) await interface.send_to(destination) class
(commands.DefaultHelpCommand): """ A subclass of :class:`commands.DefaultHelpCommand` that uses a PaginatorEmbedInterface for pages. """ async def send_pages(self): destination = self.get_destination() interface = PaginatorEmbedInterface(self.context.bot, self.paginator, owner=self.context.author) await interface.send_to(destination) class MinimalPaginatorHelp(commands.MinimalHelpCommand): """ A subclass of :class:`commands.MinimalHelpCommand` that uses a PaginatorInterface for pages. """ def __init__(self, **options): paginator = options.pop('paginator', commands.Paginator(prefix=None, suffix=None, max_size=1985)) super().__init__(paginator=paginator, **options) async def send_pages(self): destination = self.get_destination() interface = PaginatorInterface(self.context.bot, self.paginator, owner=self.context.author) await interface.send_to(destination) class MinimalEmbedPaginatorHelp(commands.MinimalHelpCommand): """ A subclass of :class:`commands.MinimalHelpCommand` that uses a PaginatorEmbedInterface for pages. """ async def send_pages(self): destination = self.get_destination() interface = PaginatorEmbedInterface(self.context.bot, self.paginator, owner=self.context.author) await interface.send_to(destination)
DefaultEmbedPaginatorHelp
class-dtor.rs
class cat { let done : extern fn(uint); let meows : uint; new(done: extern fn(uint)) { self.meows = 0u; self.done = done; } drop { self.done(self.meows); } } fn main()
{}
setup.py
from setuptools import setup, find_packages with open('README.md', 'r', encoding='utf-8') as fh: long_description = fh.read() setup( name='gym_wordle', version='0.1.3', author='David Kraemer', author_email='[email protected]', description='OpenAI gym environment for training agents on Wordle', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/DavidNKraemer/Gym-Wordle', packages=find_packages( include=[ 'gym_wordle', 'gym_wordle.*' ] ),
package_data={ 'gym_wordle': ['dictionary/*'] }, python_requires='>=3.7', classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], install_requires=[ 'numpy>=1.20', 'gym==0.19', 'sty==1.0', ], )
math.rs
//I'm sure there are better libraries for this (nalgebra) //then again, I could use my own & not need a dependency. //If I start writing more substantial programs it'd be well worth it //also could benefit from SIMD, even in WASM (eventually) // pub struct Vec3 { // pub x: f32, pub y: f32, pub z: f32 // } // impl ops::Add<Vec3> for Vec3 { // fn add(self, b: Vec3) -> Vec3 { // Vec3{x: self.x + b.x, y: self.y + b.y, z: self.z + b.z} // } // } // impl ops::Mul<f32> for Vec3 { // fn mul(self, b: f32) -> Vec3 { // Vec3{x: b*self.x, y: b*self.y, z: b*self.z} // } // } // impl ops::Div<f32> for Vec3 { // fn mul(self, b: f32) -> Vec3 { // Vec3{x: b/self.x, y: b/self.y, z: b/self.z} // } // } // impl Vec3 { // fn length(self) -> f32 { // let x = self.x; // let y = self.y; // let z = self.z; // (x*x + y*y + z*z).sqrt() // } // fn normalise(self) { // self / self.length // } // } use nalgebra_glm::*; trait PVec<T> { fn get_v3(&self, i: usize) -> [T; 3]; } impl PVec<usize> for Vec<usize> { fn get_v3(&self, i: usize) -> [usize; 3] { let j = i*3; [self[j], self[j+1], self[j+2]] } } impl PVec<f32> for Vec<f32> { fn get_v3(&self, i: usize) -> [f32; 3]
} // I wonder what good ways exist to do this. // pub fn vvec3_to_f32(v: &Vec<Vec3>) -> Vec<f32> { // let mut copy: Vec<f32> = Vec::with_capacity(v.len()); // for n in 0..v.len() { // let t = v[n]; // copy.append(&mut vec![t.x, t.y, t.z]); // } // copy // } pub fn compute_normals(coordinates: &Vec<Vec3>, triangles: &Vec<usize>) -> Vec<Vec3> { let mut normals: Vec<Vec3> = vec![vec3(0.,0.,0.); coordinates.len()]; for i in 0..triangles.len()/3 { let t = triangles.get_v3(i); let a = &coordinates[t[0]]; let b = &coordinates[t[1]]; let c = &coordinates[t[2]]; let normal = cross::<f32, U3>(&(c-b), &(a-b)); for p in &t { normals[*p] += normal; } } for n in normals.iter_mut() { n.normalize_mut(); } normals }
{ let j = i*3; [self[j], self[j+1], self[j+2]] }
aes128gcm.go
/* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 *
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package conn import ( "crypto/aes" "crypto/cipher" core "github.com/bglmmz/grpc/credentials/alts/internal" ) const ( // Overflow length n in bytes, never encrypt more than 2^(n*8) frames (in // each direction). overflowLenAES128GCM = 5 ) // aes128gcm is the struct that holds necessary information for ALTS record. // The counter value is NOT included in the payload during the encryption and // decryption operations. type aes128gcm struct { // inCounter is used in ALTS record to check that incoming counters are // as expected, since ALTS record guarantees that messages are unwrapped // in the same order that the peer wrapped them. inCounter Counter outCounter Counter aead cipher.AEAD } // NewAES128GCM creates an instance that uses aes128gcm for ALTS record. func NewAES128GCM(side core.Side, key []byte) (ALTSRecordCrypto, error) { c, err := aes.NewCipher(key) if err != nil { return nil, err } a, err := cipher.NewGCM(c) if err != nil { return nil, err } return &aes128gcm{ inCounter: NewInCounter(side, overflowLenAES128GCM), outCounter: NewOutCounter(side, overflowLenAES128GCM), aead: a, }, nil } // Encrypt is the encryption function. dst can contain bytes at the beginning of // the ciphertext that will not be encrypted but will be authenticated. If dst // has enough capacity to hold these bytes, the ciphertext and the tag, no // allocation and copy operations will be performed. dst and plaintext do not // overlap. func (s *aes128gcm) Encrypt(dst, plaintext []byte) ([]byte, error) { // If we need to allocate an output buffer, we want to include space for // GCM tag to avoid forcing ALTS record to reallocate as well. dlen := len(dst) dst, out := SliceForAppend(dst, len(plaintext)+GcmTagSize) seq, err := s.outCounter.Value() if err != nil { return nil, err } data := out[:len(plaintext)] copy(data, plaintext) // data may alias plaintext // Seal appends the ciphertext and the tag to its first argument and // returns the updated slice. However, SliceForAppend above ensures that // dst has enough capacity to avoid a reallocation and copy due to the // append. dst = s.aead.Seal(dst[:dlen], seq, data, nil) s.outCounter.Inc() return dst, nil } func (s *aes128gcm) EncryptionOverhead() int { return GcmTagSize } func (s *aes128gcm) Decrypt(dst, ciphertext []byte) ([]byte, error) { seq, err := s.inCounter.Value() if err != nil { return nil, err } // If dst is equal to ciphertext[:0], ciphertext storage is reused. plaintext, err := s.aead.Open(dst, seq, ciphertext, nil) if err != nil { return nil, ErrAuth } s.inCounter.Inc() return plaintext, nil }
views.py
from django.shortcuts import render from .models import Photos,Category,Location from django.http import HttpResponse, Http404 # Create your views here. def home(request): photos = Photos.objects.all() return render(request,'index.html',{"photos":photos}) def search_photo(request): if 'category' in request.GET and request.GET["category"]: search_category = request.GET.get("category") searched_photos = Photos.search_by_category(search_category) message = f"{search_category}" title = "Search photo" return render(request,'search.html',{"searched_photos":searched_photos, "message":message, "title":title}) else: message = "You haven't searched for any category" return render(request, 'search.html',{"message":message}) def
(request,photo_id): try: photo = Photos.objects.get(id=photo_id) title = "Photo" except : raise Http404() return render(request,'photo.html',{"photo":photo,"title":title})
photo
VolumeOperations.py
#import OpenStack connection class from the SDK from openstack import connection # Create a connection object by calling the constructor and pass the security information conn = connection.Connection(auth_url="http://192.168.0.106/identity", project_name="demo", username="admin", password="manoj", user_domain_id="default", project_domain_id="default") def create_volume(conn): volume_properties = {'size':'2', 'name':'packtpub-volume-2'} volume = conn.block_store.create_volume(**volume_properties) def delete_volume(conn): volume_id = "3b064701-aaa7-418a-9df7-cad52bd549ee" conn.block_store.delete_volume(volume_id) def create_snapshot(conn): snapshot_properties = {'volume_id':'3b064701-aaa7-418a-9df7-cad52bd549ee'} snapshot = conn.block_store.create_snapshot(**snapshot_properties) def
(conn): snapshot_id = "91ac5916-0baa-469e-ac4e-e37b2a3880dc" conn.block_store.delete_snapshot(snapshot_id) #create_snapshot(conn) #delete_snapshot(conn) #delete_volume(conn) create_volume(conn)
delete_snapshot
c2.go
// c2.go package print
import "unsafe" func Print(s string) { cs := C.CString(s) defer C.free(unsafe.Pointer(cs)) C.fputs(cs, (*C.FILE)(C.stdout)) }
// #include <stdio.h> // #include <stdlib.h> import "C"
thirdparty_download.py
from checksum import verifyFile from components import requiredLibrariesFor from configurations import getConfiguration from download import downloadURL from extract import TopLevelDirRenamer, extract from libraries import allDependencies, librariesByName from packages import getPackage from patch import Diff, patch from os import makedirs from os.path import isdir, isfile, join as joinpath from shutil import rmtree import sys
# TODO: Make DirectX headers for MinGW a package and make the DirectX sound # driver a component. def downloadPackage(package, tarballsDir): if not isdir(tarballsDir): makedirs(tarballsDir) filePath = joinpath(tarballsDir, package.getTarballName()) if isfile(filePath): print '%s version %s - already downloaded' % ( package.niceName, package.version ) else: downloadURL(package.getURL(), tarballsDir) def verifyPackage(package, tarballsDir): filePath = joinpath(tarballsDir, package.getTarballName()) try: verifyFile(filePath, package.fileLength, package.checksums) except IOError, ex: print >> sys.stderr, '%s corrupt: %s' % ( package.getTarballName(), ex ) sys.exit(1) def extractPackage(package, tarballsDir, sourcesDir, patchesDir): if not isdir(sourcesDir): makedirs(sourcesDir) sourceDirName = package.getSourceDirName() packageSrcDir = joinpath(sourcesDir, sourceDirName) if isdir(packageSrcDir): rmtree(packageSrcDir) extract( joinpath(tarballsDir, package.getTarballName()), sourcesDir, TopLevelDirRenamer(sourceDirName) ) diffPath = joinpath(patchesDir, sourceDirName + '.diff') if isfile(diffPath): for diff in Diff.load(diffPath): patch(diff, sourcesDir) print 'Patched:', diff.getPath() def fetchPackageSource(makeName, tarballsDir, sourcesDir, patchesDir): package = getPackage(makeName) downloadPackage(package, tarballsDir) verifyPackage(package, tarballsDir) extractPackage(package, tarballsDir, sourcesDir, patchesDir) def main(platform, tarballsDir, sourcesDir, patchesDir): configuration = getConfiguration('3RD_STA') components = configuration.iterDesiredComponents() # Compute the set of all directly and indirectly required libraries, # then filter out system libraries. thirdPartyLibs = set( makeName for makeName in allDependencies(requiredLibrariesFor(components)) if not librariesByName[makeName].isSystemLibrary(platform) ) if platform == 'windows': # Avoid ALSA, since we won't be building it and extracting it will # fail on file systems that don't support symlinks. # TODO: 3rdparty.mk filters out ALSA on non-Linux platforms; # figure out a way to do that in a single location. thirdPartyLibs.discard('ALSA') for makeName in sorted(thirdPartyLibs): fetchPackageSource(makeName, tarballsDir, sourcesDir, patchesDir) if __name__ == '__main__': if len(sys.argv) == 2: main( sys.argv[1], 'derived/3rdparty/download', 'derived/3rdparty/src', 'build/3rdparty' ) else: print >> sys.stderr, ( 'Usage: python thirdparty_download.py TARGET_OS' ) sys.exit(2)
query.rs
// Copyright (c) 2016-2017 Nikita Pekin and the wolfram_alpha_rs contributors // See the README.md file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. //! Performs a query to Wolfram|Alpha. //! //! For more information, see [Wolfram|Alpha's API //! documentation](http://products.wolframalpha.com/api/documentation.html). use error::Error; use futures::Future; use model::QueryResult; use std::collections::HashMap; use super::{WolframAlphaRequestSender, parse_wolfram_alpha_response}; /// A container struct for the parameters for a query to the Wolfram|Alpha API. // TODO: replace these with concrete types. #[allow(missing_docs)] pub struct OptionalQueryParameters<'a> { pub format: Option<&'a str>, pub includepodid: Option<&'a str>, pub excludepodid: Option<&'a str>, pub podtitle: Option<&'a str>, pub podindex: Option<&'a str>, pub scanner: Option<&'a str>, pub async: Option<&'a str>, pub ip: Option<&'a str>, pub latlong: Option<&'a str>, pub location: Option<&'a str>, pub assumption: Option<&'a str>, pub podstate: Option<&'a str>, pub units: Option<&'a str>, pub width: Option<&'a str>, pub maxwidth: Option<&'a str>, pub plotwidth: Option<&'a str>, pub mag: Option<&'a str>, pub scantimeout: Option<&'a str>, pub podtimeout: Option<&'a str>, pub formattimeout: Option<&'a str>, pub parsetimeout: Option<&'a str>, pub reinterpret: Option<&'a str>, pub translation: Option<&'a str>, pub ignorecase: Option<&'a str>, pub sig: Option<&'a str>, } /// Performs a query to the Wolfram|Alpha API. pub fn query<'a, R>( client: &'a R, appid: &'a str, input: &'a str, optional_query_parameters: Option<OptionalQueryParameters<'a>> ) -> Box<'a + Future<Item = QueryResult, Error = Error>> where R: WolframAlphaRequestSender, { let mut params = HashMap::new(); params.insert("input", input); // If present, we insert the optional parameters. if let Some(v) = optional_query_parameters { for &(name, value) in &[("format", v.format), ("includepodid", v.includepodid), ("excludepodid", v.excludepodid), ("podtitle", v.podtitle), ("podindex", v.podindex), ("scanner", v.scanner), ("async", v.async), ("ip", v.ip), ("latlong", v.latlong), ("location", v.location), ("assumption", v.assumption), ("podstate", v.podstate), ("units", v.units), ("width", v.width), ("maxwidth", v.maxwidth), ("plotwidth", v.plotwidth), ("mag", v.mag), ("scantimeout", v.scantimeout), ("podtimeout", v.podtimeout), ("formattimeout", v.formattimeout), ("parsetimeout", v.parsetimeout), ("reinterpret", v.reinterpret), ("translation", v.translation), ("ignorecase", v.ignorecase)] { if let Some(value) = value
} } let res = client.send_authed("query", appid, params) .map_err(From::from) .and_then(|res| { parse_wolfram_alpha_response(&res) }); Box::new(res) }
{ params.insert(name, value); }
zk.go
// Copyright 2016 CoreOS, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package xchk import ( "bytes" "sort" "time" "github.com/coreos/zetcd" "github.com/golang/glog" ) // zkXchk takes incoming ZK requests and forwards them to a remote ZK server type zkXchk struct { s *session cZK zetcd.ZK oZK zetcd.ZK errc chan<- error } func newZK(s *session, cZKf, oZKf zetcd.ZKFunc, errc chan<- error) (*zkXchk, error)
func (xchk *zkXchk) Create(xid zetcd.Xid, op *zetcd.CreateRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.Create(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.Create(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.CreateResponse), or.Resp.(*zetcd.CreateResponse) if crr.Path != orr.Path { err = errPath } return or } func (xchk *zkXchk) Delete(xid zetcd.Xid, op *zetcd.DeleteRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.Delete(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.Delete(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } return or } func (xchk *zkXchk) Exists(xid zetcd.Xid, op *zetcd.ExistsRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.Exists(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.Exists(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.ExistsResponse), or.Resp.(*zetcd.ExistsResponse) if !xchk.xchkStat(crr.Stat, orr.Stat) { err = errStat } return or } func (xchk *zkXchk) GetData(xid zetcd.Xid, op *zetcd.GetDataRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.GetData(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.GetData(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.GetDataResponse), or.Resp.(*zetcd.GetDataResponse) if !bytes.Equal(crr.Data, orr.Data) { err = errData } if !xchk.xchkStat(crr.Stat, orr.Stat) { err = errStat } return or } func (xchk *zkXchk) SetData(xid zetcd.Xid, op *zetcd.SetDataRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.SetData(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.SetData(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.SetDataResponse), or.Resp.(*zetcd.SetDataResponse) if !xchk.xchkStat(crr.Stat, orr.Stat) { err = errStat } return or } func (xchk *zkXchk) GetAcl(xid zetcd.Xid, op *zetcd.GetAclRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.GetAcl(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.GetAcl(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.GetAclResponse), or.Resp.(*zetcd.GetAclResponse) if len(crr.Acl) != len(orr.Acl) { err = errNumAcl return or } for i := range crr.Acl { if crr.Acl[i] != orr.Acl[i] { err = errAcl return or } } if !xchk.xchkStat(crr.Stat, orr.Stat) { err = errStat } return or } func (xchk *zkXchk) SetAcl(xid zetcd.Xid, op *zetcd.SetAclRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.SetAcl(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.SetAcl(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.SetAclResponse), or.Resp.(*zetcd.SetAclResponse) if !xchk.xchkStat(crr.Stat, orr.Stat) { err = errStat } return or } func (xchk *zkXchk) GetChildren(xid zetcd.Xid, op *zetcd.GetChildrenRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.GetChildren(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.GetChildren(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.GetChildrenResponse), or.Resp.(*zetcd.GetChildrenResponse) if len(crr.Children) != len(orr.Children) { err = errNumChildren return or } sort.StringSlice(crr.Children).Sort() sort.StringSlice(orr.Children).Sort() for i := range crr.Children { if crr.Children[i] != orr.Children[i] { err = errChildren return or } } return or } func (xchk *zkXchk) Sync(xid zetcd.Xid, op *zetcd.SyncRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.Sync(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.Sync(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.SyncResponse), or.Resp.(*zetcd.SyncResponse) if crr.Path != orr.Path { err = errPath } return or } func (xchk *zkXchk) Ping(xid zetcd.Xid, op *zetcd.PingRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.Ping(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.Ping(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() return or } func (xchk *zkXchk) GetChildren2(xid zetcd.Xid, op *zetcd.GetChildren2Request) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.GetChildren2(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.GetChildren2(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() if err != nil || or.Resp == nil { return or } crr, orr := cr.Resp.(*zetcd.GetChildren2Response), or.Resp.(*zetcd.GetChildren2Response) if len(crr.Children) != len(orr.Children) { err = errNumChildren return or } sort.StringSlice(crr.Children).Sort() sort.StringSlice(orr.Children).Sort() for i := range crr.Children { if crr.Children[i] != orr.Children[i] { err = errChildren return or } } if !xchk.xchkStat(crr.Stat, orr.Stat) { err = errStat } return or } func (xchk *zkXchk) Multi(xid zetcd.Xid, op *zetcd.MultiRequest) zetcd.ZKResponse { panic("wut") } func (xchk *zkXchk) Close(xid zetcd.Xid, op *zetcd.CloseRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.Close(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.Close(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() return or } func (xchk *zkXchk) SetAuth(xid zetcd.Xid, op *zetcd.SetAuthRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.SetAuth(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.SetAuth(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() return or } func (xchk *zkXchk) SetWatches(xid zetcd.Xid, op *zetcd.SetWatchesRequest) zetcd.ZKResponse { cf := func() zetcd.ZKResponse { return xchk.cZK.SetWatches(xid, op) } of := func() zetcd.ZKResponse { return xchk.oZK.SetWatches(xid, op) } cr, or, err := xchk.xchkResp(cf, of) defer func() { xchk.reportErr(cr, or, err) }() return or } type zkfunc func() zetcd.ZKResponse func xchkHdr(cresp, oresp zetcd.ZKResponse) error { if cresp.Err != nil || oresp.Err != nil { return errErr } if cresp.Hdr == nil || oresp.Hdr == nil { return errErr } if cresp.Hdr.Err != oresp.Hdr.Err { return errErr } if cresp.Hdr.Zxid != oresp.Hdr.Zxid { return errZXid } return nil } func (xchk *zkXchk) xchkResp(cf, of zkfunc) (cresp zetcd.ZKResponse, oresp zetcd.ZKResponse, err error) { cch, och := make(chan zetcd.ZKResponse, 1), make(chan zetcd.ZKResponse, 1) go func() { cch <- cf() }() go func() { och <- of() }() select { case cresp = <-cch: case oresp = <-och: } select { case cresp = <-cch: case oresp = <-och: case <-time.After(time.Second): xchk.reportErr(cresp, oresp, errBadAuth) select { case cresp = <-cch: case oresp = <-och: } } return cresp, oresp, xchkHdr(cresp, oresp) } func (xchk *zkXchk) reportErr(cr, or zetcd.ZKResponse, err error) { if err == nil { return } xerr := &XchkError{err: err, cr: cr, or: or} glog.Warning(xerr) if xchk.errc != nil { select { case xchk.errc <- xerr: case <-xchk.s.StopNotify(): return } } } func (xchk *zkXchk) xchkStat(cStat, oStat zetcd.Stat) bool { ctdiff, otdiff := cStat.Ctime-cStat.Mtime, oStat.Ctime-oStat.Mtime if ctdiff != otdiff && otdiff == 0 { // expect equal times to be equal return false } if oStat.EphemeralOwner != 0 { csid, _ := xchk.s.sp.get(oStat.EphemeralOwner) if cStat.EphemeralOwner != csid { return false } // ephemeral owners confirmed to be equivalent cStat.EphemeralOwner = oStat.EphemeralOwner } else if cStat.EphemeralOwner != 0 { return false } // times will never be equivalent, so fake it cStat.Ctime, cStat.Mtime = oStat.Ctime, oStat.Mtime return cStat == oStat }
{ cZK, cerr := cZKf(s.candidate) if cerr != nil { return nil, cerr } oZK, oerr := oZKf(s.oracle) if oerr != nil { return nil, oerr } return &zkXchk{s, cZK, oZK, errc}, nil }
main.py
import os import json import torch import sys import time import random import numpy as np from tqdm import tqdm, trange import torch.multiprocessing as mp import torch.distributed as dist from torch.utils.tensorboard import SummaryWriter from apex.parallel import DistributedDataParallel as DDP from apex import amp sys.path.append('..') from models_gqa.model import LCGNwrapper from models_gqa.config import build_cfg_from_argparse from util.gqa_train.data_reader import DataReader #from util.gqa_train.data_reader import gqa_convert_examples_to_features # Load config # cmd = '--cfg /home/xdjf/lcgn-pytorch/exp_gqa/cfgs/lcgn_spatial.yaml train True'.split() # sys.argv.extend(cmd) # Start session #os.environ["CUDA_VISIBLE_DEVICES"] = cfg.GPUS # if len(cfg.GPUS.split(',')) > 1: # print('PyTorch implementation currently only supports single GPU') import wandb def load_train_data(cfg, rank, gpu, max_num=0, num_replicas=1): imdb_file = cfg.IMDB_FILE % cfg.TRAIN.SPLIT_VQA scene_graph_file = cfg.SCENE_GRAPH_FILE % \ cfg.TRAIN.SPLIT_VQA.replace('_balanced', '').replace('_all', '') #a = gqa_convert_examples_to_features(imdb_file, scene_graph_file, cfg) data_reader = DataReader( imdb_file, rank, gpu, num_replicas, shuffle=True, max_num=max_num, batch_size=cfg.TRAIN.BATCH_SIZE, vocab_question_file=cfg.VOCAB_QUESTION_FILE, T_encoder=cfg.T_ENCODER, N_encoder=cfg.N_ENCODER, O_encoder = cfg.O_ENCODER, vocab_answer_file=cfg.VOCAB_ANSWER_FILE, feature_type=cfg.FEAT_TYPE, spatial_feature_dir=cfg.SPATIAL_FEATURE_DIR, objects_feature_dir=cfg.OBJECTS_FEATURE_DIR, objects_max_num=cfg.W_FEAT, scene_graph_file=scene_graph_file, vocab_name_file=cfg.VOCAB_NAME_FILE, vocab_attr_file=cfg.VOCAB_ATTR_FILE, add_pos_enc=cfg.ADD_POS_ENC, pos_enc_dim=cfg.PE_DIM, pos_enc_scale=cfg.PE_SCALE) num_vocab = data_reader.batch_loader.vocab_dict.num_vocab num_choices = data_reader.batch_loader.answer_dict.num_vocab return data_reader, num_vocab, num_choices def batch_to_data(batch): questionIndices = torch.from_numpy( batch['input_seq_batch'].astype(np.int64)).cuda() # 128 * 30 questionLengths = torch.from_numpy( batch['seq_length_batch'].astype(np.int64)).cuda() # 128 semanIndices = torch.from_numpy( batch['input_seman_batch'].astype(np.int64)).cuda() # 128 * 30 semanLengths = torch.from_numpy( batch['seman_length_batch'].astype(np.int64)).cuda() # 128 answerIndices = torch.from_numpy( batch['answer_label_batch'].astype(np.int64)).cuda() # 128 nameIndices = torch.from_numpy( batch['input_name_batch'].astype(np.int64)).cuda() nameLengths = torch.from_numpy( batch['name_length_batch'].astype(np.int64)).cuda() images = torch.from_numpy( batch['image_feat_batch'].astype(np.float32)).cuda() # 128 * 49 * 2112 imagesObjectNum = torch.from_numpy( np.sum(batch['image_valid_batch'].astype(np.int64), axis=1)).cuda() # 128 return (questionIndices, questionLengths, semanIndices, semanLengths, answerIndices, nameIndices, nameLengths, images, imagesObjectNum) def run_train_on_data(model, data_reader_train, cfg, rank, gpu, run_eval=False, data_reader_eval=None): model.train() global_step = 1 lr = cfg.TRAIN.SOLVER.LR correct, total, loss_sum, batch_num = 0, 0, 0., 0 tr_loss, logging_loss = 0.0, 0.0 # if rank in [-1, 0]: # tb_writer = SummaryWriter() for batch, n_sample, e in data_reader_train.batches(one_pass=False): n_epoch = cfg.TRAIN.START_EPOCH + e if n_sample == 0 and n_epoch > cfg.TRAIN.START_EPOCH and rank in [-1, 0]: print('') # save snapshot snapshot_file = cfg.SNAPSHOT_FILE % (cfg.EXP_NAME, n_epoch) torch.save(model.state_dict(), snapshot_file) # run evaluation if run_eval: batch_eval = run_eval_on_data(cfg, model, data_reader_eval) #tb_writer.add_scalar("eval_loss", batch_eval['loss'], global_step) model.train() if cfg.DEBUG == False: wandb.log({"eval_loss": batch_eval['loss'], "eval_correct": batch_eval['accuracy']}) # clear stats correct, total, loss_sum, batch_num = 0, 0, 0., 0 if n_epoch >= cfg.TRAIN.MAX_EPOCH: break batch_list = batch_to_data(batch) # if first and rank in [-1, 0]: # tb_writer.add_graph(model.model, (batch_list, )) # first = False batch_res = model.run_batch(batch_list, train=True, lr=lr) correct += batch_res['num_correct'] total += batch_res['batch_size'] loss_sum += batch_res['loss'].item() tr_loss += loss_sum batch_num += 1 global_step += 1 lr = batch_res['lr'] if rank in [-1, 0] and cfg.logging_steps > 0 and global_step % cfg.logging_steps == 0 and cfg.DEBUG == False: wandb.log({"lr": batch_res['lr'], "train_loss": loss_sum/batch_num, "train_correct": correct/total}) # tb_writer.add_scalar("lr", batch_res['lr'], global_step) # tb_writer.add_scalar("loss", (tr_loss - logging_loss) / cfg.logging_steps, global_step) if rank in [-1, 0]: print('\rTrain E %d S %d: avgL=%.4f, avgA=%.4f, lr=%.1e' % ( n_epoch+1, total, loss_sum/batch_num, correct/total, lr), end='') # if rank in [-1, 0]: # tb_writer.close() def load_eval_data(cfg, rank, gpu, max_num=0): imdb_file = cfg.IMDB_FILE % cfg.TEST.SPLIT_VQA scene_graph_file = cfg.SCENE_GRAPH_FILE % \ cfg.TEST.SPLIT_VQA.replace('_balanced', '').replace('_all', '') data_reader = DataReader( imdb_file, rank, gpu, 1, shuffle=False, max_num=max_num, batch_size=cfg.TEST.BATCH_SIZE, vocab_question_file=cfg.VOCAB_QUESTION_FILE, T_encoder=cfg.T_ENCODER, N_encoder=cfg.N_ENCODER, O_encoder = cfg.O_ENCODER, vocab_answer_file=cfg.VOCAB_ANSWER_FILE, feature_type=cfg.FEAT_TYPE, spatial_feature_dir=cfg.SPATIAL_FEATURE_DIR, objects_feature_dir=cfg.OBJECTS_FEATURE_DIR, objects_max_num=cfg.W_FEAT, scene_graph_file=scene_graph_file, vocab_name_file=cfg.VOCAB_NAME_FILE, vocab_attr_file=cfg.VOCAB_ATTR_FILE, add_pos_enc=cfg.ADD_POS_ENC, pos_enc_dim=cfg.PE_DIM, pos_enc_scale=cfg.PE_SCALE) num_vocab = data_reader.batch_loader.vocab_dict.num_vocab num_choices = data_reader.batch_loader.answer_dict.num_vocab return data_reader, num_vocab, num_choices def run_eval_on_data(cfg, model, data_reader_eval, pred=False): model.eval() predictions = [] answer_tokens = data_reader_eval.batch_loader.answer_dict.word_list correct, total, loss_sum, batch_num = 0, 0, 0., 0 for batch, _, _ in data_reader_eval.batches(one_pass=True): batch_list = batch_to_data(batch) batch_res = model.run_batch(batch_list, train=False) if pred: predictions.extend([ {'questionId': q, 'prediction': answer_tokens[p]} for q, p in zip(batch['qid_list'], batch_res['predictions'])]) correct += batch_res['num_correct'] total += batch_res['batch_size'] loss_sum += batch_res['loss'].item() batch_num += 1 print('\rEval S %d: avgL=%.4f, avgA=%.4f' % ( total, loss_sum/batch_num, correct/total), end='') print('') eval_res = { 'correct': correct, 'total': total, 'accuracy': correct/total, 'loss': loss_sum/batch_num, 'predictions': predictions} return eval_res def dump_prediction_to_file(cfg, predictions, res_dir): pred_file = os.path.join(res_dir, 'pred_%s_%04d_%s.json' % ( cfg.EXP_NAME, cfg.TEST.EPOCH, cfg.TEST.SPLIT_VQA)) with open(pred_file, 'w') as f: json.dump(predictions, f, indent=2) print('predictions written to %s' % pred_file) def set_seed(args): random.seed(args.seed) np.random.seed(args.seed) torch.manual_seed(args.seed) if args.n_gpus > 0: torch.cuda.manual_seed_all(args.seed) def
(gpu, cfg): rank = -1 if gpu != -1: rank = cfg.nr * cfg.n_gpus + gpu dist.init_process_group( backend='nccl', init_method='env://', world_size=cfg.world_size, rank=rank ) if rank in [-1, 0, 1]: gpu = 0 elif rank in [2, 3]: gpu = 1 set_seed(cfg) print(f'rank: {rank} pid: {os.getpid()} is running...') num_replicas = cfg.world_size if rank != -1 else 1 data_reader_train, num_vocab, num_choices = load_train_data(cfg, rank, gpu, num_replicas=num_replicas) data_reader_eval, _, _ = load_eval_data(cfg, rank, gpu, max_num=cfg.TRAIN.EVAL_MAX_NUM) # Load model model = LCGNwrapper(num_vocab, num_choices, cfg=cfg, rank=rank, gpu=gpu) # Save snapshot if rank in [-1, 0]: if cfg.DEBUG == False: name = time.strftime('%Y%m%d-%H%M%S') wandb.init(project="gtp", notes="graph tensor propa", name=name) wandb.watch(model.model, log="all") wandb.config.update(cfg) snapshot_dir = os.path.dirname(cfg.SNAPSHOT_FILE % (cfg.EXP_NAME, 0)) os.makedirs(snapshot_dir, exist_ok=True) with open(os.path.join(snapshot_dir, 'cfg.json'), 'w') as f: json.dump(cfg, f, indent=2) if cfg.TRAIN.START_EPOCH > 0 and rank in [-1, 0]: print('resuming from epoch %d' % cfg.TRAIN.START_EPOCH) model.load_state_dict(torch.load( cfg.SNAPSHOT_FILE % (cfg.EXP_NAME, cfg.TRAIN.START_EPOCH))) if rank in [-1, 0]: print('%s - train for %d epochs' % (cfg.EXP_NAME, cfg.TRAIN.MAX_EPOCH)) run_train_on_data( model, data_reader_train, cfg, rank, gpu, run_eval=cfg.TRAIN.RUN_EVAL, data_reader_eval=data_reader_eval) if rank in [-1, 0]: print('%s - train (done)' % cfg.EXP_NAME) def test(cfg): data_reader_eval, num_vocab, num_choices = load_eval_data(cfg, -1, 0) # Load model model = LCGNwrapper(num_vocab, num_choices, cfg) # Load test snapshot snapshot_file = cfg.SNAPSHOT_FILE % (cfg.EXP_NAME, cfg.TEST.EPOCH) model.load_state_dict(torch.load(snapshot_file)) res_dir = cfg.TEST.RESULT_DIR % (cfg.EXP_NAME, cfg.TEST.EPOCH) vis_dir = os.path.join( res_dir, '%s_%s' % (cfg.TEST.VIS_DIR_PREFIX, cfg.TEST.SPLIT_VQA)) os.makedirs(res_dir, exist_ok=True) os.makedirs(vis_dir, exist_ok=True) pred = cfg.TEST.DUMP_PRED if not pred: print('NOT writing predictions (set TEST.DUMP_PRED True to write)') print('%s - test epoch %d' % (cfg.EXP_NAME, cfg.TEST.EPOCH)) eval_res = run_eval_on_data(cfg, model, data_reader_eval, pred=pred) print('%s - test epoch %d: accuracy = %.4f' % ( cfg.EXP_NAME, cfg.TEST.EPOCH, eval_res['accuracy'])) # write results if pred: dump_prediction_to_file(cfg, eval_res['predictions'], res_dir) eval_res.pop('predictions') res_file = os.path.join(res_dir, 'res_%s_%04d_%s.json' % ( cfg.EXP_NAME, cfg.TEST.EPOCH, cfg.TEST.SPLIT_VQA)) with open(res_file, 'w') as f: json.dump(eval_res, f) if __name__ == '__main__': cfg = build_cfg_from_argparse() start = time.time() print(f'pid: {os.getpid()} is running...') if cfg.train: if cfg.n_gpus > 1: os.environ['MASTER_ADDR'] = '127.0.0.1' os.environ['MASTER_PORT'] = '12801' cfg.world_size = cfg.n_gpus * cfg.nodes mp.spawn(train, nprocs=cfg.n_gpus, args=(cfg,)) else: os.environ["CUDA_VISIBLE_DEVICES"] = cfg.GPUS train(-1, cfg) end_ = time.time() if cfg.DEBUG == False: wandb.log({"training time": int((end_ - start) / 60)}) print(f'time has cost : {end_ - start}') else: test(cfg)
train
index.tsx
import React, { useState } from 'react'; import { View, Image, Text, Linking } from 'react-native'; import { RectButton } from 'react-native-gesture-handler'; import AsyncStorage from '@react-native-community/async-storage'; import heartOutlineIcon from '../../assets/images/icons/heart-outline.png'; import unfavoriteIcon from '../../assets/images/icons/unfavorite.png'; import whatsappIcon from '../../assets/images/icons/whatsapp.png'; import styles from './styles'; export interface Teacher { id: number; avatar: string; bio: string; cost: number; name: string; subject: string; whatsapp: string; } interface TeacherItemsProps{ teacher: Teacher; favorited: boolean; } const TeacherItem: React.FC<TeacherItemsProps> = ({ teacher, favorited }) => { const [isFavorited, setIsFavorited] = useState(favorited); function
() { Linking.openURL(`whatsapp://send?phone=${teacher.whatsapp}`) } async function handleTogleFavorite() { const favorites = await AsyncStorage.getItem('favorites'); let favoritesArray = []; if (favorites) { favoritesArray = JSON.parse(favorites) } if(isFavorited) { const favoriteIndex = favoritesArray.findIndex((teacherItem : Teacher) => { return teacherItem.id = teacher.id; }); favoritesArray.splice(favoriteIndex, 1); setIsFavorited(false); }else { favoritesArray.push(teacher); setIsFavorited(true); } await AsyncStorage.setItem('favorite', JSON.stringify(favoritesArray)); } return ( <View style={styles.container}> <View style={styles.profile}> <Image style={styles.avatar} source={{ uri: teacher.avatar }} /> <View style={styles.profileInfo}> <Text style={styles.name}>{teacher.name}</Text> <Text style={styles.subject}>{teacher.subject}</Text> </View> </View> <Text style={styles.bio}> {teacher.bio} </Text> <View style={styles.footer}> <Text style={styles.price}> Preco/hora {' '} <Text style={styles.priceVAlue}>R$ {teacher.cost}</Text> </Text> </View> <View style={styles.buttonsContainer}> <RectButton onPress={handleTogleFavorite} style={[ styles.favoriteButton, isFavorited ? styles.favorited : {}, ]} > {isFavorited ? <Image source={unfavoriteIcon}/> : <Image source={heartOutlineIcon}/> } </RectButton> <RectButton style={styles.contactButton} onPress={handleLinkToWhatsapp} > <Image source={whatsappIcon}/> <Text style={styles.contactButtonText}>Entrar em contato</Text> </RectButton> </View> </View> ) } export default TeacherItem;
handleLinkToWhatsapp
test_util.rs
use crate::{policy, Config}; pub use futures::prelude::*; use linkerd_app_core::{ config, dns::Suffix, drain, exp_backoff, identity::LocalCrtKey, metrics, proxy::{ http::{h1, h2}, tap, }, transport::{Keepalive, ListenAddr}, ProxyRuntime, }; pub use linkerd_app_test as support; use linkerd_server_policy::{Authentication, Authorization, Protocol, ServerPolicy}; use std::time::Duration; pub fn default_config() -> Config { let cluster_local = "svc.cluster.local." .parse::<Suffix>() .expect("`svc.cluster.local.` suffix is definitely valid"); Config { allow_discovery: Some(cluster_local).into_iter().collect(), proxy: config::ProxyConfig { server: config::ServerConfig { addr: ListenAddr(([0, 0, 0, 0], 0).into()), keepalive: Keepalive(None), h2_settings: h2::Settings::default(), }, connect: config::ConnectConfig { keepalive: Keepalive(None), timeout: Duration::from_secs(1), backoff: exp_backoff::ExponentialBackoff::new( Duration::from_millis(100), Duration::from_millis(500), 0.1, ) .unwrap(), h1_settings: h1::PoolSettings { max_idle: 1, idle_timeout: Duration::from_secs(1), }, h2_settings: h2::Settings::default(), }, buffer_capacity: 10_000, cache_max_idle_age: Duration::from_secs(20), dispatch_timeout: Duration::from_secs(1), max_in_flight_requests: 10_000, detect_protocol_timeout: Duration::from_secs(10), }, policy: policy::Config::Fixed { default: ServerPolicy { protocol: Protocol::Detect { timeout: std::time::Duration::from_secs(10), }, authorizations: vec![Authorization { authentication: Authentication::Unauthenticated,
} .into(), ports: Default::default(), }, profile_idle_timeout: Duration::from_millis(500), allowed_ips: Default::default(), } } pub fn runtime() -> (ProxyRuntime, drain::Signal) { let (drain_tx, drain) = drain::channel(); let (tap, _) = tap::new(); let (metrics, _) = metrics::Metrics::new(std::time::Duration::from_secs(10)); let runtime = ProxyRuntime { identity: LocalCrtKey::default_for_test(), metrics: metrics.proxy, tap, span_sink: None, drain, }; (runtime, drain_tx) }
networks: vec![Default::default()], name: "testsaz".into(), }], name: "testsrv".into(),
stor.go
package handlers import ( "gftp/commands" "gftp/dtp" "gftp/server" "path" "strings" ) type storCmdHandler struct { } func (h storCmdHandler) Handle(cmd *commands.Command, ctx *server.ConnContext) *server.Response { // Mark the transfer starting point ctx.WriteResponse(&server.Response{ Code: server.ReplyFileStatusOk, Message: "", }) err := ctx.DtpConn.SendMessage(dtp.DtpTransferRequest{ FilePath: path.Join(ctx.ServerRoot, ctx.UserRoot, ctx.Pwd, strings.Join(cmd.Params, " ")), TransferAction: dtp.TransferActionStore, TransferType: ctx.DtpTransferType, }) if err != nil
return &server.Response{ Code: server.ReplyClosingDataConnection, Message: "OK", } }
{ return &server.Response{ Code: server.ReplyRequestedFileUnavailableOrBusy, Message: err.Error(), } }
cell_area.rs
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use cairo; use gdk; use gdk_sys; use glib; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::GString; use glib_sys; use gtk_sys; use libc; use std::boxed::Box as Box_; use std::fmt; use std::mem; use std::mem::transmute; use Buildable; use CellAreaContext; use CellEditable; use CellLayout; use CellRenderer; use CellRendererState; use DirectionType; use Orientation; use SizeRequestMode; use TreeIter; use TreeModel; use TreePath; use Widget; glib_wrapper! { pub struct CellArea(Object<gtk_sys::GtkCellArea, gtk_sys::GtkCellAreaClass>) @implements Buildable, CellLayout; match fn { get_type => || gtk_sys::gtk_cell_area_get_type(), } } pub const NONE_CELL_AREA: Option<&CellArea> = None; pub trait CellAreaExt: 'static { fn activate<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, cell_area: &gdk::Rectangle, flags: CellRendererState, edit_only: bool, ) -> bool; fn activate_cell<P: IsA<Widget>, Q: IsA<CellRenderer>>( &self, widget: &P, renderer: &Q, event: &gdk::Event, cell_area: &gdk::Rectangle, flags: CellRendererState, ) -> bool; fn add<P: IsA<CellRenderer>>(&self, renderer: &P); fn add_focus_sibling<P: IsA<CellRenderer>, Q: IsA<CellRenderer>>( &self, renderer: &P, sibling: &Q, ); //fn add_with_properties<P: IsA<CellRenderer>>(&self, renderer: &P, first_prop_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); fn apply_attributes<P: IsA<TreeModel>>( &self, tree_model: &P, iter: &TreeIter, is_expander: bool, is_expanded: bool, ); fn attribute_connect<P: IsA<CellRenderer>>(&self, renderer: &P, attribute: &str, column: i32); fn attribute_disconnect<P: IsA<CellRenderer>>(&self, renderer: &P, attribute: &str); fn attribute_get_column<P: IsA<CellRenderer>>(&self, renderer: &P, attribute: &str) -> i32; //fn cell_get<P: IsA<CellRenderer>>(&self, renderer: &P, first_prop_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); fn cell_get_property<P: IsA<CellRenderer>>( &self, renderer: &P, property_name: &str, ) -> glib::Value; //fn cell_get_valist<P: IsA<CellRenderer>>(&self, renderer: &P, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported); //fn cell_set<P: IsA<CellRenderer>>(&self, renderer: &P, first_prop_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); fn cell_set_property<P: IsA<CellRenderer>>( &self, renderer: &P, property_name: &str, value: &glib::Value, ); //fn cell_set_valist<P: IsA<CellRenderer>>(&self, renderer: &P, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported); fn copy_context<P: IsA<CellAreaContext>>(&self, context: &P) -> Option<CellAreaContext>; fn create_context(&self) -> Option<CellAreaContext>; fn event<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, event: &gdk::Event, cell_area: &gdk::Rectangle, flags: CellRendererState, ) -> i32; fn focus(&self, direction: DirectionType) -> bool; fn foreach<P: FnMut(&CellRenderer) -> bool>(&self, callback: P); fn foreach_alloc< P: IsA<CellAreaContext>, Q: IsA<Widget>, R: FnMut(&CellRenderer, &gdk::Rectangle, &gdk::Rectangle) -> bool, >( &self, context: &P, widget: &Q, cell_area: &gdk::Rectangle, background_area: &gdk::Rectangle, callback: R, ); fn get_cell_allocation<P: IsA<CellAreaContext>, Q: IsA<Widget>, R: IsA<CellRenderer>>( &self, context: &P, widget: &Q, renderer: &R, cell_area: &gdk::Rectangle, ) -> gdk::Rectangle; fn get_cell_at_position<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, cell_area: &gdk::Rectangle, x: i32, y: i32, ) -> (CellRenderer, gdk::Rectangle); fn get_current_path_string(&self) -> Option<GString>; fn get_edit_widget(&self) -> Option<CellEditable>; fn get_edited_cell(&self) -> Option<CellRenderer>; fn get_focus_cell(&self) -> Option<CellRenderer>; fn get_focus_from_sibling<P: IsA<CellRenderer>>(&self, renderer: &P) -> Option<CellRenderer>; fn get_focus_siblings<P: IsA<CellRenderer>>(&self, renderer: &P) -> Vec<CellRenderer>; fn get_preferred_height<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, ) -> (i32, i32); fn get_preferred_height_for_width<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, width: i32, ) -> (i32, i32); fn get_preferred_width<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, ) -> (i32, i32); fn get_preferred_width_for_height<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, height: i32, ) -> (i32, i32); fn get_request_mode(&self) -> SizeRequestMode; fn has_renderer<P: IsA<CellRenderer>>(&self, renderer: &P) -> bool; fn inner_cell_area<P: IsA<Widget>>( &self, widget: &P, cell_area: &gdk::Rectangle, ) -> gdk::Rectangle; fn is_activatable(&self) -> bool; fn is_focus_sibling<P: IsA<CellRenderer>, Q: IsA<CellRenderer>>( &self, renderer: &P, sibling: &Q, ) -> bool; fn remove<P: IsA<CellRenderer>>(&self, renderer: &P); fn remove_focus_sibling<P: IsA<CellRenderer>, Q: IsA<CellRenderer>>( &self, renderer: &P, sibling: &Q, ); fn render<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, cr: &cairo::Context, background_area: &gdk::Rectangle, cell_area: &gdk::Rectangle, flags: CellRendererState, paint_focus: bool, ); fn request_renderer<P: IsA<CellRenderer>, Q: IsA<Widget>>( &self, renderer: &P, orientation: Orientation, widget: &Q, for_size: i32, ) -> (i32, i32); fn set_focus_cell<P: IsA<CellRenderer>>(&self, renderer: &P); fn stop_editing(&self, canceled: bool); fn connect_add_editable< F: Fn(&Self, &CellRenderer, &CellEditable, &gdk::Rectangle, TreePath) + 'static, >( &self, f: F, ) -> SignalHandlerId; fn connect_apply_attributes<F: Fn(&Self, &TreeModel, &TreeIter, bool, bool) + 'static>( &self, f: F, ) -> SignalHandlerId; fn connect_focus_changed<F: Fn(&Self, &CellRenderer, TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId; fn connect_remove_editable<F: Fn(&Self, &CellRenderer, &CellEditable) + 'static>( &self, f: F, ) -> SignalHandlerId; fn connect_property_edit_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_property_edited_cell_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_property_focus_cell_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; } impl<O: IsA<CellArea>> CellAreaExt for O { fn activate<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, cell_area: &gdk::Rectangle, flags: CellRendererState, edit_only: bool, ) -> bool { unsafe { from_glib(gtk_sys::gtk_cell_area_activate( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, cell_area.to_glib_none().0, flags.to_glib(), edit_only.to_glib(), )) } } fn activate_cell<P: IsA<Widget>, Q: IsA<CellRenderer>>( &self, widget: &P, renderer: &Q, event: &gdk::Event, cell_area: &gdk::Rectangle, flags: CellRendererState, ) -> bool { unsafe { from_glib(gtk_sys::gtk_cell_area_activate_cell( self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, mut_override(event.to_glib_none().0), cell_area.to_glib_none().0, flags.to_glib(), )) } } fn add<P: IsA<CellRenderer>>(&self, renderer: &P) { unsafe { gtk_sys::gtk_cell_area_add( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, ); } } fn add_focus_sibling<P: IsA<CellRenderer>, Q: IsA<CellRenderer>>( &self, renderer: &P, sibling: &Q, ) { unsafe { gtk_sys::gtk_cell_area_add_focus_sibling( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, sibling.as_ref().to_glib_none().0, ); } } //fn add_with_properties<P: IsA<CellRenderer>>(&self, renderer: &P, first_prop_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { // unsafe { TODO: call gtk_sys:gtk_cell_area_add_with_properties() } //} fn apply_attributes<P: IsA<TreeModel>>( &self, tree_model: &P, iter: &TreeIter, is_expander: bool, is_expanded: bool, ) { unsafe { gtk_sys::gtk_cell_area_apply_attributes( self.as_ref().to_glib_none().0, tree_model.as_ref().to_glib_none().0, mut_override(iter.to_glib_none().0), is_expander.to_glib(), is_expanded.to_glib(), ); } } fn attribute_connect<P: IsA<CellRenderer>>(&self, renderer: &P, attribute: &str, column: i32) { unsafe { gtk_sys::gtk_cell_area_attribute_connect( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, attribute.to_glib_none().0, column, ); } } fn attribute_disconnect<P: IsA<CellRenderer>>(&self, renderer: &P, attribute: &str) { unsafe { gtk_sys::gtk_cell_area_attribute_disconnect( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, attribute.to_glib_none().0, ); } } fn attribute_get_column<P: IsA<CellRenderer>>(&self, renderer: &P, attribute: &str) -> i32 { unsafe { gtk_sys::gtk_cell_area_attribute_get_column( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, attribute.to_glib_none().0, ) } } //fn cell_get<P: IsA<CellRenderer>>(&self, renderer: &P, first_prop_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { // unsafe { TODO: call gtk_sys:gtk_cell_area_cell_get() } //} fn cell_get_property<P: IsA<CellRenderer>>( &self, renderer: &P, property_name: &str, ) -> glib::Value { unsafe { let mut value = glib::Value::uninitialized(); gtk_sys::gtk_cell_area_cell_get_property( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, property_name.to_glib_none().0, value.to_glib_none_mut().0, ); value } } //fn cell_get_valist<P: IsA<CellRenderer>>(&self, renderer: &P, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) { // unsafe { TODO: call gtk_sys:gtk_cell_area_cell_get_valist() } //} //fn cell_set<P: IsA<CellRenderer>>(&self, renderer: &P, first_prop_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { // unsafe { TODO: call gtk_sys:gtk_cell_area_cell_set() } //} fn cell_set_property<P: IsA<CellRenderer>>( &self, renderer: &P, property_name: &str, value: &glib::Value, ) { unsafe { gtk_sys::gtk_cell_area_cell_set_property( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, property_name.to_glib_none().0, value.to_glib_none().0, ); } } //fn cell_set_valist<P: IsA<CellRenderer>>(&self, renderer: &P, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) { // unsafe { TODO: call gtk_sys:gtk_cell_area_cell_set_valist() } //} fn copy_context<P: IsA<CellAreaContext>>(&self, context: &P) -> Option<CellAreaContext> { unsafe { from_glib_full(gtk_sys::gtk_cell_area_copy_context( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, )) } } fn create_context(&self) -> Option<CellAreaContext> { unsafe { from_glib_full(gtk_sys::gtk_cell_area_create_context( self.as_ref().to_glib_none().0, )) } } fn event<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, event: &gdk::Event, cell_area: &gdk::Rectangle, flags: CellRendererState, ) -> i32 { unsafe { gtk_sys::gtk_cell_area_event( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, mut_override(event.to_glib_none().0), cell_area.to_glib_none().0, flags.to_glib(), ) } } fn focus(&self, direction: DirectionType) -> bool { unsafe { from_glib(gtk_sys::gtk_cell_area_focus( self.as_ref().to_glib_none().0, direction.to_glib(), )) } } fn foreach<P: FnMut(&CellRenderer) -> bool>(&self, callback: P) { let callback_data: P = callback; unsafe extern "C" fn callback_func<P: FnMut(&CellRenderer) -> bool>( renderer: *mut gtk_sys::GtkCellRenderer, data: glib_sys::gpointer, ) -> glib_sys::gboolean { let renderer = from_glib_borrow(renderer); let callback: *mut P = data as *const _ as usize as *mut P; let res = (*callback)(&renderer); res.to_glib() } let callback = Some(callback_func::<P> as _); let super_callback0: &P = &callback_data; unsafe { gtk_sys::gtk_cell_area_foreach( self.as_ref().to_glib_none().0, callback, super_callback0 as *const _ as usize as *mut _, ); } } fn foreach_alloc< P: IsA<CellAreaContext>, Q: IsA<Widget>, R: FnMut(&CellRenderer, &gdk::Rectangle, &gdk::Rectangle) -> bool, >( &self, context: &P, widget: &Q, cell_area: &gdk::Rectangle, background_area: &gdk::Rectangle, callback: R, ) { let callback_data: R = callback; unsafe extern "C" fn callback_func< P: IsA<CellAreaContext>, Q: IsA<Widget>, R: FnMut(&CellRenderer, &gdk::Rectangle, &gdk::Rectangle) -> bool, >( renderer: *mut gtk_sys::GtkCellRenderer, cell_area: *const gdk_sys::GdkRectangle, cell_background: *const gdk_sys::GdkRectangle, data: glib_sys::gpointer, ) -> glib_sys::gboolean { let renderer = from_glib_borrow(renderer); let cell_area = from_glib_borrow(cell_area); let cell_background = from_glib_borrow(cell_background); let callback: *mut R = data as *const _ as usize as *mut R; let res = (*callback)(&renderer, &cell_area, &cell_background); res.to_glib() } let callback = Some(callback_func::<P, Q, R> as _); let super_callback0: &R = &callback_data; unsafe { gtk_sys::gtk_cell_area_foreach_alloc( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, cell_area.to_glib_none().0, background_area.to_glib_none().0, callback, super_callback0 as *const _ as usize as *mut _, ); } } fn get_cell_allocation<P: IsA<CellAreaContext>, Q: IsA<Widget>, R: IsA<CellRenderer>>( &self, context: &P, widget: &Q, renderer: &R, cell_area: &gdk::Rectangle, ) -> gdk::Rectangle { unsafe { let mut allocation = gdk::Rectangle::uninitialized(); gtk_sys::gtk_cell_area_get_cell_allocation( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, cell_area.to_glib_none().0, allocation.to_glib_none_mut().0, ); allocation } } fn get_cell_at_position<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, cell_area: &gdk::Rectangle, x: i32, y: i32, ) -> (CellRenderer, gdk::Rectangle) { unsafe { let mut alloc_area = gdk::Rectangle::uninitialized(); let ret = from_glib_none(gtk_sys::gtk_cell_area_get_cell_at_position( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, cell_area.to_glib_none().0, x, y, alloc_area.to_glib_none_mut().0, )); (ret, alloc_area) } } fn get_current_path_string(&self) -> Option<GString> { unsafe { from_glib_none(gtk_sys::gtk_cell_area_get_current_path_string( self.as_ref().to_glib_none().0, )) } } fn get_edit_widget(&self) -> Option<CellEditable> { unsafe { from_glib_none(gtk_sys::gtk_cell_area_get_edit_widget( self.as_ref().to_glib_none().0, )) } } fn get_edited_cell(&self) -> Option<CellRenderer> { unsafe { from_glib_none(gtk_sys::gtk_cell_area_get_edited_cell( self.as_ref().to_glib_none().0, )) } } fn get_focus_cell(&self) -> Option<CellRenderer> { unsafe { from_glib_none(gtk_sys::gtk_cell_area_get_focus_cell( self.as_ref().to_glib_none().0, )) } } fn get_focus_from_sibling<P: IsA<CellRenderer>>(&self, renderer: &P) -> Option<CellRenderer> { unsafe { from_glib_none(gtk_sys::gtk_cell_area_get_focus_from_sibling( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, )) } } fn get_focus_siblings<P: IsA<CellRenderer>>(&self, renderer: &P) -> Vec<CellRenderer> { unsafe { FromGlibPtrContainer::from_glib_none(gtk_sys::gtk_cell_area_get_focus_siblings( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, )) } } fn get_preferred_height<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, ) -> (i32, i32) { unsafe { let mut minimum_height = mem::MaybeUninit::uninit(); let mut natural_height = mem::MaybeUninit::uninit(); gtk_sys::gtk_cell_area_get_preferred_height( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, minimum_height.as_mut_ptr(), natural_height.as_mut_ptr(), ); let minimum_height = minimum_height.assume_init(); let natural_height = natural_height.assume_init(); (minimum_height, natural_height) } } fn get_preferred_height_for_width<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, width: i32, ) -> (i32, i32) { unsafe { let mut minimum_height = mem::MaybeUninit::uninit(); let mut natural_height = mem::MaybeUninit::uninit(); gtk_sys::gtk_cell_area_get_preferred_height_for_width( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, width, minimum_height.as_mut_ptr(), natural_height.as_mut_ptr(), ); let minimum_height = minimum_height.assume_init(); let natural_height = natural_height.assume_init(); (minimum_height, natural_height) } } fn get_preferred_width<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, ) -> (i32, i32) { unsafe { let mut minimum_width = mem::MaybeUninit::uninit(); let mut natural_width = mem::MaybeUninit::uninit(); gtk_sys::gtk_cell_area_get_preferred_width( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, minimum_width.as_mut_ptr(), natural_width.as_mut_ptr(), ); let minimum_width = minimum_width.assume_init(); let natural_width = natural_width.assume_init(); (minimum_width, natural_width) } } fn get_preferred_width_for_height<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, height: i32, ) -> (i32, i32) { unsafe { let mut minimum_width = mem::MaybeUninit::uninit(); let mut natural_width = mem::MaybeUninit::uninit(); gtk_sys::gtk_cell_area_get_preferred_width_for_height( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, height, minimum_width.as_mut_ptr(), natural_width.as_mut_ptr(), ); let minimum_width = minimum_width.assume_init(); let natural_width = natural_width.assume_init(); (minimum_width, natural_width) } } fn get_request_mode(&self) -> SizeRequestMode { unsafe { from_glib(gtk_sys::gtk_cell_area_get_request_mode( self.as_ref().to_glib_none().0, )) } } fn has_renderer<P: IsA<CellRenderer>>(&self, renderer: &P) -> bool { unsafe { from_glib(gtk_sys::gtk_cell_area_has_renderer( self.as_ref().to_glib_none().0,
} } fn inner_cell_area<P: IsA<Widget>>( &self, widget: &P, cell_area: &gdk::Rectangle, ) -> gdk::Rectangle { unsafe { let mut inner_area = gdk::Rectangle::uninitialized(); gtk_sys::gtk_cell_area_inner_cell_area( self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, cell_area.to_glib_none().0, inner_area.to_glib_none_mut().0, ); inner_area } } fn is_activatable(&self) -> bool { unsafe { from_glib(gtk_sys::gtk_cell_area_is_activatable( self.as_ref().to_glib_none().0, )) } } fn is_focus_sibling<P: IsA<CellRenderer>, Q: IsA<CellRenderer>>( &self, renderer: &P, sibling: &Q, ) -> bool { unsafe { from_glib(gtk_sys::gtk_cell_area_is_focus_sibling( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, sibling.as_ref().to_glib_none().0, )) } } fn remove<P: IsA<CellRenderer>>(&self, renderer: &P) { unsafe { gtk_sys::gtk_cell_area_remove( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, ); } } fn remove_focus_sibling<P: IsA<CellRenderer>, Q: IsA<CellRenderer>>( &self, renderer: &P, sibling: &Q, ) { unsafe { gtk_sys::gtk_cell_area_remove_focus_sibling( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, sibling.as_ref().to_glib_none().0, ); } } fn render<P: IsA<CellAreaContext>, Q: IsA<Widget>>( &self, context: &P, widget: &Q, cr: &cairo::Context, background_area: &gdk::Rectangle, cell_area: &gdk::Rectangle, flags: CellRendererState, paint_focus: bool, ) { unsafe { gtk_sys::gtk_cell_area_render( self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), background_area.to_glib_none().0, cell_area.to_glib_none().0, flags.to_glib(), paint_focus.to_glib(), ); } } fn request_renderer<P: IsA<CellRenderer>, Q: IsA<Widget>>( &self, renderer: &P, orientation: Orientation, widget: &Q, for_size: i32, ) -> (i32, i32) { unsafe { let mut minimum_size = mem::MaybeUninit::uninit(); let mut natural_size = mem::MaybeUninit::uninit(); gtk_sys::gtk_cell_area_request_renderer( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, orientation.to_glib(), widget.as_ref().to_glib_none().0, for_size, minimum_size.as_mut_ptr(), natural_size.as_mut_ptr(), ); let minimum_size = minimum_size.assume_init(); let natural_size = natural_size.assume_init(); (minimum_size, natural_size) } } fn set_focus_cell<P: IsA<CellRenderer>>(&self, renderer: &P) { unsafe { gtk_sys::gtk_cell_area_set_focus_cell( self.as_ref().to_glib_none().0, renderer.as_ref().to_glib_none().0, ); } } fn stop_editing(&self, canceled: bool) { unsafe { gtk_sys::gtk_cell_area_stop_editing(self.as_ref().to_glib_none().0, canceled.to_glib()); } } fn connect_add_editable< F: Fn(&Self, &CellRenderer, &CellEditable, &gdk::Rectangle, TreePath) + 'static, >( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn add_editable_trampoline< P, F: Fn(&P, &CellRenderer, &CellEditable, &gdk::Rectangle, TreePath) + 'static, >( this: *mut gtk_sys::GtkCellArea, renderer: *mut gtk_sys::GtkCellRenderer, editable: *mut gtk_sys::GtkCellEditable, cell_area: *mut gdk_sys::GdkRectangle, path: *mut libc::c_char, f: glib_sys::gpointer, ) where P: IsA<CellArea>, { let f: &F = &*(f as *const F); let path = from_glib_full(gtk_sys::gtk_tree_path_new_from_string(path)); f( &CellArea::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(renderer), &from_glib_borrow(editable), &from_glib_borrow(cell_area), path, ) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"add-editable\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( add_editable_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } fn connect_apply_attributes<F: Fn(&Self, &TreeModel, &TreeIter, bool, bool) + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn apply_attributes_trampoline< P, F: Fn(&P, &TreeModel, &TreeIter, bool, bool) + 'static, >( this: *mut gtk_sys::GtkCellArea, model: *mut gtk_sys::GtkTreeModel, iter: *mut gtk_sys::GtkTreeIter, is_expander: glib_sys::gboolean, is_expanded: glib_sys::gboolean, f: glib_sys::gpointer, ) where P: IsA<CellArea>, { let f: &F = &*(f as *const F); f( &CellArea::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(model), &from_glib_borrow(iter), from_glib(is_expander), from_glib(is_expanded), ) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"apply-attributes\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( apply_attributes_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } fn connect_focus_changed<F: Fn(&Self, &CellRenderer, TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn focus_changed_trampoline< P, F: Fn(&P, &CellRenderer, TreePath) + 'static, >( this: *mut gtk_sys::GtkCellArea, renderer: *mut gtk_sys::GtkCellRenderer, path: *mut libc::c_char, f: glib_sys::gpointer, ) where P: IsA<CellArea>, { let f: &F = &*(f as *const F); let path = from_glib_full(gtk_sys::gtk_tree_path_new_from_string(path)); f( &CellArea::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(renderer), path, ) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"focus-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( focus_changed_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } fn connect_remove_editable<F: Fn(&Self, &CellRenderer, &CellEditable) + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn remove_editable_trampoline< P, F: Fn(&P, &CellRenderer, &CellEditable) + 'static, >( this: *mut gtk_sys::GtkCellArea, renderer: *mut gtk_sys::GtkCellRenderer, editable: *mut gtk_sys::GtkCellEditable, f: glib_sys::gpointer, ) where P: IsA<CellArea>, { let f: &F = &*(f as *const F); f( &CellArea::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(renderer), &from_glib_borrow(editable), ) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"remove-editable\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( remove_editable_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } fn connect_property_edit_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_edit_widget_trampoline<P, F: Fn(&P) + 'static>( this: *mut gtk_sys::GtkCellArea, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA<CellArea>, { let f: &F = &*(f as *const F); f(&CellArea::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::edit-widget\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_edit_widget_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } fn connect_property_edited_cell_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_edited_cell_trampoline<P, F: Fn(&P) + 'static>( this: *mut gtk_sys::GtkCellArea, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA<CellArea>, { let f: &F = &*(f as *const F); f(&CellArea::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::edited-cell\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_edited_cell_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } fn connect_property_focus_cell_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_focus_cell_trampoline<P, F: Fn(&P) + 'static>( this: *mut gtk_sys::GtkCellArea, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA<CellArea>, { let f: &F = &*(f as *const F); f(&CellArea::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::focus-cell\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_focus_cell_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for CellArea { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "CellArea") } }
renderer.as_ref().to_glib_none().0, ))
vendor.js
require("source-map-support").install(); module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/accepts/index.js": /*!***************************************!*\ !*** ./node_modules/accepts/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * accepts * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var Negotiator = __webpack_require__(/*! negotiator */ "./node_modules/negotiator/index.js"); var mime = __webpack_require__(/*! mime-types */ "./node_modules/mime-types/index.js"); /** * Module exports. * @public */ module.exports = Accepts; /** * Create a new Accepts object for the given req. * * @param {object} req * @public */ function Accepts(req) { if (!(this instanceof Accepts)) { return new Accepts(req); } this.headers = req.headers; this.negotiator = new Negotiator(req); } /** * Check if the given `type(s)` is acceptable, returning * the best match when true, otherwise `undefined`, in which * case you should respond with 406 "Not Acceptable". * * The `type` value may be a single mime type string * such as "application/json", the extension name * such as "json" or an array `["json", "html", "text/plain"]`. When a list * or array is given the _best_ match, if any is returned. * * Examples: * * // Accept: text/html * this.types('html'); * // => "html" * * // Accept: text/*, application/json * this.types('html'); * // => "html" * this.types('text/html'); * // => "text/html" * this.types('json', 'text'); * // => "json" * this.types('application/json'); * // => "application/json" * * // Accept: text/*, application/json * this.types('image/png'); * this.types('png'); * // => undefined * * // Accept: text/*;q=.5, application/json * this.types(['html', 'json']); * this.types('html', 'json'); * // => "json" * * @param {String|Array} types... * @return {String|Array|Boolean} * @public */ Accepts.prototype.type = Accepts.prototype.types = function (types_) { var types = types_; // support flattened arguments if (types && !Array.isArray(types)) { types = new Array(arguments.length); for (var i = 0; i < types.length; i++) { types[i] = arguments[i]; } } // no types, return all requested types if (!types || types.length === 0) { return this.negotiator.mediaTypes(); } // no accept header, return first given type if (!this.headers.accept) { return types[0]; } var mimes = types.map(extToMime); var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)); var first = accepts[0]; return first ? types[mimes.indexOf(first)] : false; }; /** * Return accepted encodings or best fit based on `encodings`. * * Given `Accept-Encoding: gzip, deflate` * an array sorted by quality is returned: * * ['gzip', 'deflate'] * * @param {String|Array} encodings... * @return {String|Array} * @public */ Accepts.prototype.encoding = Accepts.prototype.encodings = function (encodings_) { var encodings = encodings_; // support flattened arguments if (encodings && !Array.isArray(encodings)) { encodings = new Array(arguments.length); for (var i = 0; i < encodings.length; i++) { encodings[i] = arguments[i]; } } // no encodings, return all requested encodings if (!encodings || encodings.length === 0) { return this.negotiator.encodings(); } return this.negotiator.encodings(encodings)[0] || false; }; /** * Return accepted charsets or best fit based on `charsets`. * * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` * an array sorted by quality is returned: * * ['utf-8', 'utf-7', 'iso-8859-1'] * * @param {String|Array} charsets... * @return {String|Array} * @public */ Accepts.prototype.charset = Accepts.prototype.charsets = function (charsets_) { var charsets = charsets_; // support flattened arguments if (charsets && !Array.isArray(charsets)) { charsets = new Array(arguments.length); for (var i = 0; i < charsets.length; i++) { charsets[i] = arguments[i]; } } // no charsets, return all requested charsets if (!charsets || charsets.length === 0) { return this.negotiator.charsets(); } return this.negotiator.charsets(charsets)[0] || false; }; /** * Return accepted languages or best fit based on `langs`. * * Given `Accept-Language: en;q=0.8, es, pt` * an array sorted by quality is returned: * * ['es', 'pt', 'en'] * * @param {String|Array} langs... * @return {Array|String} * @public */ Accepts.prototype.lang = Accepts.prototype.langs = Accepts.prototype.language = Accepts.prototype.languages = function (languages_) { var languages = languages_; // support flattened arguments if (languages && !Array.isArray(languages)) { languages = new Array(arguments.length); for (var i = 0; i < languages.length; i++) { languages[i] = arguments[i]; } } // no languages, return all requested languages if (!languages || languages.length === 0) { return this.negotiator.languages(); } return this.negotiator.languages(languages)[0] || false; }; /** * Convert extnames to mime. * * @param {String} type * @return {String} * @private */ function extToMime(type) { return type.indexOf('/') === -1 ? mime.lookup(type) : type; } /** * Check if mime is valid. * * @param {String} type * @return {String} * @private */ function validMime(type) { return typeof type === 'string'; } /***/ }), /***/ "./node_modules/array-flatten/array-flatten.js": /*!*****************************************************!*\ !*** ./node_modules/array-flatten/array-flatten.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Expose `arrayFlatten`. */ module.exports = arrayFlatten; /** * Recursive flatten function with depth. * * @param {Array} array * @param {Array} result * @param {Number} depth * @return {Array} */ function flattenWithDepth(array, result, depth) { for (var i = 0; i < array.length; i++) { var value = array[i]; if (depth > 0 && Array.isArray(value)) { flattenWithDepth(value, result, depth - 1); } else { result.push(value); } } return result; } /** * Recursive flatten function. Omitting depth is slightly faster. * * @param {Array} array * @param {Array} result * @return {Array} */ function flattenForever(array, result) { for (var i = 0; i < array.length; i++) { var value = array[i]; if (Array.isArray(value)) { flattenForever(value, result); } else { result.push(value); } } return result; } /** * Flatten an array, with the ability to define a depth. * * @param {Array} array * @param {Number} depth * @return {Array} */ function arrayFlatten(array, depth) { if (depth == null) { return flattenForever(array, []); } return flattenWithDepth(array, [], depth); } /***/ }), /***/ "./node_modules/body-parser/index.js": /*!*******************************************!*\ !*** ./node_modules/body-parser/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('body-parser'); /** * Cache of loaded parsers. * @private */ var parsers = Object.create(null); /** * @typedef Parsers * @type {function} * @property {function} json * @property {function} raw * @property {function} text * @property {function} urlencoded */ /** * Module exports. * @type {Parsers} */ exports = module.exports = deprecate.function(bodyParser, 'bodyParser: use individual json/urlencoded middlewares'); /** * JSON parser. * @public */ Object.defineProperty(exports, 'json', { configurable: true, enumerable: true, get: createParserGetter('json') }); /** * Raw parser. * @public */ Object.defineProperty(exports, 'raw', { configurable: true, enumerable: true, get: createParserGetter('raw') }); /** * Text parser. * @public */ Object.defineProperty(exports, 'text', { configurable: true, enumerable: true, get: createParserGetter('text') }); /** * URL-encoded parser. * @public */ Object.defineProperty(exports, 'urlencoded', { configurable: true, enumerable: true, get: createParserGetter('urlencoded') }); /** * Create a middleware to parse json and urlencoded bodies. * * @param {object} [options] * @return {function} * @deprecated * @public */ function bodyParser(options) { var opts = {}; // exclude type option if (options) { for (var prop in options) { if (prop !== 'type') { opts[prop] = options[prop]; } } } var _urlencoded = exports.urlencoded(opts); var _json = exports.json(opts); return function bodyParser(req, res, next) { _json(req, res, function (err) { if (err) return next(err); _urlencoded(req, res, next); }); }; } /** * Create a getter for loading a parser. * @private */ function createParserGetter(name) { return function get() { return loadParser(name); }; } /** * Load a parser module. * @private */ function loadParser(parserName) { var parser = parsers[parserName]; if (parser !== undefined) { return parser; } // this uses a switch for static require analysis switch (parserName) { case 'json': parser = __webpack_require__(/*! ./lib/types/json */ "./node_modules/body-parser/lib/types/json.js"); break; case 'raw': parser = __webpack_require__(/*! ./lib/types/raw */ "./node_modules/body-parser/lib/types/raw.js"); break; case 'text': parser = __webpack_require__(/*! ./lib/types/text */ "./node_modules/body-parser/lib/types/text.js"); break; case 'urlencoded': parser = __webpack_require__(/*! ./lib/types/urlencoded */ "./node_modules/body-parser/lib/types/urlencoded.js"); break; } // store to prevent invoking require() return parsers[parserName] = parser; } /***/ }), /***/ "./node_modules/body-parser/lib/read.js": /*!**********************************************!*\ !*** ./node_modules/body-parser/lib/read.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var createError = __webpack_require__(/*! http-errors */ "./node_modules/http-errors/index.js"); var getBody = __webpack_require__(/*! raw-body */ "./node_modules/raw-body/index.js"); var iconv = __webpack_require__(/*! iconv-lite */ "./node_modules/iconv-lite/lib/index.js"); var onFinished = __webpack_require__(/*! on-finished */ "./node_modules/on-finished/index.js"); var zlib = __webpack_require__(/*! zlib */ "zlib"); /** * Module exports. */ module.exports = read; /** * Read a request into a buffer and parse. * * @param {object} req * @param {object} res * @param {function} next * @param {function} parse * @param {function} debug * @param {object} options * @private */ function read(req, res, next, parse, debug, options) { var length; var opts = options; var stream; // flag as parsed req._body = true; // read options var encoding = opts.encoding !== null ? opts.encoding : null; var verify = opts.verify; try { // get the content stream stream = contentstream(req, debug, opts.inflate); length = stream.length; stream.length = undefined; } catch (err) { return next(err); } // set raw-body options opts.length = length; opts.encoding = verify ? null : encoding; // assert charset is supported if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { charset: encoding.toLowerCase(), type: 'charset.unsupported' })); } // read body debug('read body'); getBody(stream, opts, function (error, body) { if (error) { var _error; if (error.type === 'encoding.unsupported') { // echo back charset _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { charset: encoding.toLowerCase(), type: 'charset.unsupported' }); } else { // set status code on error _error = createError(400, error); } // read off entire request stream.resume(); onFinished(req, function onfinished() { next(createError(400, _error)); }); return; } // verify if (verify) { try { debug('verify body'); verify(req, res, body, encoding); } catch (err) { next(createError(403, err, { body: body, type: err.type || 'entity.verify.failed' })); return; } } // parse var str = body; try { debug('parse body'); str = typeof body !== 'string' && encoding !== null ? iconv.decode(body, encoding) : body; req.body = parse(str); } catch (err) { next(createError(400, err, { body: str, type: err.type || 'entity.parse.failed' })); return; } next(); }); } /** * Get the content stream of the request. * * @param {object} req * @param {function} debug * @param {boolean} [inflate=true] * @return {object} * @api private */ function contentstream(req, debug, inflate) { var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase(); var length = req.headers['content-length']; var stream; debug('content-encoding "%s"', encoding); if (inflate === false && encoding !== 'identity') { throw createError(415, 'content encoding unsupported', { encoding: encoding, type: 'encoding.unsupported' }); } switch (encoding) { case 'deflate': stream = zlib.createInflate(); debug('inflate body'); req.pipe(stream); break; case 'gzip': stream = zlib.createGunzip(); debug('gunzip body'); req.pipe(stream); break; case 'identity': stream = req; stream.length = length; break; default: throw createError(415, 'unsupported content encoding "' + encoding + '"', { encoding: encoding, type: 'encoding.unsupported' }); } return stream; } /***/ }), /***/ "./node_modules/body-parser/lib/types/json.js": /*!****************************************************!*\ !*** ./node_modules/body-parser/lib/types/json.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * body-parser * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var bytes = __webpack_require__(/*! bytes */ "./node_modules/bytes/index.js"); var contentType = __webpack_require__(/*! content-type */ "./node_modules/content-type/index.js"); var createError = __webpack_require__(/*! http-errors */ "./node_modules/http-errors/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('body-parser:json'); var read = __webpack_require__(/*! ../read */ "./node_modules/body-parser/lib/read.js"); var typeis = __webpack_require__(/*! type-is */ "./node_modules/type-is/index.js"); /** * Module exports. */ module.exports = json; /** * RegExp to match the first non-space in a string. * * Allowed whitespace is defined in RFC 7159: * * ws = *( * %x20 / ; Space * %x09 / ; Horizontal tab * %x0A / ; Line feed or New line * %x0D ) ; Carriage return */ var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*(.)/; // eslint-disable-line no-control-regex /** * Create a middleware to parse JSON bodies. * * @param {object} [options] * @return {function} * @public */ function json(options) { var opts = options || {}; var limit = typeof opts.limit !== 'number' ? bytes.parse(opts.limit || '100kb') : opts.limit; var inflate = opts.inflate !== false; var reviver = opts.reviver; var strict = opts.strict !== false; var type = opts.type || 'application/json'; var verify = opts.verify || false; if (verify !== false && typeof verify !== 'function') { throw new TypeError('option verify must be function'); } // create the appropriate type checking function var shouldParse = typeof type !== 'function' ? typeChecker(type) : type; function parse(body) { if (body.length === 0) { // special-case empty json body, as it's a common client-side mistake // TODO: maybe make this configurable or part of "strict" option return {}; } if (strict) { var first = firstchar(body); if (first !== '{' && first !== '[') { debug('strict violation'); throw createStrictSyntaxError(body, first); } } try { debug('parse json'); return JSON.parse(body, reviver); } catch (e) { throw normalizeJsonSyntaxError(e, { stack: e.stack }); } } return function jsonParser(req, res, next) { if (req._body) { debug('body already parsed'); next(); return; } req.body = req.body || {}; // skip requests without bodies if (!typeis.hasBody(req)) { debug('skip empty body'); next(); return; } debug('content-type %j', req.headers['content-type']); // determine if request should be parsed if (!shouldParse(req)) { debug('skip parsing'); next(); return; } // assert charset per RFC 7159 sec 8.1 var charset = getCharset(req) || 'utf-8'; if (charset.substr(0, 4) !== 'utf-') { debug('invalid charset'); next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { charset: charset, type: 'charset.unsupported' })); return; } // read read(req, res, next, parse, debug, { encoding: charset, inflate: inflate, limit: limit, verify: verify }); }; } /** * Create strict violation syntax error matching native error. * * @param {string} str * @param {string} char * @return {Error} * @private */ function createStrictSyntaxError(str, char) { var index = str.indexOf(char); var partial = str.substring(0, index) + '#'; try { JSON.parse(partial); /* istanbul ignore next */throw new SyntaxError('strict violation'); } catch (e) { return normalizeJsonSyntaxError(e, { message: e.message.replace('#', char), stack: e.stack }); } } /** * Get the first non-whitespace character in a string. * * @param {string} str * @return {function} * @private */ function firstchar(str) { return FIRST_CHAR_REGEXP.exec(str)[1]; } /** * Get the charset of a request. * * @param {object} req * @api private */ function getCharset(req) { try { return (contentType.parse(req).parameters.charset || '').toLowerCase(); } catch (e) { return undefined; } } /** * Normalize a SyntaxError for JSON.parse. * * @param {SyntaxError} error * @param {object} obj * @return {SyntaxError} */ function normalizeJsonSyntaxError(error, obj) { var keys = Object.getOwnPropertyNames(error); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key !== 'stack' && key !== 'message') { delete error[key]; } } var props = Object.keys(obj); for (var j = 0; j < props.length; j++) { var prop = props[j]; error[prop] = obj[prop]; } return error; } /** * Get the simple type checker. * * @param {string} type * @return {function} */ function typeChecker(type) { return function checkType(req) { return Boolean(typeis(req, type)); }; } /***/ }), /***/ "./node_modules/body-parser/lib/types/raw.js": /*!***************************************************!*\ !*** ./node_modules/body-parser/lib/types/raw.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var bytes = __webpack_require__(/*! bytes */ "./node_modules/bytes/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('body-parser:raw'); var read = __webpack_require__(/*! ../read */ "./node_modules/body-parser/lib/read.js"); var typeis = __webpack_require__(/*! type-is */ "./node_modules/type-is/index.js"); /** * Module exports. */ module.exports = raw; /** * Create a middleware to parse raw bodies. * * @param {object} [options] * @return {function} * @api public */ function raw(options) { var opts = options || {}; var inflate = opts.inflate !== false; var limit = typeof opts.limit !== 'number' ? bytes.parse(opts.limit || '100kb') : opts.limit; var type = opts.type || 'application/octet-stream'; var verify = opts.verify || false; if (verify !== false && typeof verify !== 'function') { throw new TypeError('option verify must be function'); } // create the appropriate type checking function var shouldParse = typeof type !== 'function' ? typeChecker(type) : type; function parse(buf) { return buf; } return function rawParser(req, res, next) { if (req._body) { debug('body already parsed'); next(); return; } req.body = req.body || {}; // skip requests without bodies if (!typeis.hasBody(req)) { debug('skip empty body'); next(); return; } debug('content-type %j', req.headers['content-type']); // determine if request should be parsed if (!shouldParse(req)) { debug('skip parsing'); next(); return; } // read read(req, res, next, parse, debug, { encoding: null, inflate: inflate, limit: limit, verify: verify }); }; } /** * Get the simple type checker. * * @param {string} type * @return {function} */ function typeChecker(type) { return function checkType(req) { return Boolean(typeis(req, type)); }; } /***/ }), /***/ "./node_modules/body-parser/lib/types/text.js": /*!****************************************************!*\ !*** ./node_modules/body-parser/lib/types/text.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * body-parser * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var bytes = __webpack_require__(/*! bytes */ "./node_modules/bytes/index.js"); var contentType = __webpack_require__(/*! content-type */ "./node_modules/content-type/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('body-parser:text'); var read = __webpack_require__(/*! ../read */ "./node_modules/body-parser/lib/read.js"); var typeis = __webpack_require__(/*! type-is */ "./node_modules/type-is/index.js"); /** * Module exports. */ module.exports = text; /** * Create a middleware to parse text bodies. * * @param {object} [options] * @return {function} * @api public */ function text(options) { var opts = options || {}; var defaultCharset = opts.defaultCharset || 'utf-8'; var inflate = opts.inflate !== false; var limit = typeof opts.limit !== 'number' ? bytes.parse(opts.limit || '100kb') : opts.limit; var type = opts.type || 'text/plain'; var verify = opts.verify || false; if (verify !== false && typeof verify !== 'function') { throw new TypeError('option verify must be function'); } // create the appropriate type checking function var shouldParse = typeof type !== 'function' ? typeChecker(type) : type; function parse(buf) { return buf; } return function textParser(req, res, next) { if (req._body) { debug('body already parsed'); next(); return; } req.body = req.body || {}; // skip requests without bodies if (!typeis.hasBody(req)) { debug('skip empty body'); next(); return; } debug('content-type %j', req.headers['content-type']); // determine if request should be parsed if (!shouldParse(req)) { debug('skip parsing'); next(); return; } // get charset var charset = getCharset(req) || defaultCharset; // read read(req, res, next, parse, debug, { encoding: charset, inflate: inflate, limit: limit, verify: verify }); }; } /** * Get the charset of a request. * * @param {object} req * @api private */ function getCharset(req) { try { return (contentType.parse(req).parameters.charset || '').toLowerCase(); } catch (e) { return undefined; } } /** * Get the simple type checker. * * @param {string} type * @return {function} */ function typeChecker(type) { return function checkType(req) { return Boolean(typeis(req, type)); }; } /***/ }), /***/ "./node_modules/body-parser/lib/types/urlencoded.js": /*!**********************************************************!*\ !*** ./node_modules/body-parser/lib/types/urlencoded.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * body-parser * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var bytes = __webpack_require__(/*! bytes */ "./node_modules/bytes/index.js"); var contentType = __webpack_require__(/*! content-type */ "./node_modules/content-type/index.js"); var createError = __webpack_require__(/*! http-errors */ "./node_modules/http-errors/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('body-parser:urlencoded'); var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('body-parser'); var read = __webpack_require__(/*! ../read */ "./node_modules/body-parser/lib/read.js"); var typeis = __webpack_require__(/*! type-is */ "./node_modules/type-is/index.js"); /** * Module exports. */ module.exports = urlencoded; /** * Cache of parser modules. */ var parsers = Object.create(null); /** * Create a middleware to parse urlencoded bodies. * * @param {object} [options] * @return {function} * @public */ function urlencoded(options) { var opts = options || {}; // notice because option default will flip in next major if (opts.extended === undefined) { deprecate('undefined extended: provide extended option'); } var extended = opts.extended !== false; var inflate = opts.inflate !== false; var limit = typeof opts.limit !== 'number' ? bytes.parse(opts.limit || '100kb') : opts.limit; var type = opts.type || 'application/x-www-form-urlencoded'; var verify = opts.verify || false; if (verify !== false && typeof verify !== 'function') { throw new TypeError('option verify must be function'); } // create the appropriate query parser var queryparse = extended ? extendedparser(opts) : simpleparser(opts); // create the appropriate type checking function var shouldParse = typeof type !== 'function' ? typeChecker(type) : type; function parse(body) { return body.length ? queryparse(body) : {}; } return function urlencodedParser(req, res, next) { if (req._body) { debug('body already parsed'); next(); return; } req.body = req.body || {}; // skip requests without bodies if (!typeis.hasBody(req)) { debug('skip empty body'); next(); return; } debug('content-type %j', req.headers['content-type']); // determine if request should be parsed if (!shouldParse(req)) { debug('skip parsing'); next(); return; } // assert charset var charset = getCharset(req) || 'utf-8'; if (charset !== 'utf-8') { debug('invalid charset'); next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { charset: charset, type: 'charset.unsupported' })); return; } // read read(req, res, next, parse, debug, { debug: debug, encoding: charset, inflate: inflate, limit: limit, verify: verify }); }; } /** * Get the extended query parser. * * @param {object} options */ function extendedparser(options) { var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000; var parse = parser('qs'); if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number'); } if (isFinite(parameterLimit)) { parameterLimit = parameterLimit | 0; } return function queryparse(body) { var paramCount = parameterCount(body, parameterLimit); if (paramCount === undefined) { debug('too many parameters'); throw createError(413, 'too many parameters', { type: 'parameters.too.many' }); } var arrayLimit = Math.max(100, paramCount); debug('parse extended urlencoding'); return parse(body, { allowPrototypes: true, arrayLimit: arrayLimit, depth: Infinity, parameterLimit: parameterLimit }); }; } /** * Get the charset of a request. * * @param {object} req * @api private */ function getCharset(req) { try { return (contentType.parse(req).parameters.charset || '').toLowerCase(); } catch (e) { return undefined; } } /** * Count the number of parameters, stopping once limit reached * * @param {string} body * @param {number} limit * @api private */ function parameterCount(body, limit) { var count = 0; var index = 0; while ((index = body.indexOf('&', index)) !== -1) { count++; index++; if (count === limit) { return undefined; } } return count; } /** * Get parser for module name dynamically. * * @param {string} name * @return {function} * @api private */ function parser(name) { var mod = parsers[name]; if (mod !== undefined) { return mod.parse; } // this uses a switch for static require analysis switch (name) { case 'qs': mod = __webpack_require__(/*! qs */ "./node_modules/qs/lib/index.js"); break; case 'querystring': mod = __webpack_require__(/*! querystring */ "querystring"); break; } // store to prevent invoking require() parsers[name] = mod; return mod.parse; } /** * Get the simple query parser. * * @param {object} options */ function simpleparser(options) { var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000; var parse = parser('querystring'); if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number'); } if (isFinite(parameterLimit)) { parameterLimit = parameterLimit | 0; } return function queryparse(body) { var paramCount = parameterCount(body, parameterLimit); if (paramCount === undefined) { debug('too many parameters'); throw createError(413, 'too many parameters', { type: 'parameters.too.many' }); } debug('parse urlencoding'); return parse(body, undefined, undefined, { maxKeys: parameterLimit }); }; } /** * Get the simple type checker. * * @param {string} type * @return {function} */ function typeChecker(type) { return function checkType(req) { return Boolean(typeis(req, type)); }; } /***/ }), /***/ "./node_modules/bytes/index.js": /*!*************************************!*\ !*** ./node_modules/bytes/index.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * bytes * Copyright(c) 2012-2014 TJ Holowaychuk * Copyright(c) 2015 Jed Watson * MIT Licensed */ /** * Module exports. * @public */ module.exports = bytes; module.exports.format = format; module.exports.parse = parse; /** * Module variables. * @private */ var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; var map = { b: 1, kb: 1 << 10, mb: 1 << 20, gb: 1 << 30, tb: (1 << 30) * 1024 }; var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i; /** * Convert the given value in bytes into a string or parse to string to an integer in bytes. * * @param {string|number} value * @param {{ * case: [string], * decimalPlaces: [number] * fixedDecimals: [boolean] * thousandsSeparator: [string] * unitSeparator: [string] * }} [options] bytes options. * * @returns {string|number|null} */ function bytes(value, options) { if (typeof value === 'string') { return parse(value); } if (typeof value === 'number') { return format(value, options); } return null; } /** * Format the given value in bytes into a string. * * If the value is negative, it is kept as such. If it is a float, * it is rounded. * * @param {number} value * @param {object} [options] * @param {number} [options.decimalPlaces=2] * @param {number} [options.fixedDecimals=false] * @param {string} [options.thousandsSeparator=] * @param {string} [options.unit=] * @param {string} [options.unitSeparator=] * * @returns {string|null} * @public */ function format(value, options) { if (!Number.isFinite(value)) { return null; } var mag = Math.abs(value); var thousandsSeparator = options && options.thousandsSeparator || ''; var unitSeparator = options && options.unitSeparator || ''; var decimalPlaces = options && options.decimalPlaces !== undefined ? options.decimalPlaces : 2; var fixedDecimals = Boolean(options && options.fixedDecimals); var unit = options && options.unit || ''; if (!unit || !map[unit.toLowerCase()]) { if (mag >= map.tb) { unit = 'TB'; } else if (mag >= map.gb) { unit = 'GB'; } else if (mag >= map.mb) { unit = 'MB'; } else if (mag >= map.kb) { unit = 'KB'; } else { unit = 'B'; } } var val = value / map[unit.toLowerCase()]; var str = val.toFixed(decimalPlaces); if (!fixedDecimals) { str = str.replace(formatDecimalsRegExp, '$1'); } if (thousandsSeparator) { str = str.replace(formatThousandsRegExp, thousandsSeparator); } return str + unitSeparator + unit; } /** * Parse the string value into an integer in bytes. * * If no unit is given, it is assumed the value is in bytes. * * @param {number|string} val * * @returns {number|null} * @public */ function parse(val) { if (typeof val === 'number' && !isNaN(val)) { return val; } if (typeof val !== 'string') { return null; } // Test if the string passed is valid var results = parseRegExp.exec(val); var floatValue; var unit = 'b'; if (!results) { // Nothing could be extracted from the given string floatValue = parseInt(val, 10); unit = 'b'; } else { // Retrieve the value and the unit floatValue = parseFloat(results[1]); unit = results[4].toLowerCase(); } return Math.floor(map[unit] * floatValue); } /***/ }), /***/ "./node_modules/content-disposition/index.js": /*!***************************************************!*\ !*** ./node_modules/content-disposition/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * content-disposition * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; module.exports = contentDisposition; module.exports.parse = parse; /** * Module dependencies. */ var basename = __webpack_require__(/*! path */ "path").basename; /** * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") */ var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g; // eslint-disable-line no-control-regex /** * RegExp to match percent encoding escape. */ var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/; var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g; /** * RegExp to match non-latin1 characters. */ var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g; /** * RegExp to match quoted-pair in RFC 2616 * * quoted-pair = "\" CHAR * CHAR = <any US-ASCII character (octets 0 - 127)> */ var QESC_REGEXP = /\\([\u0000-\u007f])/g; /** * RegExp to match chars that must be quoted-pair in RFC 2616 */ var QUOTE_REGEXP = /([\\"])/g; /** * RegExp for various RFC 2616 grammar * * parameter = token "=" ( token | quoted-string ) * token = 1*<any CHAR except CTLs or separators> * separators = "(" | ")" | "<" | ">" | "@" * | "," | ";" | ":" | "\" | <"> * | "/" | "[" | "]" | "?" | "=" * | "{" | "}" | SP | HT * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) * qdtext = <any TEXT except <">> * quoted-pair = "\" CHAR * CHAR = <any US-ASCII character (octets 0 - 127)> * TEXT = <any OCTET except CTLs, but including LWS> * LWS = [CRLF] 1*( SP | HT ) * CRLF = CR LF * CR = <US-ASCII CR, carriage return (13)> * LF = <US-ASCII LF, linefeed (10)> * SP = <US-ASCII SP, space (32)> * HT = <US-ASCII HT, horizontal-tab (9)> * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)> * OCTET = <any 8-bit sequence of data> */ var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g; // eslint-disable-line no-control-regex var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/; var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/; /** * RegExp for various RFC 5987 grammar * * ext-value = charset "'" [ language ] "'" value-chars * charset = "UTF-8" / "ISO-8859-1" / mime-charset * mime-charset = 1*mime-charsetc * mime-charsetc = ALPHA / DIGIT * / "!" / "#" / "$" / "%" / "&" * / "+" / "-" / "^" / "_" / "`" * / "{" / "}" / "~" * language = ( 2*3ALPHA [ extlang ] ) * / 4ALPHA * / 5*8ALPHA * extlang = *3( "-" 3ALPHA ) * value-chars = *( pct-encoded / attr-char ) * pct-encoded = "%" HEXDIG HEXDIG * attr-char = ALPHA / DIGIT * / "!" / "#" / "$" / "&" / "+" / "-" / "." * / "^" / "_" / "`" / "|" / "~" */ var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/; /** * RegExp for various RFC 6266 grammar * * disposition-type = "inline" | "attachment" | disp-ext-type * disp-ext-type = token * disposition-parm = filename-parm | disp-ext-parm * filename-parm = "filename" "=" value * | "filename*" "=" ext-value * disp-ext-parm = token "=" value * | ext-token "=" ext-value * ext-token = <the characters in token, followed by "*"> */ var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/; // eslint-disable-line no-control-regex /** * Create an attachment Content-Disposition header. * * @param {string} [filename] * @param {object} [options] * @param {string} [options.type=attachment] * @param {string|boolean} [options.fallback=true] * @return {string} * @api public */ function contentDisposition(filename, options) { var opts = options || {}; // get type var type = opts.type || 'attachment'; // get parameters var params = createparams(filename, opts.fallback); // format into string return format(new ContentDisposition(type, params)); } /** * Create parameters object from filename and fallback. * * @param {string} [filename] * @param {string|boolean} [fallback=true] * @return {object} * @api private */ function createparams(filename, fallback) { if (filename === undefined) { return; } var params = {}; if (typeof filename !== 'string') { throw new TypeError('filename must be a string'); } // fallback defaults to true if (fallback === undefined) { fallback = true; } if (typeof fallback !== 'string' && typeof fallback !== 'boolean') { throw new TypeError('fallback must be a string or boolean'); } if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) { throw new TypeError('fallback must be ISO-8859-1 string'); } // restrict to file base name var name = basename(filename); // determine if name is suitable for quoted string var isQuotedString = TEXT_REGEXP.test(name); // generate fallback name var fallbackName = typeof fallback !== 'string' ? fallback && getlatin1(name) : basename(fallback); var hasFallback = typeof fallbackName === 'string' && fallbackName !== name; // set extended filename parameter if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) { params['filename*'] = name; } // set filename parameter if (isQuotedString || hasFallback) { params.filename = hasFallback ? fallbackName : name; } return params; } /** * Format object to Content-Disposition header. * * @param {object} obj * @param {string} obj.type * @param {object} [obj.parameters] * @return {string} * @api private */ function format(obj) { var parameters = obj.parameters; var type = obj.type; if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) { throw new TypeError('invalid type'); } // start with normalized type var string = String(type).toLowerCase(); // append parameters if (parameters && (typeof parameters === 'undefined' ? 'undefined' : _typeof(parameters)) === 'object') { var param; var params = Object.keys(parameters).sort(); for (var i = 0; i < params.length; i++) { param = params[i]; var val = param.substr(-1) === '*' ? ustring(parameters[param]) : qstring(parameters[param]); string += '; ' + param + '=' + val; } } return string; } /** * Decode a RFC 6987 field value (gracefully). * * @param {string} str * @return {string} * @api private */ function decodefield(str) { var match = EXT_VALUE_REGEXP.exec(str); if (!match) { throw new TypeError('invalid extended field value'); } var charset = match[1].toLowerCase(); var encoded = match[2]; var value; // to binary string var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode); switch (charset) { case 'iso-8859-1': value = getlatin1(binary); break; case 'utf-8': value = new Buffer(binary, 'binary').toString('utf8'); break; default: throw new TypeError('unsupported charset in extended field'); } return value; } /** * Get ISO-8859-1 version of string. * * @param {string} val * @return {string} * @api private */ function getlatin1(val) { // simple Unicode -> ISO-8859-1 transformation return String(val).replace(NON_LATIN1_REGEXP, '?'); } /** * Parse Content-Disposition header string. * * @param {string} string * @return {object} * @api private */ function parse(string) { if (!string || typeof string !== 'string') { throw new TypeError('argument string is required'); } var match = DISPOSITION_TYPE_REGEXP.exec(string); if (!match) { throw new TypeError('invalid type format'); } // normalize type var index = match[0].length; var type = match[1].toLowerCase(); var key; var names = []; var params = {}; var value; // calculate index to start at index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';' ? index - 1 : index; // match parameters while (match = PARAM_REGEXP.exec(string)) { if (match.index !== index) { throw new TypeError('invalid parameter format'); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (names.indexOf(key) !== -1) { throw new TypeError('invalid duplicate parameter'); } names.push(key); if (key.indexOf('*') + 1 === key.length) { // decode extended value key = key.slice(0, -1); value = decodefield(value); // overwrite existing value params[key] = value; continue; } if (typeof params[key] === 'string') { continue; } if (value[0] === '"') { // remove quotes and escapes value = value.substr(1, value.length - 2).replace(QESC_REGEXP, '$1'); } params[key] = value; } if (index !== -1 && index !== string.length) { throw new TypeError('invalid parameter format'); } return new ContentDisposition(type, params); } /** * Percent decode a single character. * * @param {string} str * @param {string} hex * @return {string} * @api private */ function pdecode(str, hex) { return String.fromCharCode(parseInt(hex, 16)); } /** * Percent encode a single character. * * @param {string} char * @return {string} * @api private */ function pencode(char) { var hex = String(char).charCodeAt(0).toString(16).toUpperCase(); return hex.length === 1 ? '%0' + hex : '%' + hex; } /** * Quote a string for HTTP. * * @param {string} val * @return {string} * @api private */ function qstring(val) { var str = String(val); return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'; } /** * Encode a Unicode string for HTTP (RFC 5987). * * @param {string} val * @return {string} * @api private */ function ustring(val) { var str = String(val); // percent encode as UTF-8 var encoded = encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode); return 'UTF-8\'\'' + encoded; } /** * Class for parsed Content-Disposition header for v8 optimization */ function ContentDisposition(type, parameters) { this.type = type; this.parameters = parameters; } /***/ }), /***/ "./node_modules/content-type/index.js": /*!********************************************!*\ !*** ./node_modules/content-type/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * content-type * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 * * parameter = token "=" ( token / quoted-string ) * token = 1*tchar * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" * / DIGIT / ALPHA * ; any VCHAR, except delimiters * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text * obs-text = %x80-FF * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g; var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/; var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; /** * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 * * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) * obs-text = %x80-FF */ var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g; /** * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6 */ var QUOTE_REGEXP = /([\\"])/g; /** * RegExp to match type in RFC 7231 sec 3.1.1.1 * * media-type = type "/" subtype * type = token * subtype = token */ var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; /** * Module exports. * @public */ exports.format = format; exports.parse = parse; /** * Format object to media type. * * @param {object} obj * @return {string} * @public */ function format(obj) { if (!obj || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') { throw new TypeError('argument obj is required'); } var parameters = obj.parameters; var type = obj.type; if (!type || !TYPE_REGEXP.test(type)) { throw new TypeError('invalid type'); } var string = type; // append parameters if (parameters && (typeof parameters === 'undefined' ? 'undefined' : _typeof(parameters)) === 'object') { var param; var params = Object.keys(parameters).sort(); for (var i = 0; i < params.length; i++) { param = params[i]; if (!TOKEN_REGEXP.test(param)) { throw new TypeError('invalid parameter name'); } string += '; ' + param + '=' + qstring(parameters[param]); } } return string; } /** * Parse media type to object. * * @param {string|object} string * @return {Object} * @public */ function parse(string) { if (!string) { throw new TypeError('argument string is required'); } // support req/res-like objects as argument var header = (typeof string === 'undefined' ? 'undefined' : _typeof(string)) === 'object' ? getcontenttype(string) : string; if (typeof header !== 'string') { throw new TypeError('argument string is required to be a string'); } var index = header.indexOf(';'); var type = index !== -1 ? header.substr(0, index).trim() : header.trim(); if (!TYPE_REGEXP.test(type)) { throw new TypeError('invalid media type'); } var obj = new ContentType(type.toLowerCase()); // parse parameters if (index !== -1) { var key; var match; var value; PARAM_REGEXP.lastIndex = index; while (match = PARAM_REGEXP.exec(header)) { if (match.index !== index) { throw new TypeError('invalid parameter format'); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value[0] === '"') { // remove quotes and escapes value = value.substr(1, value.length - 2).replace(QESC_REGEXP, '$1'); } obj.parameters[key] = value; } if (index !== header.length) { throw new TypeError('invalid parameter format'); } } return obj; } /** * Get content-type from req/res objects. * * @param {object} * @return {Object} * @private */ function getcontenttype(obj) { var header; if (typeof obj.getHeader === 'function') { // res-like header = obj.getHeader('content-type'); } else if (_typeof(obj.headers) === 'object') { // req-like header = obj.headers && obj.headers['content-type']; } if (typeof header !== 'string') { throw new TypeError('content-type header is missing from object'); } return header; } /** * Quote a string if necessary. * * @param {string} val * @return {string} * @private */ function qstring(val) { var str = String(val); // no need to quote tokens if (TOKEN_REGEXP.test(str)) { return str; } if (str.length > 0 && !TEXT_REGEXP.test(str)) { throw new TypeError('invalid parameter value'); } return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'; } /** * Class to represent a content type. * @private */ function ContentType(type) { this.parameters = Object.create(null); this.type = type; } /***/ }), /***/ "./node_modules/cookie-signature/index.js": /*!************************************************!*\ !*** ./node_modules/cookie-signature/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies. */ var crypto = __webpack_require__(/*! crypto */ "crypto"); /** * Sign the given `val` with `secret`. * * @param {String} val * @param {String} secret * @return {String} * @api private */ exports.sign = function (val, secret) { if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); return val + '.' + crypto.createHmac('sha256', secret).update(val).digest('base64').replace(/\=+$/, ''); }; /** * Unsign and decode the given `val` with `secret`, * returning `false` if the signature is invalid. * * @param {String} val * @param {String} secret * @return {String|Boolean} * @api private */ exports.unsign = function (val, secret) { if ('string' != typeof val) throw new TypeError("Signed cookie string must be provided."); if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); var str = val.slice(0, val.lastIndexOf('.')), mac = exports.sign(str, secret); return sha1(mac) == sha1(val) ? str : false; }; /** * Private */ function sha1(str) { return crypto.createHash('sha1').update(str).digest('hex'); } /***/ }), /***/ "./node_modules/cookie/index.js": /*!**************************************!*\ !*** ./node_modules/cookie/index.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ exports.parse = parse; exports.serialize = serialize; /** * Module variables. * @private */ var decode = decodeURIComponent; var encode = encodeURIComponent; var pairSplitRegExp = /; */; /** * RegExp to match field-content in RFC 7230 sec 3.2 * * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] * field-vchar = VCHAR / obs-text * obs-text = %x80-FF */ var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; /** * Parse a cookie header. * * Parse the given cookie header string into an object * The object has the various cookies as keys(names) => values * * @param {string} str * @param {object} [options] * @return {object} * @public */ function parse(str, options) { if (typeof str !== 'string') { throw new TypeError('argument str must be a string'); } var obj = {}; var opt = options || {}; var pairs = str.split(pairSplitRegExp); var dec = opt.decode || decode; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i]; var eq_idx = pair.indexOf('='); // skip things that don't look like key=value if (eq_idx < 0) { continue; } var key = pair.substr(0, eq_idx).trim(); var val = pair.substr(++eq_idx, pair.length).trim(); // quoted values if ('"' == val[0]) { val = val.slice(1, -1); } // only assign once if (undefined == obj[key]) { obj[key] = tryDecode(val, dec); } } return obj; } /** * Serialize data into a cookie header. * * Serialize the a name value pair into a cookie string suitable for * http headers. An optional options object specified cookie parameters. * * serialize('foo', 'bar', { httpOnly: true }) * => "foo=bar; httpOnly" * * @param {string} name * @param {string} val * @param {object} [options] * @return {string} * @public */ function serialize(name, val, options) { var opt = options || {}; var enc = opt.encode || encode; if (typeof enc !== 'function') { throw new TypeError('option encode is invalid'); } if (!fieldContentRegExp.test(name)) { throw new TypeError('argument name is invalid'); } var value = enc(val); if (value && !fieldContentRegExp.test(value)) { throw new TypeError('argument val is invalid'); } var str = name + '=' + value; if (null != opt.maxAge) { var maxAge = opt.maxAge - 0; if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); str += '; Max-Age=' + Math.floor(maxAge); } if (opt.domain) { if (!fieldContentRegExp.test(opt.domain)) { throw new TypeError('option domain is invalid'); } str += '; Domain=' + opt.domain; } if (opt.path) { if (!fieldContentRegExp.test(opt.path)) { throw new TypeError('option path is invalid'); } str += '; Path=' + opt.path; } if (opt.expires) { if (typeof opt.expires.toUTCString !== 'function') { throw new TypeError('option expires is invalid'); } str += '; Expires=' + opt.expires.toUTCString(); } if (opt.httpOnly) { str += '; HttpOnly'; } if (opt.secure) { str += '; Secure'; } if (opt.sameSite) { var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite; switch (sameSite) { case true: str += '; SameSite=Strict'; break; case 'lax': str += '; SameSite=Lax'; break; case 'strict': str += '; SameSite=Strict'; break; default: throw new TypeError('option sameSite is invalid'); } } return str; } /** * Try decoding a string using a decoding function. * * @param {string} str * @param {function} decode * @private */ function tryDecode(str, decode) { try { return decode(str); } catch (e) { return str; } } /***/ }), /***/ "./node_modules/debug/src/browser.js": /*!*******************************************!*\ !*** ./node_modules/debug/src/browser.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** * This is the web browser implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/debug/src/debug.js"); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); /** * Colors. */ exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ exports.formatters.j = function (v) { try { return JSON.stringify(v); } catch (err) { return '[UnexpectedJSONParseError]: ' + err.message; } }; /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // the final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if ('%%' === match) return; index++; if ('%c' === match) { // we only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (null == namespaces) { exports.storage.removeItem('debug'); } else { exports.storage.debug = namespaces; } } catch (e) {} } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.debug; } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Enable namespaces listed in `localStorage.debug` initially. */ exports.enable(load()); /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { return window.localStorage; } catch (e) {} } /***/ }), /***/ "./node_modules/debug/src/debug.js": /*!*****************************************!*\ !*** ./node_modules/debug/src/debug.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; exports.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js"); /** * The currently active debug mode names, and names to skip. */ exports.names = []; exports.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ exports.formatters = {}; /** * Previous log timestamp. */ var prevTime; /** * Select a color. * @param {String} namespace * @return {Number} * @api private */ function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return exports.colors[Math.abs(hash) % exports.colors.length]; } /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { function debug() { // disabled? if (!debug.enabled) return; var self = debug; // set `diff` timestamp var curr = +new Date(); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; // turn the `arguments` into a proper Array var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports.coerce(args[0]); if ('string' !== typeof args[0]) { // anything else let's inspect with %O args.unshift('%O'); } // apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // if we encounter an escaped % then don't increase the array index if (match === '%%') return match; index++; var formatter = exports.formatters[format]; if ('function' === typeof formatter) { var val = args[index]; match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // apply env-specific formatting (colors, etc.) exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } return debug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { exports.save(namespaces); exports.names = []; exports.skips = []; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { exports.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @api public */ function disable() { exports.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { return false; } } for (i = 0, len = exports.names.length; i < len; i++) { if (exports.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } /***/ }), /***/ "./node_modules/debug/src/index.js": /*!*****************************************!*\ !*** ./node_modules/debug/src/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Detect Electron renderer process, which is node, but we should * treat as a browser. */ if (typeof process !== 'undefined' && process.type === 'renderer') { module.exports = __webpack_require__(/*! ./browser.js */ "./node_modules/debug/src/browser.js"); } else { module.exports = __webpack_require__(/*! ./node.js */ "./node_modules/debug/src/node.js"); } /***/ }), /***/ "./node_modules/debug/src/node.js": /*!****************************************!*\ !*** ./node_modules/debug/src/node.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies. */ var tty = __webpack_require__(/*! tty */ "tty"); var util = __webpack_require__(/*! util */ "util"); /** * This is the Node.js implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/debug/src/debug.js"); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(function (key) { return (/^debug_/i.test(key) ); }).reduce(function (obj, key) { // camel-case var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { return k.toUpperCase(); }); // coerce string value into JS value var val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) val = true;else if (/^(no|off|false|disabled)$/i.test(val)) val = false;else if (val === 'null') val = null;else val = Number(val); obj[prop] = val; return obj; }, {}); /** * The file descriptor to write the `debug()` calls to. * Set the `DEBUG_FD` env variable to override with another value. i.e.: * * $ DEBUG_FD=3 node script.js 3>debug.log */ var fd = parseInt(process.env.DEBUG_FD, 10) || 2; if (1 !== fd && 2 !== fd) { util.deprecate(function () {}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')(); } var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd); } /** * Map %o to `util.inspect()`, all on a single line. */ exports.formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts).split('\n').map(function (str) { return str.trim(); }).join(' '); }; /** * Map %o to `util.inspect()`, allowing multiple lines if needed. */ exports.formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { var name = this.namespace; var useColors = this.useColors; if (useColors) { var c = this.color; var prefix = ' \x1B[3' + c + ';1m' + name + ' ' + '\x1B[0m'; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push('\x1B[3' + c + 'm+' + exports.humanize(this.diff) + '\x1B[0m'); } else { args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0]; } } /** * Invokes `util.format()` with the specified arguments and writes to `stream`. */ function log() { return stream.write(util.format.apply(util, arguments) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (null == namespaces) { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } else { process.env.DEBUG = namespaces; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Copied from `node/src/node.js`. * * XXX: It's lame that node doesn't expose this API out-of-the-box. It also * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. */ function createWritableStdioStream(fd) { var stream; var tty_wrap = process.binding('tty_wrap'); // Note stream._type is used for test-module-load-list.js switch (tty_wrap.guessHandleType(fd)) { case 'TTY': stream = new tty.WriteStream(fd); stream._type = 'tty'; // Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; case 'FILE': var fs = __webpack_require__(/*! fs */ "fs"); stream = new fs.SyncWriteStream(fd, { autoClose: false }); stream._type = 'fs'; break; case 'PIPE': case 'TCP': var net = __webpack_require__(/*! net */ "net"); stream = new net.Socket({ fd: fd, readable: false, writable: true }); // FIXME Should probably have an option in net.Socket to create a // stream from an existing fd which is writable only. But for now // we'll just add this hack and set the `readable` member to false. // Test: ./node test/fixtures/echo.js < /etc/passwd stream.readable = false; stream.read = null; stream._type = 'pipe'; // FIXME Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; default: // Probably an error on in uv_guess_handle() throw new Error('Implement me. Unknown stream file type!'); } // For supporting legacy API we put the FD here. stream.fd = fd; stream._isStdio = true; return stream; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; var keys = Object.keys(exports.inspectOpts); for (var i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } /** * Enable namespaces listed in `process.env.DEBUG` initially. */ exports.enable(load()); /***/ }), /***/ "./node_modules/depd/index.js": /*!************************************!*\ !*** ./node_modules/depd/index.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! * depd * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var callSiteToString = __webpack_require__(/*! ./lib/compat */ "./node_modules/depd/lib/compat/index.js").callSiteToString; var eventListenerCount = __webpack_require__(/*! ./lib/compat */ "./node_modules/depd/lib/compat/index.js").eventListenerCount; var relative = __webpack_require__(/*! path */ "path").relative; /** * Module exports. */ module.exports = depd; /** * Get the path to base files on. */ var basePath = process.cwd(); /** * Determine if namespace is contained in the string. */ function containsNamespace(str, namespace) { var vals = str.split(/[ ,]+/); var ns = String(namespace).toLowerCase(); for (var i = 0; i < vals.length; i++) { var val = vals[i]; // namespace contained if (val && (val === '*' || val.toLowerCase() === ns)) { return true; } } return false; } /** * Convert a data descriptor to accessor descriptor. */ function convertDataDescriptorToAccessor(obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop); var value = descriptor.value; descriptor.get = function getter() { return value; }; if (descriptor.writable) { descriptor.set = function setter(val) { return value = val; }; } delete descriptor.value; delete descriptor.writable; Object.defineProperty(obj, prop, descriptor); return descriptor; } /** * Create arguments string to keep arity. */ function createArgumentsString(arity) { var str = ''; for (var i = 0; i < arity; i++) { str += ', arg' + i; } return str.substr(2); } /** * Create stack string from stack. */ function createStackString(stack) { var str = this.name + ': ' + this.namespace; if (this.message) { str += ' deprecated ' + this.message; } for (var i = 0; i < stack.length; i++) { str += '\n at ' + callSiteToString(stack[i]); } return str; } /** * Create deprecate for namespace in caller. */ function depd(namespace) { if (!namespace) { throw new TypeError('argument namespace is required'); } var stack = getStack(); var site = callSiteLocation(stack[1]); var file = site[0]; function deprecate(message) { // call to self as log log.call(deprecate, message); } deprecate._file = file; deprecate._ignored = isignored(namespace); deprecate._namespace = namespace; deprecate._traced = istraced(namespace); deprecate._warned = Object.create(null); deprecate.function = wrapfunction; deprecate.property = wrapproperty; return deprecate; } /** * Determine if namespace is ignored. */ function isignored(namespace) { /* istanbul ignore next: tested in a child processs */ if (process.noDeprecation) { // --no-deprecation support return true; } var str = process.env.NO_DEPRECATION || ''; // namespace ignored return containsNamespace(str, namespace); } /** * Determine if namespace is traced. */ function istraced(namespace) { /* istanbul ignore next: tested in a child processs */ if (process.traceDeprecation) { // --trace-deprecation support return true; } var str = process.env.TRACE_DEPRECATION || ''; // namespace traced return containsNamespace(str, namespace); } /** * Display deprecation message. */ function log(message, site) { var haslisteners = eventListenerCount(process, 'deprecation') !== 0; // abort early if no destination if (!haslisteners && this._ignored) { return; } var caller; var callFile; var callSite; var depSite; var i = 0; var seen = false; var stack = getStack(); var file = this._file; if (site) { // provided site depSite = site; callSite = callSiteLocation(stack[1]); callSite.name = depSite.name; file = callSite[0]; } else { // get call site i = 2; depSite = callSiteLocation(stack[i]); callSite = depSite; } // get caller of deprecated thing in relation to file for (; i < stack.length; i++) { caller = callSiteLocation(stack[i]); callFile = caller[0]; if (callFile === file) { seen = true; } else if (callFile === this._file) { file = this._file; } else if (seen) { break; } } var key = caller ? depSite.join(':') + '__' + caller.join(':') : undefined; if (key !== undefined && key in this._warned) { // already warned return; } this._warned[key] = true; // generate automatic message from call site var msg = message; if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite); } // emit deprecation if listeners exist if (haslisteners) { var err = DeprecationError(this._namespace, msg, stack.slice(i)); process.emit('deprecation', err); return; } // format and write message var format = process.stderr.isTTY ? formatColor : formatPlain; var output = format.call(this, msg, caller, stack.slice(i)); process.stderr.write(output + '\n', 'utf8'); } /** * Get call site location as array. */ function callSiteLocation(callSite) { var file = callSite.getFileName() || '<anonymous>'; var line = callSite.getLineNumber(); var colm = callSite.getColumnNumber(); if (callSite.isEval()) { file = callSite.getEvalOrigin() + ', ' + file; } var site = [file, line, colm]; site.callSite = callSite; site.name = callSite.getFunctionName(); return site; } /** * Generate a default message from the site. */ function defaultMessage(site) { var callSite = site.callSite; var funcName = site.name; // make useful anonymous name if (!funcName) { funcName = '<anonymous@' + formatLocation(site) + '>'; } var context = callSite.getThis(); var typeName = context && callSite.getTypeName(); // ignore useless type name if (typeName === 'Object') { typeName = undefined; } // make useful type name if (typeName === 'Function') { typeName = context.name || typeName; } return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName; } /** * Format deprecation message without color. */ function formatPlain(msg, caller, stack) { var timestamp = new Date().toUTCString(); var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg; // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n at ' + callSiteToString(stack[i]); } return formatted; } if (caller) { formatted += ' at ' + formatLocation(caller); } return formatted; } /** * Format deprecation message with color. */ function formatColor(msg, caller, stack) { var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow ' \x1b[0m' + msg + '\x1b[39m'; // reset // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m'; // cyan } return formatted; } if (caller) { formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m'; // cyan } return formatted; } /** * Format call site location. */ function formatLocation(callSite) { return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2]; } /** * Get the stack as array of call sites. */ function getStack() { var limit = Error.stackTraceLimit; var obj = {}; var prep = Error.prepareStackTrace; Error.prepareStackTrace = prepareObjectStackTrace; Error.stackTraceLimit = Math.max(10, limit); // capture the stack Error.captureStackTrace(obj); // slice this function off the top var stack = obj.stack.slice(1); Error.prepareStackTrace = prep; Error.stackTraceLimit = limit; return stack; } /** * Capture call site stack from v8. */ function prepareObjectStackTrace(obj, stack) { return stack; } /** * Return a wrapped function in a deprecation message. */ function wrapfunction(fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function'); } var args = createArgumentsString(fn.length); var deprecate = this; // eslint-disable-line no-unused-vars var stack = getStack(); var site = callSiteLocation(stack[1]); site.name = fn.name; // eslint-disable-next-line no-eval var deprecatedfn = eval('(function (' + args + ') {\n' + '"use strict"\n' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '})'); return deprecatedfn; } /** * Wrap property in a deprecation message. */ function wrapproperty(obj, prop, message) { if (!obj || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && typeof obj !== 'function') { throw new TypeError('argument obj must be object'); } var descriptor = Object.getOwnPropertyDescriptor(obj, prop); if (!descriptor) { throw new TypeError('must call property on owner object'); } if (!descriptor.configurable) { throw new TypeError('property must be configurable'); } var deprecate = this; var stack = getStack(); var site = callSiteLocation(stack[1]); // set site name site.name = prop; // convert data descriptor if ('value' in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message); } var get = descriptor.get; var set = descriptor.set; // wrap getter if (typeof get === 'function') { descriptor.get = function getter() { log.call(deprecate, message, site); return get.apply(this, arguments); }; } // wrap setter if (typeof set === 'function') { descriptor.set = function setter() { log.call(deprecate, message, site); return set.apply(this, arguments); }; } Object.defineProperty(obj, prop, descriptor); } /** * Create DeprecationError for deprecation */ function DeprecationError(namespace, message, stack) { var error = new Error(); var stackString; Object.defineProperty(error, 'constructor', { value: DeprecationError }); Object.defineProperty(error, 'message', { configurable: true, enumerable: false, value: message, writable: true }); Object.defineProperty(error, 'name', { enumerable: false, configurable: true, value: 'DeprecationError', writable: true }); Object.defineProperty(error, 'namespace', { configurable: true, enumerable: false, value: namespace, writable: true }); Object.defineProperty(error, 'stack', { configurable: true, enumerable: false, get: function get() { if (stackString !== undefined) { return stackString; } // prepare stack trace return stackString = createStackString.call(this, stack); }, set: function setter(val) { stackString = val; } }); return error; } /***/ }), /***/ "./node_modules/depd/lib/compat/callsite-tostring.js": /*!***********************************************************!*\ !*** ./node_modules/depd/lib/compat/callsite-tostring.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. */ module.exports = callSiteToString; /** * Format a CallSite file location to a string. */ function callSiteFileLocation(callSite) { var fileName; var fileLocation = ''; if (callSite.isNative()) { fileLocation = 'native'; } else if (callSite.isEval()) { fileName = callSite.getScriptNameOrSourceURL(); if (!fileName) { fileLocation = callSite.getEvalOrigin(); } } else { fileName = callSite.getFileName(); } if (fileName) { fileLocation += fileName; var lineNumber = callSite.getLineNumber(); if (lineNumber != null) { fileLocation += ':' + lineNumber; var columnNumber = callSite.getColumnNumber(); if (columnNumber) { fileLocation += ':' + columnNumber; } } } return fileLocation || 'unknown source'; } /** * Format a CallSite to a string. */ function callSiteToString(callSite) { var addSuffix = true; var fileLocation = callSiteFileLocation(callSite); var functionName = callSite.getFunctionName(); var isConstructor = callSite.isConstructor(); var isMethodCall = !(callSite.isToplevel() || isConstructor); var line = ''; if (isMethodCall) { var methodName = callSite.getMethodName(); var typeName = getConstructorName(callSite); if (functionName) { if (typeName && functionName.indexOf(typeName) !== 0) { line += typeName + '.'; } line += functionName; if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { line += ' [as ' + methodName + ']'; } } else { line += typeName + '.' + (methodName || '<anonymous>'); } } else if (isConstructor) { line += 'new ' + (functionName || '<anonymous>'); } else if (functionName) { line += functionName; } else { addSuffix = false; line += fileLocation; } if (addSuffix) { line += ' (' + fileLocation + ')'; } return line; } /** * Get constructor name of reviver. */ function getConstructorName(obj) { var receiver = obj.receiver; return receiver.constructor && receiver.constructor.name || null; } /***/ }), /***/ "./node_modules/depd/lib/compat/event-listener-count.js": /*!**************************************************************!*\ !*** ./node_modules/depd/lib/compat/event-listener-count.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = eventListenerCount; /** * Get the count of listeners on an event emitter of a specific type. */ function eventListenerCount(emitter, type) { return emitter.listeners(type).length; } /***/ }), /***/ "./node_modules/depd/lib/compat/index.js": /*!***********************************************!*\ !*** ./node_modules/depd/lib/compat/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var EventEmitter = __webpack_require__(/*! events */ "events").EventEmitter; /** * Module exports. * @public */ lazyProperty(module.exports, 'callSiteToString', function callSiteToString() { var limit = Error.stackTraceLimit; var obj = {}; var prep = Error.prepareStackTrace; function prepareObjectStackTrace(obj, stack) { return stack; } Error.prepareStackTrace = prepareObjectStackTrace; Error.stackTraceLimit = 2; // capture the stack Error.captureStackTrace(obj); // slice the stack var stack = obj.stack.slice(); Error.prepareStackTrace = prep; Error.stackTraceLimit = limit; return stack[0].toString ? toString : __webpack_require__(/*! ./callsite-tostring */ "./node_modules/depd/lib/compat/callsite-tostring.js"); }); lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount() { return EventEmitter.listenerCount || __webpack_require__(/*! ./event-listener-count */ "./node_modules/depd/lib/compat/event-listener-count.js"); }); /** * Define a lazy property. */ function lazyProperty(obj, prop, getter) { function get() { var val = getter(); Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: val }); return val; } Object.defineProperty(obj, prop, { configurable: true, enumerable: true, get: get }); } /** * Call toString() on the obj */ function toString(obj) { return obj.toString(); } /***/ }), /***/ "./node_modules/destroy/index.js": /*!***************************************!*\ !*** ./node_modules/destroy/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * destroy * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module dependencies. * @private */ var ReadStream = __webpack_require__(/*! fs */ "fs").ReadStream; var Stream = __webpack_require__(/*! stream */ "stream"); /** * Module exports. * @public */ module.exports = destroy; /** * Destroy a stream. * * @param {object} stream * @public */ function destroy(stream) { if (stream instanceof ReadStream) { return destroyReadStream(stream); } if (!(stream instanceof Stream)) { return stream; } if (typeof stream.destroy === 'function') { stream.destroy(); } return stream; } /** * Destroy a ReadStream. * * @param {object} stream * @private */ function destroyReadStream(stream) { stream.destroy(); if (typeof stream.close === 'function') { // node.js core bug work-around stream.on('open', onOpenClose); } return stream; } /** * On open handler to close stream. * @private */ function onOpenClose() { if (typeof this.fd === 'number') { // actually close down the fd this.close(); } } /***/ }), /***/ "./node_modules/ee-first/index.js": /*!****************************************!*\ !*** ./node_modules/ee-first/index.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * ee-first * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. * @public */ module.exports = first; /** * Get the first event in a set of event emitters and event pairs. * * @param {array} stuff * @param {function} done * @public */ function first(stuff, done) { if (!Array.isArray(stuff)) throw new TypeError('arg must be an array of [ee, events...] arrays'); var cleanups = []; for (var i = 0; i < stuff.length; i++) { var arr = stuff[i]; if (!Array.isArray(arr) || arr.length < 2) throw new TypeError('each array member must be [ee, events...]'); var ee = arr[0]; for (var j = 1; j < arr.length; j++) { var event = arr[j]; var fn = listener(event, callback); // listen to the event ee.on(event, fn); // push this listener to the list of cleanups cleanups.push({ ee: ee, event: event, fn: fn }); } } function callback() { cleanup(); done.apply(null, arguments); } function cleanup() { var x; for (var i = 0; i < cleanups.length; i++) { x = cleanups[i]; x.ee.removeListener(x.event, x.fn); } } function thunk(fn) { done = fn; } thunk.cancel = cleanup; return thunk; } /** * Create the event listener. * @private */ function listener(event, done) { return function onevent(arg1) { var args = new Array(arguments.length); var ee = this; var err = event === 'error' ? arg1 : null; // copy args to prevent arguments escaping scope for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } done(err, ee, event, args); }; } /***/ }), /***/ "./node_modules/encodeurl/index.js": /*!*****************************************!*\ !*** ./node_modules/encodeurl/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * encodeurl * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = encodeUrl; /** * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") * and including invalid escape sequences. * @private */ var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g; /** * RegExp to match unmatched surrogate pair. * @private */ var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g; /** * String to replace unmatched surrogate pair with. * @private */ var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2'; /** * Encode a URL to a percent-encoded form, excluding already-encoded sequences. * * This function will take an already-encoded URL and encode all the non-URL * code points. This function will not encode the "%" character unless it is * not part of a valid sequence (`%20` will be left as-is, but `%foo` will * be encoded as `%25foo`). * * This encode is meant to be "safe" and does not throw errors. It will try as * hard as it can to properly encode the given URL, including replacing any raw, * unpaired surrogate pairs with the Unicode replacement character prior to * encoding. * * @param {string} url * @return {string} * @public */ function encodeUrl(url) { return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE).replace(ENCODE_CHARS_REGEXP, encodeURI); } /***/ }), /***/ "./node_modules/escape-html/index.js": /*!*******************************************!*\ !*** ./node_modules/escape-html/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed */ /** * Module variables. * @private */ var matchHtmlRegExp = /["'&<>]/; /** * Module exports. * @public */ module.exports = escapeHtml; /** * Escape special characters in the given string of html. * * @param {string} string The string to escape for inserting into HTML * @return {string} * @public */ function escapeHtml(string) { var str = '' + string; var match = matchHtmlRegExp.exec(str); if (!match) { return str; } var escape; var html = ''; var index = 0; var lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: // " escape = '&quot;'; break; case 38: // & escape = '&amp;'; break; case 39: // ' escape = '&#39;'; break; case 60: // < escape = '&lt;'; break; case 62: // > escape = '&gt;'; break; default: continue; } if (lastIndex !== index) { html += str.substring(lastIndex, index); } lastIndex = index + 1; html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; } /***/ }), /***/ "./node_modules/etag/index.js": /*!************************************!*\ !*** ./node_modules/etag/index.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * etag * Copyright(c) 2014-2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; module.exports = etag; /** * Module dependencies. * @private */ var crypto = __webpack_require__(/*! crypto */ "crypto"); var Stats = __webpack_require__(/*! fs */ "fs").Stats; /** * Module variables. * @private */ var toString = Object.prototype.toString; /** * Generate an entity tag. * * @param {Buffer|string} entity * @return {string} * @private */ function entitytag(entity) { if (entity.length === 0) { // fast-path empty return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"'; } // compute hash of entity var hash = crypto.createHash('sha1').update(entity, 'utf8').digest('base64').substring(0, 27); // compute length of entity var len = typeof entity === 'string' ? Buffer.byteLength(entity, 'utf8') : entity.length; return '"' + len.toString(16) + '-' + hash + '"'; } /** * Create a simple ETag. * * @param {string|Buffer|Stats} entity * @param {object} [options] * @param {boolean} [options.weak] * @return {String} * @public */ function etag(entity, options) { if (entity == null) { throw new TypeError('argument entity is required'); } // support fs.Stats object var isStats = isstats(entity); var weak = options && typeof options.weak === 'boolean' ? options.weak : isStats; // validate argument if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { throw new TypeError('argument entity must be string, Buffer, or fs.Stats'); } // generate entity tag var tag = isStats ? stattag(entity) : entitytag(entity); return weak ? 'W/' + tag : tag; } /** * Determine if object is a Stats object. * * @param {object} obj * @return {boolean} * @api private */ function isstats(obj) { // genuine fs.Stats if (typeof Stats === 'function' && obj instanceof Stats) { return true; } // quack quack return obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && 'ino' in obj && typeof obj.ino === 'number' && 'size' in obj && typeof obj.size === 'number'; } /** * Generate a tag for a stat. * * @param {object} stat * @return {string} * @private */ function stattag(stat) { var mtime = stat.mtime.getTime().toString(16); var size = stat.size.toString(16); return '"' + size + '-' + mtime + '"'; } /***/ }), /***/ "./node_modules/express/index.js": /*!***************************************!*\ !*** ./node_modules/express/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ module.exports = __webpack_require__(/*! ./lib/express */ "./node_modules/express/lib/express.js"); /***/ }), /***/ "./node_modules/express/lib sync recursive": /*!***************************************!*\ !*** ./node_modules/express/lib sync ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { function webpackEmptyContext(req) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } webpackEmptyContext.keys = function() { return []; }; webpackEmptyContext.resolve = webpackEmptyContext; module.exports = webpackEmptyContext; webpackEmptyContext.id = "./node_modules/express/lib sync recursive"; /***/ }), /***/ "./node_modules/express/lib/application.js": /*!*************************************************!*\ !*** ./node_modules/express/lib/application.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var finalhandler = __webpack_require__(/*! finalhandler */ "./node_modules/finalhandler/index.js"); var Router = __webpack_require__(/*! ./router */ "./node_modules/express/lib/router/index.js"); var methods = __webpack_require__(/*! methods */ "./node_modules/methods/index.js"); var middleware = __webpack_require__(/*! ./middleware/init */ "./node_modules/express/lib/middleware/init.js"); var query = __webpack_require__(/*! ./middleware/query */ "./node_modules/express/lib/middleware/query.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('express:application'); var View = __webpack_require__(/*! ./view */ "./node_modules/express/lib/view.js"); var http = __webpack_require__(/*! http */ "http"); var compileETag = __webpack_require__(/*! ./utils */ "./node_modules/express/lib/utils.js").compileETag; var compileQueryParser = __webpack_require__(/*! ./utils */ "./node_modules/express/lib/utils.js").compileQueryParser; var compileTrust = __webpack_require__(/*! ./utils */ "./node_modules/express/lib/utils.js").compileTrust; var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('express'); var flatten = __webpack_require__(/*! array-flatten */ "./node_modules/array-flatten/array-flatten.js"); var merge = __webpack_require__(/*! utils-merge */ "./node_modules/utils-merge/index.js"); var resolve = __webpack_require__(/*! path */ "path").resolve; var setPrototypeOf = __webpack_require__(/*! setprototypeof */ "./node_modules/setprototypeof/index.js"); var slice = Array.prototype.slice; /** * Application prototype. */ var app = exports = module.exports = {}; /** * Variable for trust proxy inheritance back-compat * @private */ var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default'; /** * Initialize the server. * * - setup default configuration * - setup default middleware * - setup route reflection methods * * @private */ app.init = function init() { this.cache = {}; this.engines = {}; this.settings = {}; this.defaultConfiguration(); }; /** * Initialize application configuration. * @private */ app.defaultConfiguration = function defaultConfiguration() { var env = "development" || 'development'; // default settings this.enable('x-powered-by'); this.set('etag', 'weak'); this.set('env', env); this.set('query parser', 'extended'); this.set('subdomain offset', 2); this.set('trust proxy', false); // trust proxy inherit back-compat Object.defineProperty(this.settings, trustProxyDefaultSymbol, { configurable: true, value: true }); debug('booting in %s mode', env); this.on('mount', function onmount(parent) { // inherit trust proxy if (this.settings[trustProxyDefaultSymbol] === true && typeof parent.settings['trust proxy fn'] === 'function') { delete this.settings['trust proxy']; delete this.settings['trust proxy fn']; } // inherit protos setPrototypeOf(this.request, parent.request); setPrototypeOf(this.response, parent.response); setPrototypeOf(this.engines, parent.engines); setPrototypeOf(this.settings, parent.settings); }); // setup locals this.locals = Object.create(null); // top-most app is mounted at / this.mountpath = '/'; // default locals this.locals.settings = this.settings; // default configuration this.set('view', View); this.set('views', resolve('views')); this.set('jsonp callback name', 'callback'); if (env === 'production') { this.enable('view cache'); } Object.defineProperty(this, 'router', { get: function get() { throw new Error('\'app.router\' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.'); } }); }; /** * lazily adds the base router if it has not yet been added. * * We cannot add the base router in the defaultConfiguration because * it reads app settings which might be set after that has run. * * @private */ app.lazyrouter = function lazyrouter() { if (!this._router) { this._router = new Router({ caseSensitive: this.enabled('case sensitive routing'), strict: this.enabled('strict routing') }); this._router.use(query(this.get('query parser fn'))); this._router.use(middleware.init(this)); } }; /** * Dispatch a req, res pair into the application. Starts pipeline processing. * * If no callback is provided, then default error handlers will respond * in the event of an error bubbling through the stack. * * @private */ app.handle = function handle(req, res, callback) { var router = this._router; // final handler var done = callback || finalhandler(req, res, { env: this.get('env'), onerror: logerror.bind(this) }); // no routes if (!router) { debug('no routes defined on app'); done(); return; } router.handle(req, res, done); }; /** * Proxy `Router#use()` to add middleware to the app router. * See Router#use() documentation for details. * * If the _fn_ parameter is an express app, then it will be * mounted at the _route_ specified. * * @public */ app.use = function use(fn) { var offset = 0; var path = '/'; // default path to '/' // disambiguate app.use([fn]) if (typeof fn !== 'function') { var arg = fn; while (Array.isArray(arg) && arg.length !== 0) { arg = arg[0]; } // first arg is the path if (typeof arg !== 'function') { offset = 1; path = fn; } } var fns = flatten(slice.call(arguments, offset)); if (fns.length === 0) { throw new TypeError('app.use() requires a middleware function'); } // setup router this.lazyrouter(); var router = this._router; fns.forEach(function (fn) { // non-express app if (!fn || !fn.handle || !fn.set) { return router.use(path, fn); } debug('.use app under %s', path); fn.mountpath = path; fn.parent = this; // restore .app property on req and res router.use(path, function mounted_app(req, res, next) { var orig = req.app; fn.handle(req, res, function (err) { setPrototypeOf(req, orig.request); setPrototypeOf(res, orig.response); next(err); }); }); // mounted an app fn.emit('mount', this); }, this); return this; }; /** * Proxy to the app `Router#route()` * Returns a new `Route` instance for the _path_. * * Routes are isolated middleware stacks for specific paths. * See the Route api docs for details. * * @public */ app.route = function route(path) { this.lazyrouter(); return this._router.route(path); }; /** * Register the given template engine callback `fn` * as `ext`. * * By default will `require()` the engine based on the * file extension. For example if you try to render * a "foo.ejs" file Express will invoke the following internally: * * app.engine('ejs', require('ejs').__express); * * For engines that do not provide `.__express` out of the box, * or if you wish to "map" a different extension to the template engine * you may use this method. For example mapping the EJS template engine to * ".html" files: * * app.engine('html', require('ejs').renderFile); * * In this case EJS provides a `.renderFile()` method with * the same signature that Express expects: `(path, options, callback)`, * though note that it aliases this method as `ejs.__express` internally * so if you're using ".ejs" extensions you dont need to do anything. * * Some template engines do not follow this convention, the * [Consolidate.js](https://github.com/tj/consolidate.js) * library was created to map all of node's popular template * engines to follow this convention, thus allowing them to * work seamlessly within Express. * * @param {String} ext * @param {Function} fn * @return {app} for chaining * @public */ app.engine = function engine(ext, fn) { if (typeof fn !== 'function') { throw new Error('callback function required'); } // get file extension var extension = ext[0] !== '.' ? '.' + ext : ext; // store engine this.engines[extension] = fn; return this; }; /** * Proxy to `Router#param()` with one added api feature. The _name_ parameter * can be an array of names. * * See the Router#param() docs for more details. * * @param {String|Array} name * @param {Function} fn * @return {app} for chaining * @public */ app.param = function param(name, fn) { this.lazyrouter(); if (Array.isArray(name)) { for (var i = 0; i < name.length; i++) { this.param(name[i], fn); } return this; } this._router.param(name, fn); return this; }; /** * Assign `setting` to `val`, or return `setting`'s value. * * app.set('foo', 'bar'); * app.set('foo'); * // => "bar" * * Mounted servers inherit their parent server's settings. * * @param {String} setting * @param {*} [val] * @return {Server} for chaining * @public */ app.set = function set(setting, val) { if (arguments.length === 1) { // app.get(setting) return this.settings[setting]; } debug('set "%s" to %o', setting, val); // set value this.settings[setting] = val; // trigger matched settings switch (setting) { case 'etag': this.set('etag fn', compileETag(val)); break; case 'query parser': this.set('query parser fn', compileQueryParser(val)); break; case 'trust proxy': this.set('trust proxy fn', compileTrust(val)); // trust proxy inherit back-compat Object.defineProperty(this.settings, trustProxyDefaultSymbol, { configurable: true, value: false }); break; } return this; }; /** * Return the app's absolute pathname * based on the parent(s) that have * mounted it. * * For example if the application was * mounted as "/admin", which itself * was mounted as "/blog" then the * return value would be "/blog/admin". * * @return {String} * @private */ app.path = function path() { return this.parent ? this.parent.path() + this.mountpath : ''; }; /** * Check if `setting` is enabled (truthy). * * app.enabled('foo') * // => false * * app.enable('foo') * app.enabled('foo') * // => true * * @param {String} setting * @return {Boolean} * @public */ app.enabled = function enabled(setting) { return Boolean(this.set(setting)); }; /** * Check if `setting` is disabled. * * app.disabled('foo') * // => true * * app.enable('foo') * app.disabled('foo') * // => false * * @param {String} setting * @return {Boolean} * @public */ app.disabled = function disabled(setting) { return !this.set(setting); }; /** * Enable `setting`. * * @param {String} setting * @return {app} for chaining * @public */ app.enable = function enable(setting) { return this.set(setting, true); }; /** * Disable `setting`. * * @param {String} setting * @return {app} for chaining * @public */ app.disable = function disable(setting) { return this.set(setting, false); }; /** * Delegate `.VERB(...)` calls to `router.VERB(...)`. */ methods.forEach(function (method) { app[method] = function (path) { if (method === 'get' && arguments.length === 1) { // app.get(setting) return this.set(path); } this.lazyrouter(); var route = this._router.route(path); route[method].apply(route, slice.call(arguments, 1)); return this; }; }); /** * Special-cased "all" method, applying the given route `path`, * middleware, and callback to _every_ HTTP method. * * @param {String} path * @param {Function} ... * @return {app} for chaining * @public */ app.all = function all(path) { this.lazyrouter(); var route = this._router.route(path); var args = slice.call(arguments, 1); for (var i = 0; i < methods.length; i++) { route[methods[i]].apply(route, args); } return this; }; // del -> delete alias app.del = deprecate.function(app.delete, 'app.del: Use app.delete instead'); /** * Render the given view `name` name with `options` * and a callback accepting an error and the * rendered template string. * * Example: * * app.render('email', { name: 'Tobi' }, function(err, html){ * // ... * }) * * @param {String} name * @param {Object|Function} options or fn * @param {Function} callback * @public */ app.render = function render(name, options, callback) { var cache = this.cache; var done = callback; var engines = this.engines; var opts = options; var renderOptions = {}; var view; // support callback function as second arg if (typeof options === 'function') { done = options; opts = {}; } // merge app.locals merge(renderOptions, this.locals); // merge options._locals if (opts._locals) { merge(renderOptions, opts._locals); } // merge options merge(renderOptions, opts); // set .cache unless explicitly provided if (renderOptions.cache == null) { renderOptions.cache = this.enabled('view cache'); } // primed cache if (renderOptions.cache) { view = cache[name]; } // view if (!view) { var View = this.get('view'); view = new View(name, { defaultEngine: this.get('view engine'), root: this.get('views'), engines: engines }); if (!view.path) { var dirs = Array.isArray(view.root) && view.root.length > 1 ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"' : 'directory "' + view.root + '"'; var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs); err.view = view; return done(err); } // prime the cache if (renderOptions.cache) { cache[name] = view; } } // render tryRender(view, renderOptions, done); }; /** * Listen for connections. * * A node `http.Server` is returned, with this * application (which is a `Function`) as its * callback. If you wish to create both an HTTP * and HTTPS server you may do so with the "http" * and "https" modules as shown here: * * var http = require('http') * , https = require('https') * , express = require('express') * , app = express(); * * http.createServer(app).listen(80); * https.createServer({ ... }, app).listen(443); * * @return {http.Server} * @public */ app.listen = function listen() { var server = http.createServer(this); return server.listen.apply(server, arguments); }; /** * Log error using console.error. * * @param {Error} err * @private */ function logerror(err) { /* istanbul ignore next */ if (this.get('env') !== 'test') console.error(err.stack || err.toString()); } /** * Try rendering a view. * @private */ function tryRender(view, options, callback) { try { view.render(options, callback); } catch (err) { callback(err); } } /***/ }), /***/ "./node_modules/express/lib/express.js": /*!*********************************************!*\ !*** ./node_modules/express/lib/express.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var bodyParser = __webpack_require__(/*! body-parser */ "./node_modules/body-parser/index.js"); var EventEmitter = __webpack_require__(/*! events */ "events").EventEmitter; var mixin = __webpack_require__(/*! merge-descriptors */ "./node_modules/merge-descriptors/index.js"); var proto = __webpack_require__(/*! ./application */ "./node_modules/express/lib/application.js"); var Route = __webpack_require__(/*! ./router/route */ "./node_modules/express/lib/router/route.js"); var Router = __webpack_require__(/*! ./router */ "./node_modules/express/lib/router/index.js"); var req = __webpack_require__(/*! ./request */ "./node_modules/express/lib/request.js"); var res = __webpack_require__(/*! ./response */ "./node_modules/express/lib/response.js"); /** * Expose `createApplication()`. */ exports = module.exports = createApplication; /** * Create an express application. * * @return {Function} * @api public */ function createApplication() { var app = function app(req, res, next) { app.handle(req, res, next); }; mixin(app, EventEmitter.prototype, false); mixin(app, proto, false); // expose the prototype that will get set on requests app.request = Object.create(req, { app: { configurable: true, enumerable: true, writable: true, value: app } }); // expose the prototype that will get set on responses app.response = Object.create(res, { app: { configurable: true, enumerable: true, writable: true, value: app } }); app.init(); return app; } /** * Expose the prototypes. */ exports.application = proto; exports.request = req; exports.response = res; /** * Expose constructors. */ exports.Route = Route; exports.Router = Router; /** * Expose middleware */ exports.json = bodyParser.json; exports.query = __webpack_require__(/*! ./middleware/query */ "./node_modules/express/lib/middleware/query.js"); exports.static = __webpack_require__(/*! serve-static */ "./node_modules/serve-static/index.js"); exports.urlencoded = bodyParser.urlencoded /** * Replace removed middleware with an appropriate error message. */ ;['bodyParser', 'compress', 'cookieSession', 'session', 'logger', 'cookieParser', 'favicon', 'responseTime', 'errorHandler', 'timeout', 'methodOverride', 'vhost', 'csrf', 'directory', 'limit', 'multipart', 'staticCache'].forEach(function (name) { Object.defineProperty(exports, name, { get: function get() { throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.'); }, configurable: true }); }); /***/ }), /***/ "./node_modules/express/lib/middleware/init.js": /*!*****************************************************!*\ !*** ./node_modules/express/lib/middleware/init.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var setPrototypeOf = __webpack_require__(/*! setprototypeof */ "./node_modules/setprototypeof/index.js"); /** * Initialization middleware, exposing the * request and response to each other, as well * as defaulting the X-Powered-By header field. * * @param {Function} app * @return {Function} * @api private */ exports.init = function (app) { return function expressInit(req, res, next) { if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express'); req.res = res; res.req = req; req.next = next; setPrototypeOf(req, app.request); setPrototypeOf(res, app.response); res.locals = res.locals || Object.create(null); next(); }; }; /***/ }), /***/ "./node_modules/express/lib/middleware/query.js": /*!******************************************************!*\ !*** ./node_modules/express/lib/middleware/query.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var merge = __webpack_require__(/*! utils-merge */ "./node_modules/utils-merge/index.js"); var parseUrl = __webpack_require__(/*! parseurl */ "./node_modules/parseurl/index.js"); var qs = __webpack_require__(/*! qs */ "./node_modules/qs/lib/index.js"); /** * @param {Object} options * @return {Function} * @api public */ module.exports = function query(options) { var opts = merge({}, options); var queryparse = qs.parse; if (typeof options === 'function') { queryparse = options; opts = undefined; } if (opts !== undefined && opts.allowPrototypes === undefined) { // back-compat for qs module opts.allowPrototypes = true; } return function query(req, res, next) { if (!req.query) { var val = parseUrl(req).query; req.query = queryparse(val, opts); } next(); }; }; /***/ }), /***/ "./node_modules/express/lib/request.js": /*!*********************************************!*\ !*** ./node_modules/express/lib/request.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var accepts = __webpack_require__(/*! accepts */ "./node_modules/accepts/index.js"); var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('express'); var isIP = __webpack_require__(/*! net */ "net").isIP; var typeis = __webpack_require__(/*! type-is */ "./node_modules/type-is/index.js"); var http = __webpack_require__(/*! http */ "http"); var fresh = __webpack_require__(/*! fresh */ "./node_modules/fresh/index.js"); var parseRange = __webpack_require__(/*! range-parser */ "./node_modules/range-parser/index.js"); var parse = __webpack_require__(/*! parseurl */ "./node_modules/parseurl/index.js"); var proxyaddr = __webpack_require__(/*! proxy-addr */ "./node_modules/proxy-addr/index.js"); /** * Request prototype. * @public */ var req = Object.create(http.IncomingMessage.prototype); /** * Module exports. * @public */ module.exports = req; /** * Return request header. * * The `Referrer` header field is special-cased, * both `Referrer` and `Referer` are interchangeable. * * Examples: * * req.get('Content-Type'); * // => "text/plain" * * req.get('content-type'); * // => "text/plain" * * req.get('Something'); * // => undefined * * Aliased as `req.header()`. * * @param {String} name * @return {String} * @public */ req.get = req.header = function header(name) { if (!name) { throw new TypeError('name argument is required to req.get'); } if (typeof name !== 'string') { throw new TypeError('name must be a string to req.get'); } var lc = name.toLowerCase(); switch (lc) { case 'referer': case 'referrer': return this.headers.referrer || this.headers.referer; default: return this.headers[lc]; } }; /** * To do: update docs. * * Check if the given `type(s)` is acceptable, returning * the best match when true, otherwise `undefined`, in which * case you should respond with 406 "Not Acceptable". * * The `type` value may be a single MIME type string * such as "application/json", an extension name * such as "json", a comma-delimited list such as "json, html, text/plain", * an argument list such as `"json", "html", "text/plain"`, * or an array `["json", "html", "text/plain"]`. When a list * or array is given, the _best_ match, if any is returned. * * Examples: * * // Accept: text/html * req.accepts('html'); * // => "html" * * // Accept: text/*, application/json * req.accepts('html'); * // => "html" * req.accepts('text/html'); * // => "text/html" * req.accepts('json, text'); * // => "json" * req.accepts('application/json'); * // => "application/json" * * // Accept: text/*, application/json * req.accepts('image/png'); * req.accepts('png'); * // => undefined * * // Accept: text/*;q=.5, application/json * req.accepts(['html', 'json']); * req.accepts('html', 'json'); * req.accepts('html, json'); * // => "json" * * @param {String|Array} type(s) * @return {String|Array|Boolean} * @public */ req.accepts = function () { var accept = accepts(this); return accept.types.apply(accept, arguments); }; /** * Check if the given `encoding`s are accepted. * * @param {String} ...encoding * @return {String|Array} * @public */ req.acceptsEncodings = function () { var accept = accepts(this); return accept.encodings.apply(accept, arguments); }; req.acceptsEncoding = deprecate.function(req.acceptsEncodings, 'req.acceptsEncoding: Use acceptsEncodings instead'); /** * Check if the given `charset`s are acceptable, * otherwise you should respond with 406 "Not Acceptable". * * @param {String} ...charset * @return {String|Array} * @public */ req.acceptsCharsets = function () { var accept = accepts(this); return accept.charsets.apply(accept, arguments); }; req.acceptsCharset = deprecate.function(req.acceptsCharsets, 'req.acceptsCharset: Use acceptsCharsets instead'); /** * Check if the given `lang`s are acceptable, * otherwise you should respond with 406 "Not Acceptable". * * @param {String} ...lang * @return {String|Array} * @public */ req.acceptsLanguages = function () { var accept = accepts(this); return accept.languages.apply(accept, arguments); }; req.acceptsLanguage = deprecate.function(req.acceptsLanguages, 'req.acceptsLanguage: Use acceptsLanguages instead'); /** * Parse Range header field, capping to the given `size`. * * Unspecified ranges such as "0-" require knowledge of your resource length. In * the case of a byte range this is of course the total number of bytes. If the * Range header field is not given `undefined` is returned, `-1` when unsatisfiable, * and `-2` when syntactically invalid. * * When ranges are returned, the array has a "type" property which is the type of * range that is required (most commonly, "bytes"). Each array element is an object * with a "start" and "end" property for the portion of the range. * * The "combine" option can be set to `true` and overlapping & adjacent ranges * will be combined into a single range. * * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" * should respond with 4 users when available, not 3. * * @param {number} size * @param {object} [options] * @param {boolean} [options.combine=false] * @return {number|array} * @public */ req.range = function range(size, options) { var range = this.get('Range'); if (!range) return; return parseRange(size, range, options); }; /** * Return the value of param `name` when present or `defaultValue`. * * - Checks route placeholders, ex: _/user/:id_ * - Checks body params, ex: id=12, {"id":12} * - Checks query string params, ex: ?id=12 * * To utilize request bodies, `req.body` * should be an object. This can be done by using * the `bodyParser()` middleware. * * @param {String} name * @param {Mixed} [defaultValue] * @return {String} * @public */ req.param = function param(name, defaultValue) { var params = this.params || {}; var body = this.body || {}; var query = this.query || {}; var args = arguments.length === 1 ? 'name' : 'name, default'; deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead'); if (null != params[name] && params.hasOwnProperty(name)) return params[name]; if (null != body[name]) return body[name]; if (null != query[name]) return query[name]; return defaultValue; }; /** * Check if the incoming request contains the "Content-Type" * header field, and it contains the give mime `type`. * * Examples: * * // With Content-Type: text/html; charset=utf-8 * req.is('html'); * req.is('text/html'); * req.is('text/*'); * // => true * * // When Content-Type is application/json * req.is('json'); * req.is('application/json'); * req.is('application/*'); * // => true * * req.is('html'); * // => false * * @param {String|Array} types... * @return {String|false|null} * @public */ req.is = function is(types) { var arr = types; // support flattened arguments if (!Array.isArray(types)) { arr = new Array(arguments.length); for (var i = 0; i < arr.length; i++) { arr[i] = arguments[i]; } } return typeis(this, arr); }; /** * Return the protocol string "http" or "https" * when requested with TLS. When the "trust proxy" * setting trusts the socket address, the * "X-Forwarded-Proto" header field will be trusted * and used if present. * * If you're running behind a reverse proxy that * supplies https for you this may be enabled. * * @return {String} * @public */ defineGetter(req, 'protocol', function protocol() { var proto = this.connection.encrypted ? 'https' : 'http'; var trust = this.app.get('trust proxy fn'); if (!trust(this.connection.remoteAddress, 0)) { return proto; } // Note: X-Forwarded-Proto is normally only ever a // single value, but this is to be safe. var header = this.get('X-Forwarded-Proto') || proto; var index = header.indexOf(','); return index !== -1 ? header.substring(0, index).trim() : header.trim(); }); /** * Short-hand for: * * req.protocol === 'https' * * @return {Boolean} * @public */ defineGetter(req, 'secure', function secure() { return this.protocol === 'https'; }); /** * Return the remote address from the trusted proxy. * * The is the remote address on the socket unless * "trust proxy" is set. * * @return {String} * @public */ defineGetter(req, 'ip', function ip() { var trust = this.app.get('trust proxy fn'); return proxyaddr(this, trust); }); /** * When "trust proxy" is set, trusted proxy addresses + client. * * For example if the value were "client, proxy1, proxy2" * you would receive the array `["client", "proxy1", "proxy2"]` * where "proxy2" is the furthest down-stream and "proxy1" and * "proxy2" were trusted. * * @return {Array} * @public */ defineGetter(req, 'ips', function ips() { var trust = this.app.get('trust proxy fn'); var addrs = proxyaddr.all(this, trust); // reverse the order (to farthest -> closest) // and remove socket address addrs.reverse().pop(); return addrs; }); /** * Return subdomains as an array. * * Subdomains are the dot-separated parts of the host before the main domain of * the app. By default, the domain of the app is assumed to be the last two * parts of the host. This can be changed by setting "subdomain offset". * * For example, if the domain is "tobi.ferrets.example.com": * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. * * @return {Array} * @public */ defineGetter(req, 'subdomains', function subdomains() { var hostname = this.hostname; if (!hostname) return []; var offset = this.app.get('subdomain offset'); var subdomains = !isIP(hostname) ? hostname.split('.').reverse() : [hostname]; return subdomains.slice(offset); }); /** * Short-hand for `url.parse(req.url).pathname`. * * @return {String} * @public */ defineGetter(req, 'path', function path() { return parse(this).pathname; }); /** * Parse the "Host" header field to a hostname. * * When the "trust proxy" setting trusts the socket * address, the "X-Forwarded-Host" header field will * be trusted. * * @return {String} * @public */ defineGetter(req, 'hostname', function hostname() { var trust = this.app.get('trust proxy fn'); var host = this.get('X-Forwarded-Host'); if (!host || !trust(this.connection.remoteAddress, 0)) { host = this.get('Host'); } if (!host) return; // IPv6 literal support var offset = host[0] === '[' ? host.indexOf(']') + 1 : 0; var index = host.indexOf(':', offset); return index !== -1 ? host.substring(0, index) : host; }); // TODO: change req.host to return host in next major defineGetter(req, 'host', deprecate.function(function host() { return this.hostname; }, 'req.host: Use req.hostname instead')); /** * Check if the request is fresh, aka * Last-Modified and/or the ETag * still match. * * @return {Boolean} * @public */ defineGetter(req, 'fresh', function () { var method = this.method; var res = this.res; var status = res.statusCode; // GET or HEAD for weak freshness validation only if ('GET' !== method && 'HEAD' !== method) return false; // 2xx or 304 as per rfc2616 14.26 if (status >= 200 && status < 300 || 304 === status) { return fresh(this.headers, { 'etag': res.get('ETag'), 'last-modified': res.get('Last-Modified') }); } return false; }); /** * Check if the request is stale, aka * "Last-Modified" and / or the "ETag" for the * resource has changed. * * @return {Boolean} * @public */ defineGetter(req, 'stale', function stale() { return !this.fresh; }); /** * Check if the request was an _XMLHttpRequest_. * * @return {Boolean} * @public */ defineGetter(req, 'xhr', function xhr() { var val = this.get('X-Requested-With') || ''; return val.toLowerCase() === 'xmlhttprequest'; }); /** * Helper function for creating a getter on an object. * * @param {Object} obj * @param {String} name * @param {Function} getter * @private */ function defineGetter(obj, name, getter) { Object.defineProperty(obj, name, { configurable: true, enumerable: true, get: getter }); } /***/ }), /***/ "./node_modules/express/lib/response.js": /*!**********************************************!*\ !*** ./node_modules/express/lib/response.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/express/node_modules/safe-buffer/index.js").Buffer; var contentDisposition = __webpack_require__(/*! content-disposition */ "./node_modules/content-disposition/index.js"); var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('express'); var encodeUrl = __webpack_require__(/*! encodeurl */ "./node_modules/encodeurl/index.js"); var escapeHtml = __webpack_require__(/*! escape-html */ "./node_modules/escape-html/index.js"); var http = __webpack_require__(/*! http */ "http"); var isAbsolute = __webpack_require__(/*! ./utils */ "./node_modules/express/lib/utils.js").isAbsolute; var onFinished = __webpack_require__(/*! on-finished */ "./node_modules/on-finished/index.js"); var path = __webpack_require__(/*! path */ "path"); var statuses = __webpack_require__(/*! statuses */ "./node_modules/statuses/index.js"); var merge = __webpack_require__(/*! utils-merge */ "./node_modules/utils-merge/index.js"); var sign = __webpack_require__(/*! cookie-signature */ "./node_modules/cookie-signature/index.js").sign; var normalizeType = __webpack_require__(/*! ./utils */ "./node_modules/express/lib/utils.js").normalizeType; var normalizeTypes = __webpack_require__(/*! ./utils */ "./node_modules/express/lib/utils.js").normalizeTypes; var setCharset = __webpack_require__(/*! ./utils */ "./node_modules/express/lib/utils.js").setCharset; var cookie = __webpack_require__(/*! cookie */ "./node_modules/cookie/index.js"); var send = __webpack_require__(/*! send */ "./node_modules/send/index.js"); var extname = path.extname; var mime = send.mime; var resolve = path.resolve; var vary = __webpack_require__(/*! vary */ "./node_modules/vary/index.js"); /** * Response prototype. * @public */ var res = Object.create(http.ServerResponse.prototype); /** * Module exports. * @public */ module.exports = res; /** * Module variables. * @private */ var charsetRegExp = /;\s*charset\s*=/; /** * Set status `code`. * * @param {Number} code * @return {ServerResponse} * @public */ res.status = function status(code) { this.statusCode = code; return this; }; /** * Set Link header field with the given `links`. * * Examples: * * res.links({ * next: 'http://api.example.com/users?page=2', * last: 'http://api.example.com/users?page=5' * }); * * @param {Object} links * @return {ServerResponse} * @public */ res.links = function (links) { var link = this.get('Link') || ''; if (link) link += ', '; return this.set('Link', link + Object.keys(links).map(function (rel) { return '<' + links[rel] + '>; rel="' + rel + '"'; }).join(', ')); }; /** * Send a response. * * Examples: * * res.send(Buffer.from('wahoo')); * res.send({ some: 'json' }); * res.send('<p>some html</p>'); * * @param {string|number|boolean|object|Buffer} body * @public */ res.send = function send(body) { var chunk = body; var encoding; var req = this.req; var type; // settings var app = this.app; // allow status / body if (arguments.length === 2) { // res.send(body, status) backwards compat if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') { deprecate('res.send(body, status): Use res.status(status).send(body) instead'); this.statusCode = arguments[1]; } else { deprecate('res.send(status, body): Use res.status(status).send(body) instead'); this.statusCode = arguments[0]; chunk = arguments[1]; } } // disambiguate res.send(status) and res.send(status, num) if (typeof chunk === 'number' && arguments.length === 1) { // res.send(status) will set status message as text string if (!this.get('Content-Type')) { this.type('txt'); } deprecate('res.send(status): Use res.sendStatus(status) instead'); this.statusCode = chunk; chunk = statuses[chunk]; } switch (typeof chunk === 'undefined' ? 'undefined' : _typeof(chunk)) { // string defaulting to html case 'string': if (!this.get('Content-Type')) { this.type('html'); } break; case 'boolean': case 'number': case 'object': if (chunk === null) { chunk = ''; } else if (Buffer.isBuffer(chunk)) { if (!this.get('Content-Type')) { this.type('bin'); } } else { return this.json(chunk); } break; } // write strings in utf-8 if (typeof chunk === 'string') { encoding = 'utf8'; type = this.get('Content-Type'); // reflect this in content-type if (typeof type === 'string') { this.set('Content-Type', setCharset(type, 'utf-8')); } } // determine if ETag should be generated var etagFn = app.get('etag fn'); var generateETag = !this.get('ETag') && typeof etagFn === 'function'; // populate Content-Length var len; if (chunk !== undefined) { if (Buffer.isBuffer(chunk)) { // get length of Buffer len = chunk.length; } else if (!generateETag && chunk.length < 1000) { // just calculate length when no ETag + small chunk len = Buffer.byteLength(chunk, encoding); } else { // convert chunk to Buffer and calculate chunk = Buffer.from(chunk, encoding); encoding = undefined; len = chunk.length; } this.set('Content-Length', len); } // populate ETag var etag; if (generateETag && len !== undefined) { if (etag = etagFn(chunk, encoding)) { this.set('ETag', etag); } } // freshness if (req.fresh) this.statusCode = 304; // strip irrelevant headers if (204 === this.statusCode || 304 === this.statusCode) { this.removeHeader('Content-Type'); this.removeHeader('Content-Length'); this.removeHeader('Transfer-Encoding'); chunk = ''; } if (req.method === 'HEAD') { // skip body for HEAD this.end(); } else { // respond this.end(chunk, encoding); } return this; }; /** * Send JSON response. * * Examples: * * res.json(null); * res.json({ user: 'tj' }); * * @param {string|number|boolean|object} obj * @public */ res.json = function json(obj) { var val = obj; // allow status / body if (arguments.length === 2) { // res.json(body, status) backwards compat if (typeof arguments[1] === 'number') { deprecate('res.json(obj, status): Use res.status(status).json(obj) instead'); this.statusCode = arguments[1]; } else { deprecate('res.json(status, obj): Use res.status(status).json(obj) instead'); this.statusCode = arguments[0]; val = arguments[1]; } } // settings var app = this.app; var escape = app.get('json escape'); var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); var body = stringify(val, replacer, spaces, escape); // content-type if (!this.get('Content-Type')) { this.set('Content-Type', 'application/json'); } return this.send(body); }; /** * Send JSON response with JSONP callback support. * * Examples: * * res.jsonp(null); * res.jsonp({ user: 'tj' }); * * @param {string|number|boolean|object} obj * @public */ res.jsonp = function jsonp(obj) { var val = obj; // allow status / body if (arguments.length === 2) { // res.json(body, status) backwards compat if (typeof arguments[1] === 'number') { deprecate('res.jsonp(obj, status): Use res.status(status).json(obj) instead'); this.statusCode = arguments[1]; } else { deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead'); this.statusCode = arguments[0]; val = arguments[1]; } } // settings var app = this.app; var escape = app.get('json escape'); var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); var body = stringify(val, replacer, spaces, escape); var callback = this.req.query[app.get('jsonp callback name')]; // content-type if (!this.get('Content-Type')) { this.set('X-Content-Type-Options', 'nosniff'); this.set('Content-Type', 'application/json'); } // fixup callback if (Array.isArray(callback)) { callback = callback[0]; } // jsonp if (typeof callback === 'string' && callback.length !== 0) { this.set('X-Content-Type-Options', 'nosniff'); this.set('Content-Type', 'text/javascript'); // restrict callback charset callback = callback.replace(/[^\[\]\w$.]/g, ''); // replace chars not allowed in JavaScript that are in JSON body = body.replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029'); // the /**/ is a specific security mitigation for "Rosetta Flash JSONP abuse" // the typeof check is just to reduce client error noise body = '/**/ typeof ' + callback + ' === \'function\' && ' + callback + '(' + body + ');'; } return this.send(body); }; /** * Send given HTTP status code. * * Sets the response status to `statusCode` and the body of the * response to the standard description from node's http.STATUS_CODES * or the statusCode number if no description. * * Examples: * * res.sendStatus(200); * * @param {number} statusCode * @public */ res.sendStatus = function sendStatus(statusCode) { var body = statuses[statusCode] || String(statusCode); this.statusCode = statusCode; this.type('txt'); return this.send(body); }; /** * Transfer the file at the given `path`. * * Automatically sets the _Content-Type_ response header field. * The callback `callback(err)` is invoked when the transfer is complete * or when an error occurs. Be sure to check `res.sentHeader` * if you wish to attempt responding, as the header and some data * may have already been transferred. * * Options: * * - `maxAge` defaulting to 0 (can be string converted by `ms`) * - `root` root directory for relative filenames * - `headers` object of headers to serve with file * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them * * Other options are passed along to `send`. * * Examples: * * The following example illustrates how `res.sendFile()` may * be used as an alternative for the `static()` middleware for * dynamic situations. The code backing `res.sendFile()` is actually * the same code, so HTTP cache support etc is identical. * * app.get('/user/:uid/photos/:file', function(req, res){ * var uid = req.params.uid * , file = req.params.file; * * req.user.mayViewFilesFrom(uid, function(yes){ * if (yes) { * res.sendFile('/uploads/' + uid + '/' + file); * } else { * res.send(403, 'Sorry! you cant see that.'); * } * }); * }); * * @public */ res.sendFile = function sendFile(path, options, callback) { var done = callback; var req = this.req; var res = this; var next = req.next; var opts = options || {}; if (!path) { throw new TypeError('path argument is required to res.sendFile'); } // support function as second arg if (typeof options === 'function') { done = options; opts = {}; } if (!opts.root && !isAbsolute(path)) { throw new TypeError('path must be absolute or specify root to res.sendFile'); } // create file stream var pathname = encodeURI(path); var file = send(req, pathname, opts); // transfer sendfile(res, file, opts, function (err) { if (done) return done(err); if (err && err.code === 'EISDIR') return next(); // next() all but write errors if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') { next(err); } }); }; /** * Transfer the file at the given `path`. * * Automatically sets the _Content-Type_ response header field. * The callback `callback(err)` is invoked when the transfer is complete * or when an error occurs. Be sure to check `res.sentHeader` * if you wish to attempt responding, as the header and some data * may have already been transferred. * * Options: * * - `maxAge` defaulting to 0 (can be string converted by `ms`) * - `root` root directory for relative filenames * - `headers` object of headers to serve with file * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them * * Other options are passed along to `send`. * * Examples: * * The following example illustrates how `res.sendfile()` may * be used as an alternative for the `static()` middleware for * dynamic situations. The code backing `res.sendfile()` is actually * the same code, so HTTP cache support etc is identical. * * app.get('/user/:uid/photos/:file', function(req, res){ * var uid = req.params.uid * , file = req.params.file; * * req.user.mayViewFilesFrom(uid, function(yes){ * if (yes) { * res.sendfile('/uploads/' + uid + '/' + file); * } else { * res.send(403, 'Sorry! you cant see that.'); * } * }); * }); * * @public */ res.sendfile = function (path, options, callback) { var done = callback; var req = this.req; var res = this; var next = req.next; var opts = options || {}; // support function as second arg if (typeof options === 'function') { done = options; opts = {}; } // create file stream var file = send(req, path, opts); // transfer sendfile(res, file, opts, function (err) { if (done) return done(err); if (err && err.code === 'EISDIR') return next(); // next() all but write errors if (err && err.code !== 'ECONNABORT' && err.syscall !== 'write') { next(err); } }); }; res.sendfile = deprecate.function(res.sendfile, 'res.sendfile: Use res.sendFile instead'); /** * Transfer the file at the given `path` as an attachment. * * Optionally providing an alternate attachment `filename`, * and optional callback `callback(err)`. The callback is invoked * when the data transfer is complete, or when an error has * ocurred. Be sure to check `res.headersSent` if you plan to respond. * * Optionally providing an `options` object to use with `res.sendFile()`. * This function will set the `Content-Disposition` header, overriding * any `Content-Disposition` header passed as header options in order * to set the attachment and filename. * * This method uses `res.sendFile()`. * * @public */ res.download = function download(path, filename, options, callback) { var done = callback; var name = filename; var opts = options || null; // support function as second or third arg if (typeof filename === 'function') { done = filename; name = null; opts = null; } else if (typeof options === 'function') { done = options; opts = null; } // set Content-Disposition when file is sent var headers = { 'Content-Disposition': contentDisposition(name || path) }; // merge user-provided headers if (opts && opts.headers) { var keys = Object.keys(opts.headers); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key.toLowerCase() !== 'content-disposition') { headers[key] = opts.headers[key]; } } } // merge user-provided options opts = Object.create(opts); opts.headers = headers; // Resolve the full path for sendFile var fullPath = resolve(path); // send file return this.sendFile(fullPath, opts, done); }; /** * Set _Content-Type_ response header with `type` through `mime.lookup()` * when it does not contain "/", or set the Content-Type to `type` otherwise. * * Examples: * * res.type('.html'); * res.type('html'); * res.type('json'); * res.type('application/json'); * res.type('png'); * * @param {String} type * @return {ServerResponse} for chaining * @public */ res.contentType = res.type = function contentType(type) { var ct = type.indexOf('/') === -1 ? mime.lookup(type) : type; return this.set('Content-Type', ct); }; /** * Respond to the Acceptable formats using an `obj` * of mime-type callbacks. * * This method uses `req.accepted`, an array of * acceptable types ordered by their quality values. * When "Accept" is not present the _first_ callback * is invoked, otherwise the first match is used. When * no match is performed the server responds with * 406 "Not Acceptable". * * Content-Type is set for you, however if you choose * you may alter this within the callback using `res.type()` * or `res.set('Content-Type', ...)`. * * res.format({ * 'text/plain': function(){ * res.send('hey'); * }, * * 'text/html': function(){ * res.send('<p>hey</p>'); * }, * * 'appliation/json': function(){ * res.send({ message: 'hey' }); * } * }); * * In addition to canonicalized MIME types you may * also use extnames mapped to these types: * * res.format({ * text: function(){ * res.send('hey'); * }, * * html: function(){ * res.send('<p>hey</p>'); * }, * * json: function(){ * res.send({ message: 'hey' }); * } * }); * * By default Express passes an `Error` * with a `.status` of 406 to `next(err)` * if a match is not made. If you provide * a `.default` callback it will be invoked * instead. * * @param {Object} obj * @return {ServerResponse} for chaining * @public */ res.format = function (obj) { var req = this.req; var next = req.next; var fn = obj.default; if (fn) delete obj.default; var keys = Object.keys(obj); var key = keys.length > 0 ? req.accepts(keys) : false; this.vary("Accept"); if (key) { this.set('Content-Type', normalizeType(key).value); obj[key](req, this, next); } else if (fn) { fn(); } else { var err = new Error('Not Acceptable'); err.status = err.statusCode = 406; err.types = normalizeTypes(keys).map(function (o) { return o.value; }); next(err); } return this; }; /** * Set _Content-Disposition_ header to _attachment_ with optional `filename`. * * @param {String} filename * @return {ServerResponse} * @public */ res.attachment = function attachment(filename) { if (filename) { this.type(extname(filename)); } this.set('Content-Disposition', contentDisposition(filename)); return this; }; /** * Append additional header `field` with value `val`. * * Example: * * res.append('Link', ['<http://localhost/>', '<http://localhost:3000/>']); * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly'); * res.append('Warning', '199 Miscellaneous warning'); * * @param {String} field * @param {String|Array} val * @return {ServerResponse} for chaining * @public */ res.append = function append(field, val) { var prev = this.get(field); var value = val; if (prev) { // concat the new and prev vals value = Array.isArray(prev) ? prev.concat(val) : Array.isArray(val) ? [prev].concat(val) : [prev, val]; } return this.set(field, value); }; /** * Set header `field` to `val`, or pass * an object of header fields. * * Examples: * * res.set('Foo', ['bar', 'baz']); * res.set('Accept', 'application/json'); * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); * * Aliased as `res.header()`. * * @param {String|Object} field * @param {String|Array} val * @return {ServerResponse} for chaining * @public */ res.set = res.header = function header(field, val) { if (arguments.length === 2) { var value = Array.isArray(val) ? val.map(String) : String(val); // add charset to content-type if (field.toLowerCase() === 'content-type') { if (Array.isArray(value)) { throw new TypeError('Content-Type cannot be set to an Array'); } if (!charsetRegExp.test(value)) { var charset = mime.charsets.lookup(value.split(';')[0]); if (charset) value += '; charset=' + charset.toLowerCase(); } } this.setHeader(field, value); } else { for (var key in field) { this.set(key, field[key]); } } return this; }; /** * Get value for header `field`. * * @param {String} field * @return {String} * @public */ res.get = function (field) { return this.getHeader(field); }; /** * Clear cookie `name`. * * @param {String} name * @param {Object} [options] * @return {ServerResponse} for chaining * @public */ res.clearCookie = function clearCookie(name, options) { var opts = merge({ expires: new Date(1), path: '/' }, options); return this.cookie(name, '', opts); }; /** * Set cookie `name` to `value`, with the given `options`. * * Options: * * - `maxAge` max-age in milliseconds, converted to `expires` * - `signed` sign the cookie * - `path` defaults to "/" * * Examples: * * // "Remember Me" for 15 minutes * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); * * // save as above * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) * * @param {String} name * @param {String|Object} value * @param {Object} [options] * @return {ServerResponse} for chaining * @public */ res.cookie = function (name, value, options) { var opts = merge({}, options); var secret = this.req.secret; var signed = opts.signed; if (signed && !secret) { throw new Error('cookieParser("secret") required for signed cookies'); } var val = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' ? 'j:' + JSON.stringify(value) : String(value); if (signed) { val = 's:' + sign(val, secret); } if ('maxAge' in opts) { opts.expires = new Date(Date.now() + opts.maxAge); opts.maxAge /= 1000; } if (opts.path == null) { opts.path = '/'; } this.append('Set-Cookie', cookie.serialize(name, String(val), opts)); return this; }; /** * Set the location header to `url`. * * The given `url` can also be "back", which redirects * to the _Referrer_ or _Referer_ headers or "/". * * Examples: * * res.location('/foo/bar').; * res.location('http://example.com'); * res.location('../login'); * * @param {String} url * @return {ServerResponse} for chaining * @public */ res.location = function location(url) { var loc = url; // "back" is an alias for the referrer if (url === 'back') { loc = this.req.get('Referrer') || '/'; } // set location return this.set('Location', encodeUrl(loc)); }; /** * Redirect to the given `url` with optional response `status` * defaulting to 302. * * The resulting `url` is determined by `res.location()`, so * it will play nicely with mounted apps, relative paths, * `"back"` etc. * * Examples: * * res.redirect('/foo/bar'); * res.redirect('http://example.com'); * res.redirect(301, 'http://example.com'); * res.redirect('../login'); // /blog/post/1 -> /blog/login * * @public */ res.redirect = function redirect(url) { var address = url; var body; var status = 302; // allow status / url if (arguments.length === 2) { if (typeof arguments[0] === 'number') { status = arguments[0]; address = arguments[1]; } else { deprecate('res.redirect(url, status): Use res.redirect(status, url) instead'); status = arguments[1]; } } // Set location header address = this.location(address).get('Location'); // Support text/{plain,html} by default this.format({ text: function text() { body = statuses[status] + '. Redirecting to ' + address; }, html: function html() { var u = escapeHtml(address); body = '<p>' + statuses[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'; }, default: function _default() { body = ''; } }); // Respond this.statusCode = status; this.set('Content-Length', Buffer.byteLength(body)); if (this.req.method === 'HEAD') { this.end(); } else { this.end(body); } }; /** * Add `field` to Vary. If already present in the Vary set, then * this call is simply ignored. * * @param {Array|String} field * @return {ServerResponse} for chaining * @public */ res.vary = function (field) { // checks for back-compat if (!field || Array.isArray(field) && !field.length) { deprecate('res.vary(): Provide a field name'); return this; } vary(this, field); return this; }; /** * Render `view` with the given `options` and optional callback `fn`. * When a callback function is given a response will _not_ be made * automatically, otherwise a response of _200_ and _text/html_ is given. * * Options: * * - `cache` boolean hinting to the engine it should cache * - `filename` filename of the view being rendered * * @public */ res.render = function render(view, options, callback) { var app = this.req.app; var done = callback; var opts = options || {}; var req = this.req; var self = this; // support callback function as second arg if (typeof options === 'function') { done = options; opts = {}; } // merge res.locals opts._locals = self.locals; // default callback to respond done = done || function (err, str) { if (err) return req.next(err); self.send(str); }; // render app.render(view, opts, done); }; // pipe the send file stream function sendfile(res, file, options, callback) { var done = false; var streaming; // request aborted function onaborted() { if (done) return; done = true; var err = new Error('Request aborted'); err.code = 'ECONNABORTED'; callback(err); } // directory function ondirectory() { if (done) return; done = true; var err = new Error('EISDIR, read'); err.code = 'EISDIR'; callback(err); } // errors function onerror(err) { if (done) return; done = true; callback(err); } // ended function onend() { if (done) return; done = true; callback(); } // file function onfile() { streaming = false; } // finished function onfinish(err) { if (err && err.code === 'ECONNRESET') return onaborted(); if (err) return onerror(err); if (done) return; setImmediate(function () { if (streaming !== false && !done) { onaborted(); return; } if (done) return; done = true; callback(); }); } // streaming function onstream() { streaming = true; } file.on('directory', ondirectory); file.on('end', onend); file.on('error', onerror); file.on('file', onfile); file.on('stream', onstream); onFinished(res, onfinish); if (options.headers) { // set headers on successful transfer file.on('headers', function headers(res) { var obj = options.headers; var keys = Object.keys(obj); for (var i = 0; i < keys.length; i++) { var k = keys[i]; res.setHeader(k, obj[k]); } }); } // pipe file.pipe(res); } /** * Stringify JSON, like JSON.stringify, but v8 optimized, with the * ability to escape characters that can trigger HTML sniffing. * * @param {*} value * @param {function} replaces * @param {number} spaces * @param {boolean} escape * @returns {string} * @private */ function stringify(value, replacer, spaces, escape) { // v8 checks arguments.length for optimizing simple call // https://bugs.chromium.org/p/v8/issues/detail?id=4730 var json = replacer || spaces ? JSON.stringify(value, replacer, spaces) : JSON.stringify(value); if (escape) { json = json.replace(/[<>&]/g, function (c) { switch (c.charCodeAt(0)) { case 0x3c: return '\\u003c'; case 0x3e: return '\\u003e'; case 0x26: return '\\u0026'; default: return c; } }); } return json; } /***/ }), /***/ "./node_modules/express/lib/router/index.js": /*!**************************************************!*\ !*** ./node_modules/express/lib/router/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var Route = __webpack_require__(/*! ./route */ "./node_modules/express/lib/router/route.js"); var Layer = __webpack_require__(/*! ./layer */ "./node_modules/express/lib/router/layer.js"); var methods = __webpack_require__(/*! methods */ "./node_modules/methods/index.js"); var mixin = __webpack_require__(/*! utils-merge */ "./node_modules/utils-merge/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('express:router'); var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('express'); var flatten = __webpack_require__(/*! array-flatten */ "./node_modules/array-flatten/array-flatten.js"); var parseUrl = __webpack_require__(/*! parseurl */ "./node_modules/parseurl/index.js"); var setPrototypeOf = __webpack_require__(/*! setprototypeof */ "./node_modules/setprototypeof/index.js"); /** * Module variables. * @private */ var objectRegExp = /^\[object (\S+)\]$/; var slice = Array.prototype.slice; var toString = Object.prototype.toString; /** * Initialize a new `Router` with the given `options`. * * @param {Object} options * @return {Router} which is an callable function * @public */ var proto = module.exports = function (options) { var opts = options || {}; function router(req, res, next) { router.handle(req, res, next); } // mixin Router class functions setPrototypeOf(router, proto); router.params = {}; router._params = []; router.caseSensitive = opts.caseSensitive; router.mergeParams = opts.mergeParams; router.strict = opts.strict; router.stack = []; return router; }; /** * Map the given param placeholder `name`(s) to the given callback. * * Parameter mapping is used to provide pre-conditions to routes * which use normalized placeholders. For example a _:user_id_ parameter * could automatically load a user's information from the database without * any additional code, * * The callback uses the same signature as middleware, the only difference * being that the value of the placeholder is passed, in this case the _id_ * of the user. Once the `next()` function is invoked, just like middleware * it will continue on to execute the route, or subsequent parameter functions. * * Just like in middleware, you must either respond to the request or call next * to avoid stalling the request. * * app.param('user_id', function(req, res, next, id){ * User.find(id, function(err, user){ * if (err) { * return next(err); * } else if (!user) { * return next(new Error('failed to load user')); * } * req.user = user; * next(); * }); * }); * * @param {String} name * @param {Function} fn * @return {app} for chaining * @public */ proto.param = function param(name, fn) { // param logic if (typeof name === 'function') { deprecate('router.param(fn): Refactor to use path params'); this._params.push(name); return; } // apply param functions var params = this._params; var len = params.length; var ret; if (name[0] === ':') { deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.substr(1)) + ', fn) instead'); name = name.substr(1); } for (var i = 0; i < len; ++i) { if (ret = params[i](name, fn)) { fn = ret; } } // ensure we end up with a // middleware function if ('function' !== typeof fn) { throw new Error('invalid param() call for ' + name + ', got ' + fn); } (this.params[name] = this.params[name] || []).push(fn); return this; }; /** * Dispatch a req, res into the router. * @private */ proto.handle = function handle(req, res, out) { var self = this; debug('dispatching %s %s', req.method, req.url); var idx = 0; var protohost = getProtohost(req.url) || ''; var removed = ''; var slashAdded = false; var paramcalled = {}; // store options for OPTIONS request // only used if OPTIONS request var options = []; // middleware and routes var stack = self.stack; // manage inter-router variables var parentParams = req.params; var parentUrl = req.baseUrl || ''; var done = restore(out, req, 'baseUrl', 'next', 'params'); // setup next layer req.next = next; // for options requests, respond with a default if nothing else responds if (req.method === 'OPTIONS') { done = wrap(done, function (old, err) { if (err || options.length === 0) return old(err); sendOptionsResponse(res, options, old); }); } // setup basic req values req.baseUrl = parentUrl; req.originalUrl = req.originalUrl || req.url; next(); function next(err) { var layerError = err === 'route' ? null : err; // remove added slash if (slashAdded) { req.url = req.url.substr(1); slashAdded = false; } // restore altered req.url if (removed.length !== 0) { req.baseUrl = parentUrl; req.url = protohost + removed + req.url.substr(protohost.length); removed = ''; } // signal to exit router if (layerError === 'router') { setImmediate(done, null); return; } // no more matching layers if (idx >= stack.length) { setImmediate(done, layerError); return; } // get pathname of request var path = getPathname(req); if (path == null) { return done(layerError); } // find next matching layer var layer; var match; var route; while (match !== true && idx < stack.length) { layer = stack[idx++]; match = matchLayer(layer, path); route = layer.route; if (typeof match !== 'boolean') { // hold on to layerError layerError = layerError || match; } if (match !== true) { continue; } if (!route) { // process non-route handlers normally continue; } if (layerError) { // routes do not match with a pending error match = false; continue; } var method = req.method; var has_method = route._handles_method(method); // build up automatic options response if (!has_method && method === 'OPTIONS') { appendMethods(options, route._options()); } // don't even bother matching route if (!has_method && method !== 'HEAD') { match = false; continue; } } // no match if (match !== true) { return done(layerError); } // store route for dispatch on change if (route) { req.route = route; } // Capture one-time layer values req.params = self.mergeParams ? mergeParams(layer.params, parentParams) : layer.params; var layerPath = layer.path; // this should be done for the layer self.process_params(layer, paramcalled, req, res, function (err) { if (err) { return next(layerError || err); } if (route) { return layer.handle_request(req, res, next); } trim_prefix(layer, layerError, layerPath, path); }); } function trim_prefix(layer, layerError, layerPath, path) { if (layerPath.length !== 0) { // Validate path breaks on a path separator var c = path[layerPath.length]; if (c && c !== '/' && c !== '.') return next(layerError); // Trim off the part of the url that matches the route // middleware (.use stuff) needs to have the path stripped debug('trim prefix (%s) from url %s', layerPath, req.url); removed = layerPath; req.url = protohost + req.url.substr(protohost.length + removed.length); // Ensure leading slash if (!protohost && req.url[0] !== '/') { req.url = '/' + req.url; slashAdded = true; } // Setup base URL (no trailing slash) req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' ? removed.substring(0, removed.length - 1) : removed); } debug('%s %s : %s', layer.name, layerPath, req.originalUrl); if (layerError) { layer.handle_error(layerError, req, res, next); } else { layer.handle_request(req, res, next); } } }; /** * Process any parameters for the layer. * @private */ proto.process_params = function process_params(layer, called, req, res, done) { var params = this.params; // captured parameters from the layer, keys and values var keys = layer.keys; // fast track if (!keys || keys.length === 0) { return done(); } var i = 0; var name; var paramIndex = 0; var key; var paramVal; var paramCallbacks; var paramCalled; // process params in order // param callbacks can be async function param(err) { if (err) { return done(err); } if (i >= keys.length) { return done(); } paramIndex = 0; key = keys[i++]; name = key.name; paramVal = req.params[name]; paramCallbacks = params[name]; paramCalled = called[name]; if (paramVal === undefined || !paramCallbacks) { return param(); } // param previously called with same value or error occurred if (paramCalled && (paramCalled.match === paramVal || paramCalled.error && paramCalled.error !== 'route')) { // restore value req.params[name] = paramCalled.value; // next param return param(paramCalled.error); } called[name] = paramCalled = { error: null, match: paramVal, value: paramVal }; paramCallback(); } // single param callbacks function
(err) { var fn = paramCallbacks[paramIndex++]; // store updated value paramCalled.value = req.params[key.name]; if (err) { // store error paramCalled.error = err; param(err); return; } if (!fn) return param(); try { fn(req, res, paramCallback, paramVal, key.name); } catch (e) { paramCallback(e); } } param(); }; /** * Use the given middleware function, with optional path, defaulting to "/". * * Use (like `.all`) will run for any http METHOD, but it will not add * handlers for those methods so OPTIONS requests will not consider `.use` * functions even if they could respond. * * The other difference is that _route_ path is stripped and not visible * to the handler function. The main effect of this feature is that mounted * handlers can operate without any code changes regardless of the "prefix" * pathname. * * @public */ proto.use = function use(fn) { var offset = 0; var path = '/'; // default path to '/' // disambiguate router.use([fn]) if (typeof fn !== 'function') { var arg = fn; while (Array.isArray(arg) && arg.length !== 0) { arg = arg[0]; } // first arg is the path if (typeof arg !== 'function') { offset = 1; path = fn; } } var callbacks = flatten(slice.call(arguments, offset)); if (callbacks.length === 0) { throw new TypeError('Router.use() requires a middleware function'); } for (var i = 0; i < callbacks.length; i++) { var fn = callbacks[i]; if (typeof fn !== 'function') { throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)); } // add the middleware debug('use %o %s', path, fn.name || '<anonymous>'); var layer = new Layer(path, { sensitive: this.caseSensitive, strict: false, end: false }, fn); layer.route = undefined; this.stack.push(layer); } return this; }; /** * Create a new Route for the given path. * * Each route contains a separate middleware stack and VERB handlers. * * See the Route api documentation for details on adding handlers * and middleware to routes. * * @param {String} path * @return {Route} * @public */ proto.route = function route(path) { var route = new Route(path); var layer = new Layer(path, { sensitive: this.caseSensitive, strict: this.strict, end: true }, route.dispatch.bind(route)); layer.route = route; this.stack.push(layer); return route; }; // create Router#VERB functions methods.concat('all').forEach(function (method) { proto[method] = function (path) { var route = this.route(path); route[method].apply(route, slice.call(arguments, 1)); return this; }; }); // append methods to a list of methods function appendMethods(list, addition) { for (var i = 0; i < addition.length; i++) { var method = addition[i]; if (list.indexOf(method) === -1) { list.push(method); } } } // get pathname of request function getPathname(req) { try { return parseUrl(req).pathname; } catch (err) { return undefined; } } // Get get protocol + host for a URL function getProtohost(url) { if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { return undefined; } var searchIndex = url.indexOf('?'); var pathLength = searchIndex !== -1 ? searchIndex : url.length; var fqdnIndex = url.substr(0, pathLength).indexOf('://'); return fqdnIndex !== -1 ? url.substr(0, url.indexOf('/', 3 + fqdnIndex)) : undefined; } // get type for error message function gettype(obj) { var type = typeof obj === 'undefined' ? 'undefined' : _typeof(obj); if (type !== 'object') { return type; } // inspect [[Class]] for objects return toString.call(obj).replace(objectRegExp, '$1'); } /** * Match path to a layer. * * @param {Layer} layer * @param {string} path * @private */ function matchLayer(layer, path) { try { return layer.match(path); } catch (err) { return err; } } // merge params with parent params function mergeParams(params, parent) { if ((typeof parent === 'undefined' ? 'undefined' : _typeof(parent)) !== 'object' || !parent) { return params; } // make copy of parent for base var obj = mixin({}, parent); // simple non-numeric merging if (!(0 in params) || !(0 in parent)) { return mixin(obj, params); } var i = 0; var o = 0; // determine numeric gaps while (i in params) { i++; } while (o in parent) { o++; } // offset numeric indices in params before merge for (i--; i >= 0; i--) { params[i + o] = params[i]; // create holes for the merge when necessary if (i < o) { delete params[i]; } } return mixin(obj, params); } // restore obj props after function function restore(fn, obj) { var props = new Array(arguments.length - 2); var vals = new Array(arguments.length - 2); for (var i = 0; i < props.length; i++) { props[i] = arguments[i + 2]; vals[i] = obj[props[i]]; } return function () { // restore vals for (var i = 0; i < props.length; i++) { obj[props[i]] = vals[i]; } return fn.apply(this, arguments); }; } // send an OPTIONS response function sendOptionsResponse(res, options, next) { try { var body = options.join(','); res.set('Allow', body); res.send(body); } catch (err) { next(err); } } // wrap a function function wrap(old, fn) { return function proxy() { var args = new Array(arguments.length + 1); args[0] = old; for (var i = 0, len = arguments.length; i < len; i++) { args[i + 1] = arguments[i]; } fn.apply(this, args); }; } /***/ }), /***/ "./node_modules/express/lib/router/layer.js": /*!**************************************************!*\ !*** ./node_modules/express/lib/router/layer.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var pathRegexp = __webpack_require__(/*! path-to-regexp */ "./node_modules/path-to-regexp/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('express:router:layer'); /** * Module variables. * @private */ var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Module exports. * @public */ module.exports = Layer; function Layer(path, options, fn) { if (!(this instanceof Layer)) { return new Layer(path, options, fn); } debug('new %o', path); var opts = options || {}; this.handle = fn; this.name = fn.name || '<anonymous>'; this.params = undefined; this.path = undefined; this.regexp = pathRegexp(path, this.keys = [], opts); // set fast path flags this.regexp.fast_star = path === '*'; this.regexp.fast_slash = path === '/' && opts.end === false; } /** * Handle the error for the layer. * * @param {Error} error * @param {Request} req * @param {Response} res * @param {function} next * @api private */ Layer.prototype.handle_error = function handle_error(error, req, res, next) { var fn = this.handle; if (fn.length !== 4) { // not a standard error handler return next(error); } try { fn(error, req, res, next); } catch (err) { next(err); } }; /** * Handle the request for the layer. * * @param {Request} req * @param {Response} res * @param {function} next * @api private */ Layer.prototype.handle_request = function handle(req, res, next) { var fn = this.handle; if (fn.length > 3) { // not a standard request handler return next(); } try { fn(req, res, next); } catch (err) { next(err); } }; /** * Check if this route matches `path`, if so * populate `.params`. * * @param {String} path * @return {Boolean} * @api private */ Layer.prototype.match = function match(path) { var match; if (path != null) { // fast path non-ending match for / (any path matches) if (this.regexp.fast_slash) { this.params = {}; this.path = ''; return true; } // fast path for * (everything matched in a param) if (this.regexp.fast_star) { this.params = { '0': decode_param(path) }; this.path = path; return true; } // match the path match = this.regexp.exec(path); } if (!match) { this.params = undefined; this.path = undefined; return false; } // store values this.params = {}; this.path = match[0]; var keys = this.keys; var params = this.params; for (var i = 1; i < match.length; i++) { var key = keys[i - 1]; var prop = key.name; var val = decode_param(match[i]); if (val !== undefined || !hasOwnProperty.call(params, prop)) { params[prop] = val; } } return true; }; /** * Decode param value. * * @param {string} val * @return {string} * @private */ function decode_param(val) { if (typeof val !== 'string' || val.length === 0) { return val; } try { return decodeURIComponent(val); } catch (err) { if (err instanceof URIError) { err.message = 'Failed to decode param \'' + val + '\''; err.status = err.statusCode = 400; } throw err; } } /***/ }), /***/ "./node_modules/express/lib/router/route.js": /*!**************************************************!*\ !*** ./node_modules/express/lib/router/route.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('express:router:route'); var flatten = __webpack_require__(/*! array-flatten */ "./node_modules/array-flatten/array-flatten.js"); var Layer = __webpack_require__(/*! ./layer */ "./node_modules/express/lib/router/layer.js"); var methods = __webpack_require__(/*! methods */ "./node_modules/methods/index.js"); /** * Module variables. * @private */ var slice = Array.prototype.slice; var toString = Object.prototype.toString; /** * Module exports. * @public */ module.exports = Route; /** * Initialize `Route` with the given `path`, * * @param {String} path * @public */ function Route(path) { this.path = path; this.stack = []; debug('new %o', path); // route handlers for various http methods this.methods = {}; } /** * Determine if the route handles a given method. * @private */ Route.prototype._handles_method = function _handles_method(method) { if (this.methods._all) { return true; } var name = method.toLowerCase(); if (name === 'head' && !this.methods['head']) { name = 'get'; } return Boolean(this.methods[name]); }; /** * @return {Array} supported HTTP methods * @private */ Route.prototype._options = function _options() { var methods = Object.keys(this.methods); // append automatic head if (this.methods.get && !this.methods.head) { methods.push('head'); } for (var i = 0; i < methods.length; i++) { // make upper case methods[i] = methods[i].toUpperCase(); } return methods; }; /** * dispatch req, res into this route * @private */ Route.prototype.dispatch = function dispatch(req, res, done) { var idx = 0; var stack = this.stack; if (stack.length === 0) { return done(); } var method = req.method.toLowerCase(); if (method === 'head' && !this.methods['head']) { method = 'get'; } req.route = this; next(); function next(err) { // signal to exit route if (err && err === 'route') { return done(); } // signal to exit router if (err && err === 'router') { return done(err); } var layer = stack[idx++]; if (!layer) { return done(err); } if (layer.method && layer.method !== method) { return next(err); } if (err) { layer.handle_error(err, req, res, next); } else { layer.handle_request(req, res, next); } } }; /** * Add a handler for all HTTP verbs to this route. * * Behaves just like middleware and can respond or call `next` * to continue processing. * * You can use multiple `.all` call to add multiple handlers. * * function check_something(req, res, next){ * next(); * }; * * function validate_user(req, res, next){ * next(); * }; * * route * .all(validate_user) * .all(check_something) * .get(function(req, res, next){ * res.send('hello world'); * }); * * @param {function} handler * @return {Route} for chaining * @api public */ Route.prototype.all = function all() { var handles = flatten(slice.call(arguments)); for (var i = 0; i < handles.length; i++) { var handle = handles[i]; if (typeof handle !== 'function') { var type = toString.call(handle); var msg = 'Route.all() requires a callback function but got a ' + type; throw new TypeError(msg); } var layer = Layer('/', {}, handle); layer.method = undefined; this.methods._all = true; this.stack.push(layer); } return this; }; methods.forEach(function (method) { Route.prototype[method] = function () { var handles = flatten(slice.call(arguments)); for (var i = 0; i < handles.length; i++) { var handle = handles[i]; if (typeof handle !== 'function') { var type = toString.call(handle); var msg = 'Route.' + method + '() requires a callback function but got a ' + type; throw new Error(msg); } debug('%s %o', method, this.path); var layer = Layer('/', {}, handle); layer.method = method; this.methods[method] = true; this.stack.push(layer); } return this; }; }); /***/ }), /***/ "./node_modules/express/lib/utils.js": /*!*******************************************!*\ !*** ./node_modules/express/lib/utils.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @api private */ var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/express/node_modules/safe-buffer/index.js").Buffer; var contentDisposition = __webpack_require__(/*! content-disposition */ "./node_modules/content-disposition/index.js"); var contentType = __webpack_require__(/*! content-type */ "./node_modules/content-type/index.js"); var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('express'); var flatten = __webpack_require__(/*! array-flatten */ "./node_modules/array-flatten/array-flatten.js"); var mime = __webpack_require__(/*! send */ "./node_modules/send/index.js").mime; var etag = __webpack_require__(/*! etag */ "./node_modules/etag/index.js"); var proxyaddr = __webpack_require__(/*! proxy-addr */ "./node_modules/proxy-addr/index.js"); var qs = __webpack_require__(/*! qs */ "./node_modules/qs/lib/index.js"); var querystring = __webpack_require__(/*! querystring */ "querystring"); /** * Return strong ETag for `body`. * * @param {String|Buffer} body * @param {String} [encoding] * @return {String} * @api private */ exports.etag = createETagGenerator({ weak: false }); /** * Return weak ETag for `body`. * * @param {String|Buffer} body * @param {String} [encoding] * @return {String} * @api private */ exports.wetag = createETagGenerator({ weak: true }); /** * Check if `path` looks absolute. * * @param {String} path * @return {Boolean} * @api private */ exports.isAbsolute = function (path) { if ('/' === path[0]) return true; if (':' === path[1] && ('\\' === path[2] || '/' === path[2])) return true; // Windows device path if ('\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path }; /** * Flatten the given `arr`. * * @param {Array} arr * @return {Array} * @api private */ exports.flatten = deprecate.function(flatten, 'utils.flatten: use array-flatten npm module instead'); /** * Normalize the given `type`, for example "html" becomes "text/html". * * @param {String} type * @return {Object} * @api private */ exports.normalizeType = function (type) { return ~type.indexOf('/') ? acceptParams(type) : { value: mime.lookup(type), params: {} }; }; /** * Normalize `types`, for example "html" becomes "text/html". * * @param {Array} types * @return {Array} * @api private */ exports.normalizeTypes = function (types) { var ret = []; for (var i = 0; i < types.length; ++i) { ret.push(exports.normalizeType(types[i])); } return ret; }; /** * Generate Content-Disposition header appropriate for the filename. * non-ascii filenames are urlencoded and a filename* parameter is added * * @param {String} filename * @return {String} * @api private */ exports.contentDisposition = deprecate.function(contentDisposition, 'utils.contentDisposition: use content-disposition npm module instead'); /** * Parse accept params `str` returning an * object with `.value`, `.quality` and `.params`. * also includes `.originalIndex` for stable sorting * * @param {String} str * @return {Object} * @api private */ function acceptParams(str, index) { var parts = str.split(/ *; */); var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index }; for (var i = 1; i < parts.length; ++i) { var pms = parts[i].split(/ *= */); if ('q' === pms[0]) { ret.quality = parseFloat(pms[1]); } else { ret.params[pms[0]] = pms[1]; } } return ret; } /** * Compile "etag" value to function. * * @param {Boolean|String|Function} val * @return {Function} * @api private */ exports.compileETag = function (val) { var fn; if (typeof val === 'function') { return val; } switch (val) { case true: fn = exports.wetag; break; case false: break; case 'strong': fn = exports.etag; break; case 'weak': fn = exports.wetag; break; default: throw new TypeError('unknown value for etag function: ' + val); } return fn; }; /** * Compile "query parser" value to function. * * @param {String|Function} val * @return {Function} * @api private */ exports.compileQueryParser = function compileQueryParser(val) { var fn; if (typeof val === 'function') { return val; } switch (val) { case true: fn = querystring.parse; break; case false: fn = newObject; break; case 'extended': fn = parseExtendedQueryString; break; case 'simple': fn = querystring.parse; break; default: throw new TypeError('unknown value for query parser function: ' + val); } return fn; }; /** * Compile "proxy trust" value to function. * * @param {Boolean|String|Number|Array|Function} val * @return {Function} * @api private */ exports.compileTrust = function (val) { if (typeof val === 'function') return val; if (val === true) { // Support plain true/false return function () { return true; }; } if (typeof val === 'number') { // Support trusting hop count return function (a, i) { return i < val; }; } if (typeof val === 'string') { // Support comma-separated values val = val.split(/ *, */); } return proxyaddr.compile(val || []); }; /** * Set the charset in a given Content-Type string. * * @param {String} type * @param {String} charset * @return {String} * @api private */ exports.setCharset = function setCharset(type, charset) { if (!type || !charset) { return type; } // parse type var parsed = contentType.parse(type); // set charset parsed.parameters.charset = charset; // format type return contentType.format(parsed); }; /** * Create an ETag generator function, generating ETags with * the given options. * * @param {object} options * @return {function} * @private */ function createETagGenerator(options) { return function generateETag(body, encoding) { var buf = !Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body; return etag(buf, options); }; } /** * Parse an extended query string with qs. * * @return {Object} * @private */ function parseExtendedQueryString(str) { return qs.parse(str, { allowPrototypes: true }); } /** * Return new empty object. * * @return {Object} * @api private */ function newObject() { return {}; } /***/ }), /***/ "./node_modules/express/lib/view.js": /*!******************************************!*\ !*** ./node_modules/express/lib/view.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2013 Roman Shtylman * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('express:view'); var path = __webpack_require__(/*! path */ "path"); var fs = __webpack_require__(/*! fs */ "fs"); /** * Module variables. * @private */ var dirname = path.dirname; var basename = path.basename; var extname = path.extname; var join = path.join; var resolve = path.resolve; /** * Module exports. * @public */ module.exports = View; /** * Initialize a new `View` with the given `name`. * * Options: * * - `defaultEngine` the default template engine name * - `engines` template engine require() cache * - `root` root path for view lookup * * @param {string} name * @param {object} options * @public */ function View(name, options) { var opts = options || {}; this.defaultEngine = opts.defaultEngine; this.ext = extname(name); this.name = name; this.root = opts.root; if (!this.ext && !this.defaultEngine) { throw new Error('No default engine was specified and no extension was provided.'); } var fileName = name; if (!this.ext) { // get extension from default engine name this.ext = this.defaultEngine[0] !== '.' ? '.' + this.defaultEngine : this.defaultEngine; fileName += this.ext; } if (!opts.engines[this.ext]) { // load engine var mod = this.ext.substr(1); debug('require "%s"', mod); // default engine export var fn = __webpack_require__("./node_modules/express/lib sync recursive")(mod).__express; if (typeof fn !== 'function') { throw new Error('Module "' + mod + '" does not provide a view engine.'); } opts.engines[this.ext] = fn; } // store loaded engine this.engine = opts.engines[this.ext]; // lookup path this.path = this.lookup(fileName); } /** * Lookup view by the given `name` * * @param {string} name * @private */ View.prototype.lookup = function lookup(name) { var path; var roots = [].concat(this.root); debug('lookup "%s"', name); for (var i = 0; i < roots.length && !path; i++) { var root = roots[i]; // resolve the path var loc = resolve(root, name); var dir = dirname(loc); var file = basename(loc); // resolve the file path = this.resolve(dir, file); } return path; }; /** * Render with the given options. * * @param {object} options * @param {function} callback * @private */ View.prototype.render = function render(options, callback) { debug('render "%s"', this.path); this.engine(this.path, options, callback); }; /** * Resolve the file within the given directory. * * @param {string} dir * @param {string} file * @private */ View.prototype.resolve = function resolve(dir, file) { var ext = this.ext; // <path>.<ext> var path = join(dir, file); var stat = tryStat(path); if (stat && stat.isFile()) { return path; } // <path>/index.<ext> path = join(dir, basename(file, ext), 'index' + ext); stat = tryStat(path); if (stat && stat.isFile()) { return path; } }; /** * Return a stat, maybe. * * @param {string} path * @return {fs.Stats} * @private */ function tryStat(path) { debug('stat "%s"', path); try { return fs.statSync(path); } catch (e) { return undefined; } } /***/ }), /***/ "./node_modules/express/node_modules/safe-buffer/index.js": /*!****************************************************************!*\ !*** ./node_modules/express/node_modules/safe-buffer/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(/*! buffer */ "buffer"); var Buffer = buffer.Buffer; // alternative to using Object.keys for old browsers function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer; } else { // Copy properties from require('buffer') copyProps(buffer, exports); exports.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length); } // Copy static methods from Buffer copyProps(Buffer, SafeBuffer); SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number'); } return Buffer(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number'); } var buf = Buffer(size); if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding); } else { buf.fill(fill); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number'); } return Buffer(size); }; SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number'); } return buffer.SlowBuffer(size); }; /***/ }), /***/ "./node_modules/finalhandler/index.js": /*!********************************************!*\ !*** ./node_modules/finalhandler/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * finalhandler * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('finalhandler'); var encodeUrl = __webpack_require__(/*! encodeurl */ "./node_modules/encodeurl/index.js"); var escapeHtml = __webpack_require__(/*! escape-html */ "./node_modules/escape-html/index.js"); var onFinished = __webpack_require__(/*! on-finished */ "./node_modules/on-finished/index.js"); var parseUrl = __webpack_require__(/*! parseurl */ "./node_modules/parseurl/index.js"); var statuses = __webpack_require__(/*! statuses */ "./node_modules/statuses/index.js"); var unpipe = __webpack_require__(/*! unpipe */ "./node_modules/unpipe/index.js"); /** * Module variables. * @private */ var DOUBLE_SPACE_REGEXP = /\x20{2}/g; var NEWLINE_REGEXP = /\n/g; /* istanbul ignore next */ var defer = typeof setImmediate === 'function' ? setImmediate : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)); }; var isFinished = onFinished.isFinished; /** * Create a minimal HTML document. * * @param {string} message * @private */ function createHtmlDocument(message) { var body = escapeHtml(message).replace(NEWLINE_REGEXP, '<br>').replace(DOUBLE_SPACE_REGEXP, ' &nbsp;'); return '<!DOCTYPE html>\n' + '<html lang="en">\n' + '<head>\n' + '<meta charset="utf-8">\n' + '<title>Error</title>\n' + '</head>\n' + '<body>\n' + '<pre>' + body + '</pre>\n' + '</body>\n' + '</html>\n'; } /** * Module exports. * @public */ module.exports = finalhandler; /** * Create a function to handle the final response. * * @param {Request} req * @param {Response} res * @param {Object} [options] * @return {Function} * @public */ function finalhandler(req, res, options) { var opts = options || {}; // get environment var env = opts.env || "development" || 'development'; // get error callback var onerror = opts.onerror; return function (err) { var headers; var msg; var status; // ignore 404 on in-flight response if (!err && headersSent(res)) { debug('cannot 404 after headers sent'); return; } // unhandled error if (err) { // respect status code from error status = getErrorStatusCode(err); if (status === undefined) { // fallback to status code on response status = getResponseStatusCode(res); } else { // respect headers from error headers = getErrorHeaders(err); } // get error message msg = getErrorMessage(err, status, env); } else { // not found status = 404; msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req)); } debug('default %s', status); // schedule onerror callback if (err && onerror) { defer(onerror, err, req, res); } // cannot actually respond if (headersSent(res)) { debug('cannot %d after headers sent', status); req.socket.destroy(); return; } // send response send(req, res, status, headers, msg); }; } /** * Get headers from Error object. * * @param {Error} err * @return {object} * @private */ function getErrorHeaders(err) { if (!err.headers || _typeof(err.headers) !== 'object') { return undefined; } var headers = Object.create(null); var keys = Object.keys(err.headers); for (var i = 0; i < keys.length; i++) { var key = keys[i]; headers[key] = err.headers[key]; } return headers; } /** * Get message from Error object, fallback to status message. * * @param {Error} err * @param {number} status * @param {string} env * @return {string} * @private */ function getErrorMessage(err, status, env) { var msg; if (env !== 'production') { // use err.stack, which typically includes err.message msg = err.stack; // fallback to err.toString() when possible if (!msg && typeof err.toString === 'function') { msg = err.toString(); } } return msg || statuses[status]; } /** * Get status code from Error object. * * @param {Error} err * @return {number} * @private */ function getErrorStatusCode(err) { // check err.status if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { return err.status; } // check err.statusCode if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { return err.statusCode; } return undefined; } /** * Get resource name for the request. * * This is typically just the original pathname of the request * but will fallback to "resource" is that cannot be determined. * * @param {IncomingMessage} req * @return {string} * @private */ function getResourceName(req) { try { return parseUrl.original(req).pathname; } catch (e) { return 'resource'; } } /** * Get status code from response. * * @param {OutgoingMessage} res * @return {number} * @private */ function getResponseStatusCode(res) { var status = res.statusCode; // default status code to 500 if outside valid range if (typeof status !== 'number' || status < 400 || status > 599) { status = 500; } return status; } /** * Determine if the response headers have been sent. * * @param {object} res * @returns {boolean} * @private */ function headersSent(res) { return typeof res.headersSent !== 'boolean' ? Boolean(res._header) : res.headersSent; } /** * Send response. * * @param {IncomingMessage} req * @param {OutgoingMessage} res * @param {number} status * @param {object} headers * @param {string} message * @private */ function send(req, res, status, headers, message) { function write() { // response body var body = createHtmlDocument(message); // response status res.statusCode = status; res.statusMessage = statuses[status]; // response headers setHeaders(res, headers); // security headers res.setHeader('Content-Security-Policy', "default-src 'self'"); res.setHeader('X-Content-Type-Options', 'nosniff'); // standard headers res.setHeader('Content-Type', 'text/html; charset=utf-8'); res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')); if (req.method === 'HEAD') { res.end(); return; } res.end(body, 'utf8'); } if (isFinished(req)) { write(); return; } // unpipe everything from the request unpipe(req); // flush the request onFinished(req, write); req.resume(); } /** * Set response headers from an object. * * @param {OutgoingMessage} res * @param {object} headers * @private */ function setHeaders(res, headers) { if (!headers) { return; } var keys = Object.keys(headers); for (var i = 0; i < keys.length; i++) { var key = keys[i]; res.setHeader(key, headers[key]); } } /***/ }), /***/ "./node_modules/forwarded/index.js": /*!*****************************************!*\ !*** ./node_modules/forwarded/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * forwarded * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = forwarded; /** * Get all addresses in the request, using the `X-Forwarded-For` header. * * @param {object} req * @return {array} * @public */ function forwarded(req) { if (!req) { throw new TypeError('argument req is required'); } // simple header parsing var proxyAddrs = parse(req.headers['x-forwarded-for'] || ''); var socketAddr = req.connection.remoteAddress; var addrs = [socketAddr].concat(proxyAddrs); // return all addresses return addrs; } /** * Parse the X-Forwarded-For header. * * @param {string} header * @private */ function parse(header) { var end = header.length; var list = []; var start = header.length; // gather addresses, backwards for (var i = header.length - 1; i >= 0; i--) { switch (header.charCodeAt(i)) { case 0x20: /* */ if (start === end) { start = end = i; } break; case 0x2c: /* , */ if (start !== end) { list.push(header.substring(start, end)); } start = end = i; break; default: start = i; break; } } // final address if (start !== end) { list.push(header.substring(start, end)); } return list; } /***/ }), /***/ "./node_modules/fresh/index.js": /*!*************************************!*\ !*** ./node_modules/fresh/index.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * fresh * Copyright(c) 2012 TJ Holowaychuk * Copyright(c) 2016-2017 Douglas Christopher Wilson * MIT Licensed */ /** * RegExp to check for no-cache token in Cache-Control. * @private */ var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/; /** * Module exports. * @public */ module.exports = fresh; /** * Check freshness of the response using request and response headers. * * @param {Object} reqHeaders * @param {Object} resHeaders * @return {Boolean} * @public */ function fresh(reqHeaders, resHeaders) { // fields var modifiedSince = reqHeaders['if-modified-since']; var noneMatch = reqHeaders['if-none-match']; // unconditional request if (!modifiedSince && !noneMatch) { return false; } // Always return stale when Cache-Control: no-cache // to support end-to-end reload requests // https://tools.ietf.org/html/rfc2616#section-14.9.4 var cacheControl = reqHeaders['cache-control']; if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { return false; } // if-none-match if (noneMatch && noneMatch !== '*') { var etag = resHeaders['etag']; if (!etag) { return false; } var etagStale = true; var matches = parseTokenList(noneMatch); for (var i = 0; i < matches.length; i++) { var match = matches[i]; if (match === etag || match === 'W/' + etag || 'W/' + match === etag) { etagStale = false; break; } } if (etagStale) { return false; } } // if-modified-since if (modifiedSince) { var lastModified = resHeaders['last-modified']; var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince)); if (modifiedStale) { return false; } } return true; } /** * Parse an HTTP Date into a number. * * @param {string} date * @private */ function parseHttpDate(date) { var timestamp = date && Date.parse(date); // istanbul ignore next: guard against date.js Date.parse patching return typeof timestamp === 'number' ? timestamp : NaN; } /** * Parse a HTTP token list. * * @param {string} str * @private */ function parseTokenList(str) { var end = 0; var list = []; var start = 0; // gather tokens for (var i = 0, len = str.length; i < len; i++) { switch (str.charCodeAt(i)) { case 0x20: /* */ if (start === end) { start = end = i + 1; } break; case 0x2c: /* , */ list.push(str.substring(start, end)); start = end = i + 1; break; default: end = i + 1; break; } } // final token list.push(str.substring(start, end)); return list; } /***/ }), /***/ "./node_modules/http-errors/index.js": /*!*******************************************!*\ !*** ./node_modules/http-errors/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * http-errors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('http-errors'); var setPrototypeOf = __webpack_require__(/*! setprototypeof */ "./node_modules/setprototypeof/index.js"); var statuses = __webpack_require__(/*! statuses */ "./node_modules/http-errors/node_modules/statuses/index.js"); var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits.js"); /** * Module exports. * @public */ module.exports = createError; module.exports.HttpError = createHttpErrorConstructor(); // Populate exports for all constructors populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError); /** * Get the code class of a status code. * @private */ function codeClass(status) { return Number(String(status).charAt(0) + '00'); } /** * Create a new HTTP Error. * * @returns {Error} * @public */ function createError() { // so much arity going on ~_~ var err; var msg; var status = 500; var props = {}; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (arg instanceof Error) { err = arg; status = err.status || err.statusCode || status; continue; } switch (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) { case 'string': msg = arg; break; case 'number': status = arg; if (i !== 0) { deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)'); } break; case 'object': props = arg; break; } } if (typeof status === 'number' && (status < 400 || status >= 600)) { deprecate('non-error status code; use only 4xx or 5xx status codes'); } if (typeof status !== 'number' || !statuses[status] && (status < 400 || status >= 600)) { status = 500; } // constructor var HttpError = createError[status] || createError[codeClass(status)]; if (!err) { // create error err = HttpError ? new HttpError(msg) : new Error(msg || statuses[status]); Error.captureStackTrace(err, createError); } if (!HttpError || !(err instanceof HttpError) || err.status !== status) { // add properties to generic error err.expose = status < 500; err.status = err.statusCode = status; } for (var key in props) { if (key !== 'status' && key !== 'statusCode') { err[key] = props[key]; } } return err; } /** * Create HTTP error abstract base class. * @private */ function createHttpErrorConstructor() { function HttpError() { throw new TypeError('cannot construct abstract class'); } inherits(HttpError, Error); return HttpError; } /** * Create a constructor for a client error. * @private */ function createClientErrorConstructor(HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error'; function ClientError(message) { // create the error object var msg = message != null ? message : statuses[code]; var err = new Error(msg); // capture a stack trace to the construction point Error.captureStackTrace(err, ClientError); // adjust the [[Prototype]] setPrototypeOf(err, ClientError.prototype); // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }); // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ClientError, HttpError); ClientError.prototype.status = code; ClientError.prototype.statusCode = code; ClientError.prototype.expose = true; return ClientError; } /** * Create a constructor for a server error. * @private */ function createServerErrorConstructor(HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error'; function ServerError(message) { // create the error object var msg = message != null ? message : statuses[code]; var err = new Error(msg); // capture a stack trace to the construction point Error.captureStackTrace(err, ServerError); // adjust the [[Prototype]] setPrototypeOf(err, ServerError.prototype); // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }); // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ServerError, HttpError); ServerError.prototype.status = code; ServerError.prototype.statusCode = code; ServerError.prototype.expose = false; return ServerError; } /** * Populate the exports object with constructors for every error class. * @private */ function populateConstructorExports(exports, codes, HttpError) { codes.forEach(function forEachCode(code) { var CodeError; var name = toIdentifier(statuses[code]); switch (codeClass(code)) { case 400: CodeError = createClientErrorConstructor(HttpError, name, code); break; case 500: CodeError = createServerErrorConstructor(HttpError, name, code); break; } if (CodeError) { // export the constructor exports[code] = CodeError; exports[name] = CodeError; } }); // backwards-compatibility exports["I'mateapot"] = deprecate.function(exports.ImATeapot, '"I\'mateapot"; use "ImATeapot" instead'); } /** * Convert a string of words to a JavaScript identifier. * @private */ function toIdentifier(str) { return str.split(' ').map(function (token) { return token.slice(0, 1).toUpperCase() + token.slice(1); }).join('').replace(/[^ _0-9a-z]/gi, ''); } /***/ }), /***/ "./node_modules/http-errors/node_modules/statuses/codes.json": /*!*******************************************************************!*\ !*** ./node_modules/http-errors/node_modules/statuses/codes.json ***! \*******************************************************************/ /*! exports provided: 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, default */ /***/ (function(module) { module.exports = {"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}; /***/ }), /***/ "./node_modules/http-errors/node_modules/statuses/index.js": /*!*****************************************************************!*\ !*** ./node_modules/http-errors/node_modules/statuses/index.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * statuses * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var codes = __webpack_require__(/*! ./codes.json */ "./node_modules/http-errors/node_modules/statuses/codes.json"); /** * Module exports. * @public */ module.exports = status; // status code to message map status.STATUS_CODES = codes; // array of status codes status.codes = populateStatusesMap(status, codes); // status codes for redirects status.redirect = { 300: true, 301: true, 302: true, 303: true, 305: true, 307: true, 308: true // status codes for empty bodies };status.empty = { 204: true, 205: true, 304: true // status codes for when you should retry the request };status.retry = { 502: true, 503: true, 504: true /** * Populate the statuses map for given codes. * @private */ };function populateStatusesMap(statuses, codes) { var arr = []; Object.keys(codes).forEach(function forEachCode(code) { var message = codes[code]; var status = Number(code); // Populate properties statuses[status] = message; statuses[message] = status; statuses[message.toLowerCase()] = status; // Add to array arr.push(status); }); return arr; } /** * Get the status code. * * Given a number, this will throw if it is not a known status * code, otherwise the code will be returned. Given a string, * the string will be parsed for a number and return the code * if valid, otherwise will lookup the code assuming this is * the status message. * * @param {string|number} code * @returns {number} * @public */ function status(code) { if (typeof code === 'number') { if (!status[code]) throw new Error('invalid status code: ' + code); return code; } if (typeof code !== 'string') { throw new TypeError('code must be a number or string'); } // '403' var n = parseInt(code, 10); if (!isNaN(n)) { if (!status[n]) throw new Error('invalid status code: ' + n); return n; } n = status[code.toLowerCase()]; if (!n) throw new Error('invalid status message: "' + code + '"'); return n; } /***/ }), /***/ "./node_modules/iconv-lite/encodings/dbcs-codec.js": /*!*********************************************************!*\ !*** ./node_modules/iconv-lite/encodings/dbcs-codec.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer; // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. exports._dbcs = DBCSCodec; var UNASSIGNED = -1, GB18030_CODE = -2, SEQ_START = -10, NODE_START = -1000, UNASSIGNED_NODE = new Array(0x100), DEF_CHAR = -1; for (var i = 0; i < 0x100; i++) { UNASSIGNED_NODE[i] = UNASSIGNED; } // Class DBCSCodec reads and initializes mapping tables. function DBCSCodec(codecOptions, iconv) { this.encodingName = codecOptions.encodingName; if (!codecOptions) throw new Error("DBCS codec is called without the data."); if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); // Load tables. var mappingTable = codecOptions.table(); // Decode tables: MBCS -> Unicode. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. // Trie root is decodeTables[0]. // Values: >= 0 -> unicode character code. can be > 0xFFFF // == UNASSIGNED -> unknown/unassigned sequence. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. // <= NODE_START -> index of the next node in our trie to process next byte. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. this.decodeTables = []; this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = []; // Actual mapping tables consist of chunks. Use them to fill up decode tables. for (var i = 0; i < mappingTable.length; i++) { this._addDecodeChunk(mappingTable[i]); }this.defaultCharUnicode = iconv.defaultCharUnicode; // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = []; // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). // Objects are kept separately from encodeTable to increase performance. this.encodeTableSeq = []; // Some chars can be decoded, but need not be encoded. var skipEncodeChars = {}; if (codecOptions.encodeSkipVals) for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { var val = codecOptions.encodeSkipVals[i]; if (typeof val === 'number') skipEncodeChars[val] = true;else for (var j = val.from; j <= val.to; j++) { skipEncodeChars[j] = true; } } // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars); // Add more encoding pairs when needed. if (codecOptions.encodeAdd) { for (var uChar in codecOptions.encodeAdd) { if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); } } this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); // Load & create GB18030 tables when needed. if (typeof codecOptions.gb18030 === 'function') { this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. // Add GB18030 decode tables. var thirdByteNodeIdx = this.decodeTables.length; var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); var fourthByteNodeIdx = this.decodeTables.length; var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); for (var i = 0x81; i <= 0xFE; i++) { var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; var secondByteNode = this.decodeTables[secondByteNodeIdx]; for (var j = 0x30; j <= 0x39; j++) { secondByteNode[j] = NODE_START - thirdByteNodeIdx; } } for (var i = 0x81; i <= 0xFE; i++) { thirdByteNode[i] = NODE_START - fourthByteNodeIdx; }for (var i = 0x30; i <= 0x39; i++) { fourthByteNode[i] = GB18030_CODE; } } } DBCSCodec.prototype.encoder = DBCSEncoder; DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function (addr) { var bytes = []; for (; addr > 0; addr >>= 8) { bytes.push(addr & 0xFF); }if (bytes.length == 0) bytes.push(0); var node = this.decodeTables[0]; for (var i = bytes.length - 1; i > 0; i--) { // Traverse nodes deeper into the trie. var val = node[bytes[i]]; if (val == UNASSIGNED) { // Create new node. node[bytes[i]] = NODE_START - this.decodeTables.length; this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); } else if (val <= NODE_START) { // Existing node. node = this.decodeTables[NODE_START - val]; } else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } return node; }; DBCSCodec.prototype._addDecodeChunk = function (chunk) { // First element of chunk is the hex mbcs code where we start. var curAddr = parseInt(chunk[0], 16); // Choose the decoding node where we'll write our chars. var writeTable = this._getDecodeTrieNode(curAddr); curAddr = curAddr & 0xFF; // Write all other elements of the chunk to the table. for (var k = 1; k < chunk.length; k++) { var part = chunk[k]; if (typeof part === "string") { // String, write as-is. for (var l = 0; l < part.length;) { var code = part.charCodeAt(l++); if (0xD800 <= code && code < 0xDC00) { // Decode surrogate var codeTrail = part.charCodeAt(l++); if (0xDC00 <= codeTrail && codeTrail < 0xE000) writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); } else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) var len = 0xFFF - code + 2; var seq = []; for (var m = 0; m < len; m++) { seq.push(part.charCodeAt(l++)); } // Simple variation: don't support surrogates or subsequences in seq. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; this.decodeTableSeq.push(seq); } else writeTable[curAddr++] = code; // Basic char } } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. var charCode = writeTable[curAddr - 1] + 1; for (var l = 0; l < part; l++) { writeTable[curAddr++] = charCode++; } } else throw new Error("Incorrect type '" + (typeof part === "undefined" ? "undefined" : _typeof(part)) + "' given in " + this.encodingName + " at chunk " + chunk[0]); } if (curAddr > 0xFF) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); }; // Encoder helpers DBCSCodec.prototype._getEncodeBucket = function (uCode) { var high = uCode >> 8; // This could be > 0xFF because of astral characters. if (this.encodeTable[high] === undefined) this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. return this.encodeTable[high]; }; DBCSCodec.prototype._setEncodeChar = function (uCode, dbcsCode) { var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; if (bucket[low] <= SEQ_START) this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. else if (bucket[low] == UNASSIGNED) bucket[low] = dbcsCode; }; DBCSCodec.prototype._setEncodeSequence = function (seq, dbcsCode) { // Get the root of character tree according to first character of the sequence. var uCode = seq[0]; var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; var node; if (bucket[low] <= SEQ_START) { // There's already a sequence with - use it. node = this.encodeTableSeq[SEQ_START - bucket[low]]; } else { // There was no sequence object - allocate a new one. node = {}; if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. bucket[low] = SEQ_START - this.encodeTableSeq.length; this.encodeTableSeq.push(node); } // Traverse the character tree, allocating new nodes as needed. for (var j = 1; j < seq.length - 1; j++) { var oldVal = node[uCode]; if ((typeof oldVal === "undefined" ? "undefined" : _typeof(oldVal)) === 'object') node = oldVal;else { node = node[uCode] = {}; if (oldVal !== undefined) node[DEF_CHAR] = oldVal; } } // Set the leaf to given dbcsCode. uCode = seq[seq.length - 1]; node[uCode] = dbcsCode; }; DBCSCodec.prototype._fillEncodeTable = function (nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; if (uCode >= 0) this._setEncodeChar(uCode, mbCode);else if (uCode <= NODE_START) this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);else if (uCode <= SEQ_START) this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); } }; // == Encoder ================================================================== function DBCSEncoder(options, codec) { // Encoder state this.leadSurrogate = -1; this.seqObj = undefined; // Static data this.encodeTable = codec.encodeTable; this.encodeTableSeq = codec.encodeTableSeq; this.defaultCharSingleByte = codec.defCharSB; this.gb18030 = codec.gb18030; } DBCSEncoder.prototype.write = function (str) { var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; while (true) { // 0. Get next character. if (nextChar === -1) { if (i == str.length) break; var uCode = str.charCodeAt(i++); } else { var uCode = nextChar; nextChar = -1; } // 1. Handle surrogates. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. if (uCode < 0xDC00) { // We've got lead surrogate. if (leadSurrogate === -1) { leadSurrogate = uCode; continue; } else { leadSurrogate = uCode; // Double lead surrogate found. uCode = UNASSIGNED; } } else { // We've got trail surrogate. if (leadSurrogate !== -1) { uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); leadSurrogate = -1; } else { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED; } } } else if (leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. nextChar = uCode;uCode = UNASSIGNED; // Write an error, then current char. leadSurrogate = -1; } // 2. Convert uCode character. var dbcsCode = UNASSIGNED; if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence var resCode = seqObj[uCode]; if ((typeof resCode === "undefined" ? "undefined" : _typeof(resCode)) === 'object') { // Sequence continues. seqObj = resCode; continue; } else if (typeof resCode == 'number') { // Sequence finished. Write it. dbcsCode = resCode; } else if (resCode == undefined) { // Current character is not part of the sequence. // Try default character for this sequence resCode = seqObj[DEF_CHAR]; if (resCode !== undefined) { dbcsCode = resCode; // Found. Write it. nextChar = uCode; // Current character will be written too in the next iteration. } else { // TODO: What if we have no default? (resCode == undefined) // Then, we should write first char of the sequence as-is and try the rest recursively. // Didn't do it for now because no encoding has this situation yet. // Currently, just skip the sequence and write current char. } } seqObj = undefined; } else if (uCode >= 0) { // Regular character var subtable = this.encodeTable[uCode >> 8]; if (subtable !== undefined) dbcsCode = subtable[uCode & 0xFF]; if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START - dbcsCode]; continue; } if (dbcsCode == UNASSIGNED && this.gb18030) { // Use GB18030 algorithm to find character(s) to write. var idx = findIdx(this.gb18030.uChars, uCode); if (idx != -1) { var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600);dbcsCode = dbcsCode % 12600; newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260);dbcsCode = dbcsCode % 1260; newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10);dbcsCode = dbcsCode % 10; newBuf[j++] = 0x30 + dbcsCode; continue; } } } // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte; if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else if (dbcsCode < 0x10000) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } else { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = dbcsCode >> 8 & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } } this.seqObj = seqObj; this.leadSurrogate = leadSurrogate; return newBuf.slice(0, j); }; DBCSEncoder.prototype.end = function () { if (this.leadSurrogate === -1 && this.seqObj === undefined) return; // All clean. Most often case. var newBuf = new Buffer(10), j = 0; if (this.seqObj) { // We're in the sequence. var dbcsCode = this.seqObj[DEF_CHAR]; if (dbcsCode !== undefined) { // Write beginning of the sequence. if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } } else { // See todo above. } this.seqObj = undefined; } if (this.leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. newBuf[j++] = this.defaultCharSingleByte; this.leadSurrogate = -1; } return newBuf.slice(0, j); }; // Export for testing DBCSEncoder.prototype.findIdx = findIdx; // == Decoder ================================================================== function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; this.prevBuf = new Buffer(0); // Static data this.decodeTables = codec.decodeTables; this.decodeTableSeq = codec.decodeTableSeq; this.defaultCharUnicode = codec.defaultCharUnicode; this.gb18030 = codec.gb18030; } DBCSDecoder.prototype.write = function (buf) { var newBuf = new Buffer(buf.length * 2), nodeIdx = this.nodeIdx, prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. uCode; if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); for (var i = 0, j = 0; i < buf.length; i++) { var curByte = i >= 0 ? buf[i] : prevBuf[i + prevBufOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). uCode = this.defaultCharUnicode.charCodeAt(0); } else if (uCode === GB18030_CODE) { var curSeq = seqStart >= 0 ? buf.slice(seqStart, i + 1) : prevBuf.slice(seqStart + prevBufOffset, i + 1 + prevBufOffset); var ptr = (curSeq[0] - 0x81) * 12600 + (curSeq[1] - 0x30) * 1260 + (curSeq[2] - 0x81) * 10 + (curSeq[3] - 0x30); var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } else if (uCode <= NODE_START) { // Go to next trie node. nodeIdx = NODE_START - uCode; continue; } else if (uCode <= SEQ_START) { // Output a sequence of chars. var seq = this.decodeTableSeq[SEQ_START - uCode]; for (var k = 0; k < seq.length - 1; k++) { uCode = seq[k]; newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; } uCode = seq[seq.length - 1]; } else throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. if (uCode > 0xFFFF) { uCode -= 0x10000; var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; uCode = 0xDC00 + uCode % 0x400; } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; // Reset trie node. nodeIdx = 0;seqStart = i + 1; } this.nodeIdx = nodeIdx; this.prevBuf = seqStart >= 0 ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); return newBuf.slice(0, j).toString('ucs2'); }; DBCSDecoder.prototype.end = function () { var ret = ''; // Try to parse all remaining chars. while (this.prevBuf.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; var buf = this.prevBuf.slice(1); // Parse remaining as usual. this.prevBuf = new Buffer(0); this.nodeIdx = 0; if (buf.length > 0) ret += this.write(buf); } this.nodeIdx = 0; return ret; }; // Binary search for GB18030. Returns largest i such that table[i] <= val. function findIdx(table, val) { if (table[0] > val) return -1; var l = 0, r = table.length; while (l < r - 1) { // always table[l] <= val < table[r] var mid = l + Math.floor((r - l + 1) / 2); if (table[mid] <= val) l = mid;else r = mid; } return l; } /***/ }), /***/ "./node_modules/iconv-lite/encodings/dbcs-data.js": /*!********************************************************!*\ !*** ./node_modules/iconv-lite/encodings/dbcs-data.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html 'shiftjis': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/shiftjis.json */ "./node_modules/iconv-lite/encodings/tables/shiftjis.json"); }, encodeAdd: { '\xA5': 0x5C, '\u203E': 0x7E }, encodeSkipVals: [{ from: 0xED40, to: 0xF940 }] }, 'csshiftjis': 'shiftjis', 'mskanji': 'shiftjis', 'sjis': 'shiftjis', 'windows31j': 'shiftjis', 'ms31j': 'shiftjis', 'xsjis': 'shiftjis', 'windows932': 'shiftjis', 'ms932': 'shiftjis', '932': 'shiftjis', 'cp932': 'shiftjis', 'eucjp': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/eucjp.json */ "./node_modules/iconv-lite/encodings/tables/eucjp.json"); }, encodeAdd: { '\xA5': 0x5C, '\u203E': 0x7E } }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 'gb2312': 'cp936', 'gb231280': 'cp936', 'gb23121980': 'cp936', 'csgb2312': 'cp936', 'csiso58gb231280': 'cp936', 'euccn': 'cp936', // Microsoft's CP936 is a subset and approximation of GBK. 'windows936': 'cp936', 'ms936': 'cp936', '936': 'cp936', 'cp936': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/cp936.json */ "./node_modules/iconv-lite/encodings/tables/cp936.json"); } }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. 'gbk': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/cp936.json */ "./node_modules/iconv-lite/encodings/tables/cp936.json").concat(__webpack_require__(/*! ./tables/gbk-added.json */ "./node_modules/iconv-lite/encodings/tables/gbk-added.json")); } }, 'xgbk': 'gbk', 'isoir58': 'gbk', // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 'gb18030': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/cp936.json */ "./node_modules/iconv-lite/encodings/tables/cp936.json").concat(__webpack_require__(/*! ./tables/gbk-added.json */ "./node_modules/iconv-lite/encodings/tables/gbk-added.json")); }, gb18030: function gb18030() { return __webpack_require__(/*! ./tables/gb18030-ranges.json */ "./node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"); }, encodeSkipVals: [0x80], encodeAdd: { '€': 0xA2E3 } }, 'chinese': 'gb18030', // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. 'windows949': 'cp949', 'ms949': 'cp949', '949': 'cp949', 'cp949': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/cp949.json */ "./node_modules/iconv-lite/encodings/tables/cp949.json"); } }, 'cseuckr': 'cp949', 'csksc56011987': 'cp949', 'euckr': 'cp949', 'isoir149': 'cp949', 'korean': 'cp949', 'ksc56011987': 'cp949', 'ksc56011989': 'cp949', 'ksc5601': 'cp949', // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. 'windows950': 'cp950', 'ms950': 'cp950', '950': 'cp950', 'cp950': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/cp950.json */ "./node_modules/iconv-lite/encodings/tables/cp950.json"); } }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. 'big5': 'big5hkscs', 'big5hkscs': { type: '_dbcs', table: function table() { return __webpack_require__(/*! ./tables/cp950.json */ "./node_modules/iconv-lite/encodings/tables/cp950.json").concat(__webpack_require__(/*! ./tables/big5-added.json */ "./node_modules/iconv-lite/encodings/tables/big5-added.json")); }, encodeSkipVals: [0xa2cc] }, 'cnbig5': 'big5hkscs', 'csbig5': 'big5hkscs', 'xxbig5': 'big5hkscs' }; /***/ }), /***/ "./node_modules/iconv-lite/encodings/index.js": /*!****************************************************!*\ !*** ./node_modules/iconv-lite/encodings/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [__webpack_require__(/*! ./internal */ "./node_modules/iconv-lite/encodings/internal.js"), __webpack_require__(/*! ./utf16 */ "./node_modules/iconv-lite/encodings/utf16.js"), __webpack_require__(/*! ./utf7 */ "./node_modules/iconv-lite/encodings/utf7.js"), __webpack_require__(/*! ./sbcs-codec */ "./node_modules/iconv-lite/encodings/sbcs-codec.js"), __webpack_require__(/*! ./sbcs-data */ "./node_modules/iconv-lite/encodings/sbcs-data.js"), __webpack_require__(/*! ./sbcs-data-generated */ "./node_modules/iconv-lite/encodings/sbcs-data-generated.js"), __webpack_require__(/*! ./dbcs-codec */ "./node_modules/iconv-lite/encodings/dbcs-codec.js"), __webpack_require__(/*! ./dbcs-data */ "./node_modules/iconv-lite/encodings/dbcs-data.js")]; // Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var _module = modules[i]; for (var enc in _module) { if (Object.prototype.hasOwnProperty.call(_module, enc)) exports[enc] = _module[enc]; } } /***/ }), /***/ "./node_modules/iconv-lite/encodings/internal.js": /*!*******************************************************!*\ !*** ./node_modules/iconv-lite/encodings/internal.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer; // Export Node.js internal encodings. module.exports = { // Encodings utf8: { type: "_internal", bomAware: true }, cesu8: { type: "_internal", bomAware: true }, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: true }, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, // Codec. _internal: InternalCodec }; //------------------------------------------------------------------------------ function InternalCodec(codecOptions, iconv) { this.enc = codecOptions.encodingName; this.bomAware = codecOptions.bomAware; if (this.enc === "base64") this.encoder = InternalEncoderBase64;else if (this.enc === "cesu8") { this.enc = "utf8"; // Use utf8 for decoding. this.encoder = InternalEncoderCesu8; // Add decoder for versions of Node not supporting CESU-8 if (new Buffer('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8; this.defaultCharUnicode = iconv.defaultCharUnicode; } } } InternalCodec.prototype.encoder = InternalEncoder; InternalCodec.prototype.decoder = InternalDecoder; //------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. var StringDecoder = __webpack_require__(/*! string_decoder */ "string_decoder").StringDecoder; if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. StringDecoder.prototype.end = function () {}; function InternalDecoder(options, codec) { StringDecoder.call(this, codec.enc); } InternalDecoder.prototype = StringDecoder.prototype; //------------------------------------------------------------------------------ // Encoder is mostly trivial function InternalEncoder(options, codec) { this.enc = codec.enc; } InternalEncoder.prototype.write = function (str) { return new Buffer(str, this.enc); }; InternalEncoder.prototype.end = function () {}; //------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. function InternalEncoderBase64(options, codec) { this.prevStr = ''; } InternalEncoderBase64.prototype.write = function (str) { str = this.prevStr + str; var completeQuads = str.length - str.length % 4; this.prevStr = str.slice(completeQuads); str = str.slice(0, completeQuads); return new Buffer(str, "base64"); }; InternalEncoderBase64.prototype.end = function () { return new Buffer(this.prevStr, "base64"); }; //------------------------------------------------------------------------------ // CESU-8 encoder is also special. function InternalEncoderCesu8(options, codec) {} InternalEncoderCesu8.prototype.write = function (str) { var buf = new Buffer(str.length * 3), bufIdx = 0; for (var i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); // Naive implementation, but it works because CESU-8 is especially easy // to convert from UTF-16 (which all JS strings are encoded in). if (charCode < 0x80) buf[bufIdx++] = charCode;else if (charCode < 0x800) { buf[bufIdx++] = 0xC0 + (charCode >>> 6); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } else { // charCode will always be < 0x10000 in javascript. buf[bufIdx++] = 0xE0 + (charCode >>> 12); buf[bufIdx++] = 0x80 + (charCode >>> 6 & 0x3f); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } } return buf.slice(0, bufIdx); }; InternalEncoderCesu8.prototype.end = function () {}; //------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ function InternalDecoderCesu8(options, codec) { this.acc = 0; this.contBytes = 0; this.accBytes = 0; this.defaultCharUnicode = codec.defaultCharUnicode; } InternalDecoderCesu8.prototype.write = function (buf) { var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ''; for (var i = 0; i < buf.length; i++) { var curByte = buf[i]; if ((curByte & 0xC0) !== 0x80) { // Leading byte if (contBytes > 0) { // Previous code is invalid res += this.defaultCharUnicode; contBytes = 0; } if (curByte < 0x80) { // Single-byte code res += String.fromCharCode(curByte); } else if (curByte < 0xE0) { // Two-byte code acc = curByte & 0x1F; contBytes = 1;accBytes = 1; } else if (curByte < 0xF0) { // Three-byte code acc = curByte & 0x0F; contBytes = 2;accBytes = 1; } else { // Four or more are not supported for CESU-8. res += this.defaultCharUnicode; } } else { // Continuation byte if (contBytes > 0) { // We're waiting for it. acc = acc << 6 | curByte & 0x3f; contBytes--;accBytes++; if (contBytes === 0) { // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) if (accBytes === 2 && acc < 0x80 && acc > 0) res += this.defaultCharUnicode;else if (accBytes === 3 && acc < 0x800) res += this.defaultCharUnicode;else // Actually add character. res += String.fromCharCode(acc); } } else { // Unexpected continuation byte res += this.defaultCharUnicode; } } } this.acc = acc;this.contBytes = contBytes;this.accBytes = accBytes; return res; }; InternalDecoderCesu8.prototype.end = function () { var res = 0; if (this.contBytes > 0) res += this.defaultCharUnicode; return res; }; /***/ }), /***/ "./node_modules/iconv-lite/encodings/sbcs-codec.js": /*!*********************************************************!*\ !*** ./node_modules/iconv-lite/encodings/sbcs-codec.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer; // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that // correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data."); // Prepare char buffer for decoding. if (!codecOptions.chars || codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256) throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)"); if (codecOptions.chars.length === 128) { var asciiString = ""; for (var i = 0; i < 128; i++) { asciiString += String.fromCharCode(i); }codecOptions.chars = asciiString + codecOptions.chars; } this.decodeBuf = new Buffer(codecOptions.chars, 'ucs2'); // Encoding buffer. var encodeBuf = new Buffer(65536); encodeBuf.fill(iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) { encodeBuf[codecOptions.chars.charCodeAt(i)] = i; }this.encodeBuf = encodeBuf; } SBCSCodec.prototype.encoder = SBCSEncoder; SBCSCodec.prototype.decoder = SBCSDecoder; function SBCSEncoder(options, codec) { this.encodeBuf = codec.encodeBuf; } SBCSEncoder.prototype.write = function (str) { var buf = new Buffer(str.length); for (var i = 0; i < str.length; i++) { buf[i] = this.encodeBuf[str.charCodeAt(i)]; }return buf; }; SBCSEncoder.prototype.end = function () {}; function SBCSDecoder(options, codec) { this.decodeBuf = codec.decodeBuf; } SBCSDecoder.prototype.write = function (buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. var decodeBuf = this.decodeBuf; var newBuf = new Buffer(buf.length * 2); var idx1 = 0, idx2 = 0; for (var i = 0; i < buf.length; i++) { idx1 = buf[i] * 2;idx2 = i * 2; newBuf[idx2] = decodeBuf[idx1]; newBuf[idx2 + 1] = decodeBuf[idx1 + 1]; } return newBuf.toString('ucs2'); }; SBCSDecoder.prototype.end = function () {}; /***/ }), /***/ "./node_modules/iconv-lite/encodings/sbcs-data-generated.js": /*!******************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/sbcs-data-generated.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. module.exports = { "437": "cp437", "737": "cp737", "775": "cp775", "850": "cp850", "852": "cp852", "855": "cp855", "856": "cp856", "857": "cp857", "858": "cp858", "860": "cp860", "861": "cp861", "862": "cp862", "863": "cp863", "864": "cp864", "865": "cp865", "866": "cp866", "869": "cp869", "874": "windows874", "922": "cp922", "1046": "cp1046", "1124": "cp1124", "1125": "cp1125", "1129": "cp1129", "1133": "cp1133", "1161": "cp1161", "1162": "cp1162", "1163": "cp1163", "1250": "windows1250", "1251": "windows1251", "1252": "windows1252", "1253": "windows1253", "1254": "windows1254", "1255": "windows1255", "1256": "windows1256", "1257": "windows1257", "1258": "windows1258", "28591": "iso88591", "28592": "iso88592", "28593": "iso88593", "28594": "iso88594", "28595": "iso88595", "28596": "iso88596", "28597": "iso88597", "28598": "iso88598", "28599": "iso88599", "28600": "iso885910", "28601": "iso885911", "28603": "iso885913", "28604": "iso885914", "28605": "iso885915", "28606": "iso885916", "windows874": { "type": "_sbcs", "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "win874": "windows874", "cp874": "windows874", "windows1250": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "win1250": "windows1250", "cp1250": "windows1250", "windows1251": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "win1251": "windows1251", "cp1251": "windows1251", "windows1252": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "win1252": "windows1252", "cp1252": "windows1252", "windows1253": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "win1253": "windows1253", "cp1253": "windows1253", "windows1254": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "win1254": "windows1254", "cp1254": "windows1254", "windows1255": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "win1255": "windows1255", "cp1255": "windows1255", "windows1256": { "type": "_sbcs", "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" }, "win1256": "windows1256", "cp1256": "windows1256", "windows1257": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, "win1257": "windows1257", "cp1257": "windows1257", "windows1258": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "win1258": "windows1258", "cp1258": "windows1258", "iso88591": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28591": "iso88591", "iso88592": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "cp28592": "iso88592", "iso88593": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, "cp28593": "iso88593", "iso88594": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, "cp28594": "iso88594", "iso88595": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, "cp28595": "iso88595", "iso88596": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, "cp28596": "iso88596", "iso88597": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "cp28597": "iso88597", "iso88598": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "cp28598": "iso88598", "iso88599": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "cp28599": "iso88599", "iso885910": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, "cp28600": "iso885910", "iso885911": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "cp28601": "iso885911", "iso885913": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, "cp28603": "iso885913", "iso885914": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, "cp28604": "iso885914", "iso885915": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28605": "iso885915", "iso885916": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, "cp28606": "iso885916", "cp437": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm437": "cp437", "csibm437": "cp437", "cp737": { "type": "_sbcs", "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, "ibm737": "cp737", "csibm737": "cp737", "cp775": { "type": "_sbcs", "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " }, "ibm775": "cp775", "csibm775": "cp775", "cp850": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm850": "cp850", "csibm850": "cp850", "cp852": { "type": "_sbcs", "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " }, "ibm852": "cp852", "csibm852": "cp852", "cp855": { "type": "_sbcs", "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " }, "ibm855": "cp855", "csibm855": "cp855", "cp856": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm856": "cp856", "csibm856": "cp856", "cp857": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " }, "ibm857": "cp857", "csibm857": "cp857", "cp858": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm858": "cp858", "csibm858": "cp858", "cp860": { "type": "_sbcs", "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm860": "cp860", "csibm860": "cp860", "cp861": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm861": "cp861", "csibm861": "cp861", "cp862": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm862": "cp862", "csibm862": "cp862", "cp863": { "type": "_sbcs", "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm863": "cp863", "csibm863": "cp863", "cp864": { "type": "_sbcs", "chars": "\0\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0B\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !\"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD" }, "ibm864": "cp864", "csibm864": "cp864", "cp865": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm865": "cp865", "csibm865": "cp865", "cp866": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, "ibm866": "cp866", "csibm866": "cp866", "cp869": { "type": "_sbcs", "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " }, "ibm869": "cp869", "csibm869": "cp869", "cp922": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, "ibm922": "cp922", "csibm922": "cp922", "cp1046": { "type": "_sbcs", "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, "ibm1046": "cp1046", "csibm1046": "cp1046", "cp1124": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, "ibm1124": "cp1124", "csibm1124": "cp1124", "cp1125": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, "ibm1125": "cp1125", "csibm1125": "cp1125", "cp1129": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1129": "cp1129", "csibm1129": "cp1129", "cp1133": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, "ibm1133": "cp1133", "csibm1133": "cp1133", "cp1161": { "type": "_sbcs", "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, "ibm1161": "cp1161", "csibm1161": "cp1161", "cp1162": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "ibm1162": "cp1162", "csibm1162": "cp1162", "cp1163": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1163": "cp1163", "csibm1163": "cp1163", "maccroatian": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, "maccyrillic": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "macgreek": { "type": "_sbcs", "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, "maciceland": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macroman": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macromania": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macthai": { "type": "_sbcs", "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, "macturkish": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, "macukraine": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "koi8r": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8u": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8ru": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8t": { "type": "_sbcs", "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "armscii8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, "rk1048": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "tcvn": { "type": "_sbcs", "chars": "\0\xDA\u1EE4\x03\u1EEA\u1EEC\u1EEE\x07\b\t\n\x0B\f\r\x0E\x0F\x10\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0" }, "georgianacademy": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "georgianps": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "pt154": { "type": "_sbcs", "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "viscii": { "type": "_sbcs", "chars": "\0\x01\u1EB2\x03\x04\u1EB4\u1EAA\x07\b\t\n\x0B\f\r\x0E\x0F\x10\x11\x12\x13\u1EF6\x15\x16\x17\x18\u1EF8\x1A\x1B\x1C\x1D\u1EF4\x1F !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE" }, "iso646cn": { "type": "_sbcs", "chars": "\0\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0B\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !\"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" }, "iso646jp": { "type": "_sbcs", "chars": "\0\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0B\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" }, "hproman8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, "macintosh": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "ascii": { "type": "_sbcs", "chars": "��������������������������������������������������������������������������������������������������������������������������������" }, "tis620": { "type": "_sbcs", "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } }; /***/ }), /***/ "./node_modules/iconv-lite/encodings/sbcs-data.js": /*!********************************************************!*\ !*** ./node_modules/iconv-lite/encodings/sbcs-data.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { // Not supported by iconv, not sure why. "10029": "maccenteuro", "maccenteuro": { "type": "_sbcs", "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, "808": "cp808", "ibm808": "cp808", "cp808": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", "ansix34": "ascii", "ansix341968": "ascii", "ansix341986": "ascii", "csascii": "ascii", "cp367": "ascii", "ibm367": "ascii", "isoir6": "ascii", "iso646us": "ascii", "iso646irv": "ascii", "us": "ascii", "latin1": "iso88591", "latin2": "iso88592", "latin3": "iso88593", "latin4": "iso88594", "latin5": "iso88599", "latin6": "iso885910", "latin7": "iso885913", "latin8": "iso885914", "latin9": "iso885915", "latin10": "iso885916", "csisolatin1": "iso88591", "csisolatin2": "iso88592", "csisolatin3": "iso88593", "csisolatin4": "iso88594", "csisolatincyrillic": "iso88595", "csisolatinarabic": "iso88596", "csisolatingreek": "iso88597", "csisolatinhebrew": "iso88598", "csisolatin5": "iso88599", "csisolatin6": "iso885910", "l1": "iso88591", "l2": "iso88592", "l3": "iso88593", "l4": "iso88594", "l5": "iso88599", "l6": "iso885910", "l7": "iso885913", "l8": "iso885914", "l9": "iso885915", "l10": "iso885916", "isoir14": "iso646jp", "isoir57": "iso646cn", "isoir100": "iso88591", "isoir101": "iso88592", "isoir109": "iso88593", "isoir110": "iso88594", "isoir144": "iso88595", "isoir127": "iso88596", "isoir126": "iso88597", "isoir138": "iso88598", "isoir148": "iso88599", "isoir157": "iso885910", "isoir166": "tis620", "isoir179": "iso885913", "isoir199": "iso885914", "isoir203": "iso885915", "isoir226": "iso885916", "cp819": "iso88591", "ibm819": "iso88591", "cyrillic": "iso88595", "arabic": "iso88596", "arabic8": "iso88596", "ecma114": "iso88596", "asmo708": "iso88596", "greek": "iso88597", "greek8": "iso88597", "ecma118": "iso88597", "elot928": "iso88597", "hebrew": "iso88598", "hebrew8": "iso88598", "turkish": "iso88599", "turkish8": "iso88599", "thai": "iso885911", "thai8": "iso885911", "celtic": "iso885914", "celtic8": "iso885914", "isoceltic": "iso885914", "tis6200": "tis620", "tis62025291": "tis620", "tis62025330": "tis620", "10000": "macroman", "10006": "macgreek", "10007": "maccyrillic", "10079": "maciceland", "10081": "macturkish", "cspc8codepage437": "cp437", "cspc775baltic": "cp775", "cspc850multilingual": "cp850", "cspcp852": "cp852", "cspc862latinhebrew": "cp862", "cpgr": "cp869", "msee": "cp1250", "mscyrl": "cp1251", "msansi": "cp1252", "msgreek": "cp1253", "msturk": "cp1254", "mshebr": "cp1255", "msarab": "cp1256", "winbaltrim": "cp1257", "cp20866": "koi8r", "20866": "koi8r", "ibm878": "koi8r", "cskoi8r": "koi8r", "cp21866": "koi8u", "21866": "koi8u", "ibm1168": "koi8u", "strk10482002": "rk1048", "tcvn5712": "tcvn", "tcvn57121": "tcvn", "gb198880": "iso646cn", "cn": "iso646cn", "csiso14jisc6220ro": "iso646jp", "jisc62201969ro": "iso646jp", "jp": "iso646jp", "cshproman8": "hproman8", "r8": "hproman8", "roman8": "hproman8", "xroman8": "hproman8", "ibm1051": "hproman8", "mac": "macintosh", "csmacintosh": "macintosh" }; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/big5-added.json": /*!******************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/big5-added.json ***! \******************************************************************/ /*! exports provided: 0, 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, default */ /***/ (function(module) { module.exports = [["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"],["8940","𪎩𡅅"],["8943","攊"],["8946","丽滝鵎釟"],["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],["89a1","琑糼緍楆竉刧"],["89ab","醌碸酞肼"],["89b0","贋胶𠧧"],["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],["89c1","溚舾甙"],["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],["8a40","𧶄唥"],["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],["8aac","䠋𠆩㿺塳𢶍"],["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],["8ac9","𪘁𠸉𢫏𢳉"],["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],["8ca1","𣏹椙橃𣱣泿"],["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],["8cc9","顨杫䉶圽"],["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],["8d40","𠮟"],["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],["9fae","酙隁酜"],["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],["9fc1","𤤙盖鮝个𠳔莾衂"],["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],["9fe7","毺蠘罸"],["9feb","嘠𪙊蹷齓"],["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],["a055","𡠻𦸅"],["a058","詾𢔛"],["a05b","惽癧髗鵄鍮鮏蟵"],["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],["a0a1","嵗𨯂迚𨸹"],["a0a6","僙𡵆礆匲阸𠼻䁥"],["a0ae","矾"],["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],["a3c0","␀",31,"␡"],["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],["c740","す",58,"ァアィイ"],["c7a1","ゥ",81,"А",5,"ЁЖ",4],["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],["c8a1","龰冈龱𧘇"],["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],["c8f5","ʃɐɛɔɵœøŋʊɪ"],["f9fe","■"],["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]]; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/cp936.json": /*!*************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/cp936.json ***! \*************************************************************/ /*! exports provided: 0, 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, default */ /***/ (function(module) { module.exports = [["0","\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/cp949.json": /*!*************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/cp949.json ***! \*************************************************************/ /*! exports provided: 0, 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, default */ /***/ (function(module) { module.exports = [["0","\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆÐªĦ"],["a8a6","IJ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/cp950.json": /*!*************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/cp950.json ***! \*************************************************************/ /*! exports provided: 0, 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, default */ /***/ (function(module) { module.exports = [["0","\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/eucjp.json": /*!*************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/eucjp.json ***! \*************************************************************/ /*! exports provided: 0, 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, default */ /***/ (function(module) { module.exports = [["0","\u0000",127],["8ea1","。",62],["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨¬⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","ʼn♯♭♪†‡¶"],["a2fe","◯"],["a3b0","0",9],["a3c1","A",25],["a3e1","a",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"¬¦'""],["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","IJ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/gb18030-ranges.json": /*!**********************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/gb18030-ranges.json ***! \**********************************************************************/ /*! exports provided: uChars, gbChars, default */ /***/ (function(module) { module.exports = {"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/gbk-added.json": /*!*****************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/gbk-added.json ***! \*****************************************************************/ /*! exports provided: 0, 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, default */ /***/ (function(module) { module.exports = [["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc",""],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93]]; /***/ }), /***/ "./node_modules/iconv-lite/encodings/tables/shiftjis.json": /*!****************************************************************!*\ !*** ./node_modules/iconv-lite/encodings/tables/shiftjis.json ***! \****************************************************************/ /*! exports provided: 0, 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, default */ /***/ (function(module) { module.exports = [["0","\u0000",128],["a1","。",62],["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"],["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃∪∩"],["81c8","∧∨¬⇒⇔∀∃"],["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["81f0","ʼn♯♭♪†‡¶"],["81fc","◯"],["824f","0",9],["8260","A",25],["8281","a",25],["829f","ぁ",82],["8340","ァ",62],["8380","ム",22],["839f","Α",16,"Σ",6],["83bf","α",16,"σ",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"ёж",7],["8480","о",17],["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["877e","㍻"],["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"],["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"],["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"],["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"],["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"],["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"],["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"],["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"],["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"],["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"],["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"],["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"],["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"],["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"],["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"],["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"],["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"],["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"],["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"],["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"],["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"],["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"],["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"],["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"],["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"],["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"],["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"],["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"],["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"],["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"],["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"],["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"],["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["eeef","ⅰ",9,"¬¦'""],["f040","",62],["f080","",124],["f140","",62],["f180","",124],["f240","",62],["f280","",124],["f340","",62],["f380","",124],["f440","",62],["f480","",124],["f540","",62],["f580","",124],["f640","",62],["f680","",124],["f740","",62],["f780","",124],["f840","",62],["f880","",124],["f940",""],["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"],["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"],["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"],["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"],["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"]]; /***/ }), /***/ "./node_modules/iconv-lite/encodings/utf16.js": /*!****************************************************!*\ !*** ./node_modules/iconv-lite/encodings/utf16.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer; // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== exports.utf16be = Utf16BECodec; function Utf16BECodec() {} Utf16BECodec.prototype.encoder = Utf16BEEncoder; Utf16BECodec.prototype.decoder = Utf16BEDecoder; Utf16BECodec.prototype.bomAware = true; // -- Encoding function Utf16BEEncoder() {} Utf16BEEncoder.prototype.write = function (str) { var buf = new Buffer(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i];buf[i] = buf[i + 1];buf[i + 1] = tmp; } return buf; }; Utf16BEEncoder.prototype.end = function () {}; // -- Decoding function Utf16BEDecoder() { this.overflowByte = -1; } Utf16BEDecoder.prototype.write = function (buf) { if (buf.length == 0) return ''; var buf2 = new Buffer(buf.length + 1), i = 0, j = 0; if (this.overflowByte !== -1) { buf2[0] = buf[0]; buf2[1] = this.overflowByte; i = 1;j = 2; } for (; i < buf.length - 1; i += 2, j += 2) { buf2[j] = buf[i + 1]; buf2[j + 1] = buf[i]; } this.overflowByte = i == buf.length - 1 ? buf[buf.length - 1] : -1; return buf2.slice(0, j).toString('ucs2'); }; Utf16BEDecoder.prototype.end = function () {}; // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). exports.utf16 = Utf16Codec; function Utf16Codec(codecOptions, iconv) { this.iconv = iconv; } Utf16Codec.prototype.encoder = Utf16Encoder; Utf16Codec.prototype.decoder = Utf16Decoder; // -- Encoding (pass-through) function Utf16Encoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder('utf-16le', options); } Utf16Encoder.prototype.write = function (str) { return this.encoder.write(str); }; Utf16Encoder.prototype.end = function () { return this.encoder.end(); }; // -- Decoding function Utf16Decoder(options, codec) { this.decoder = null; this.initialBytes = []; this.initialBytesLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf16Decoder.prototype.write = function (buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBytes.push(buf); this.initialBytesLen += buf.length; if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var buf = Buffer.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); this.initialBytes.length = this.initialBytesLen = 0; } return this.decoder.write(buf); }; Utf16Decoder.prototype.end = function () { if (!this.decoder) { var buf = Buffer.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var res = this.decoder.write(buf), trail = this.decoder.end(); return trail ? res + trail : res; } return this.decoder.end(); }; function detectEncoding(buf, defaultEncoding) { var enc = defaultEncoding || 'utf-16le'; if (buf.length >= 2) { // Check BOM. if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM enc = 'utf-16be';else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM enc = 'utf-16le';else { // No BOM found. Try to deduce encoding from initial content. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions _len = Math.min(buf.length - buf.length % 2, 64); // Len is always even. for (var i = 0; i < _len; i += 2) { if (buf[i] === 0 && buf[i + 1] !== 0) asciiCharsBE++; if (buf[i] !== 0 && buf[i + 1] === 0) asciiCharsLE++; } if (asciiCharsBE > asciiCharsLE) enc = 'utf-16be';else if (asciiCharsBE < asciiCharsLE) enc = 'utf-16le'; } } return enc; } /***/ }), /***/ "./node_modules/iconv-lite/encodings/utf7.js": /*!***************************************************!*\ !*** ./node_modules/iconv-lite/encodings/utf7.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer; // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 exports.utf7 = Utf7Codec; exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 function Utf7Codec(codecOptions, iconv) { this.iconv = iconv; }; Utf7Codec.prototype.encoder = Utf7Encoder; Utf7Codec.prototype.decoder = Utf7Decoder; Utf7Codec.prototype.bomAware = true; // -- Encoding var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function Utf7Encoder(options, codec) { this.iconv = codec.iconv; } Utf7Encoder.prototype.write = function (str) { // Naive implementation. // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-". return new Buffer(str.replace(nonDirectChars, function (chunk) { return "+" + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this))); }; Utf7Encoder.prototype.end = function () {}; // -- Decoding function Utf7Decoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64Regex = /[A-Za-z0-9\/+]/; var base64Chars = []; for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)); }var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0); Utf7Decoder.prototype.write = function (buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i + 1; inBase64 = true; } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "+-" -> "+" res += "+"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString(); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus is absorbed after base64. i--; lastI = i + 1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + buf.slice(lastI).toString(); var canBeDecoded = b64str.length - b64str.length % 8; // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; }; Utf7Decoder.prototype.end = function () { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; }; // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: // * Base64 part is started by "&" instead of "+" // * Direct characters are 0x20-0x7E, except "&" (0x26) // * In Base64, "," is used instead of "/" // * Base64 must not be used to represent direct characters. // * No implicit shift back from Base64 (should always end with '-') // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. exports.utf7imap = Utf7IMAPCodec; function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv; }; Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; Utf7IMAPCodec.prototype.bomAware = true; // -- Encoding function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = new Buffer(6); this.base64AccumIdx = 0; } Utf7IMAPEncoder.prototype.write = function (str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = new Buffer(str.length * 5 + 10), bufIdx = 0; for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. inBase64 = false; } if (!inBase64) { buf[bufIdx++] = uChar; // Write direct character if (uChar === andChar) // Ampersand -> '&-' buf[bufIdx++] = minusChar; } } else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. inBase64 = true; } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8; base64Accum[base64AccumIdx++] = uChar & 0xFF; if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); base64AccumIdx = 0; } } } } this.inBase64 = inBase64; this.base64AccumIdx = base64AccumIdx; return buf.slice(0, bufIdx); }; Utf7IMAPEncoder.prototype.end = function () { var buf = new Buffer(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); this.base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. this.inBase64 = false; } return buf.slice(0, bufIdx); }; // -- Decoding function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64IMAPChars = base64Chars.slice(); base64IMAPChars[','.charCodeAt(0)] = true; Utf7IMAPDecoder.prototype.write = function (buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i + 1; inBase64 = true; } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus may be absorbed after base64. i--; lastI = i + 1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); var canBeDecoded = b64str.length - b64str.length % 8; // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; }; Utf7IMAPDecoder.prototype.end = function () { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; }; /***/ }), /***/ "./node_modules/iconv-lite/lib/bom-handling.js": /*!*****************************************************!*\ !*** ./node_modules/iconv-lite/lib/bom-handling.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var BOMChar = '\uFEFF'; exports.PrependBOM = PrependBOMWrapper; function PrependBOMWrapper(encoder, options) { this.encoder = encoder; this.addBOM = true; } PrependBOMWrapper.prototype.write = function (str) { if (this.addBOM) { str = BOMChar + str; this.addBOM = false; } return this.encoder.write(str); }; PrependBOMWrapper.prototype.end = function () { return this.encoder.end(); }; //------------------------------------------------------------------------------ exports.StripBOM = StripBOMWrapper; function StripBOMWrapper(decoder, options) { this.decoder = decoder; this.pass = false; this.options = options || {}; } StripBOMWrapper.prototype.write = function (buf) { var res = this.decoder.write(buf); if (this.pass || !res) return res; if (res[0] === BOMChar) { res = res.slice(1); if (typeof this.options.stripBOM === 'function') this.options.stripBOM(); } this.pass = true; return res; }; StripBOMWrapper.prototype.end = function () { return this.decoder.end(); }; /***/ }), /***/ "./node_modules/iconv-lite/lib/extend-node.js": /*!****************************************************!*\ !*** ./node_modules/iconv-lite/lib/extend-node.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer; // == Extend Node primitives to use iconv-lite ================================= module.exports = function (iconv) { var original = undefined; // Place to keep original methods. // Node authors rewrote Buffer internals to make it compatible with // Uint8Array and we cannot patch key functions since then. iconv.supportsNodeEncodingsExtension = !(new Buffer(0) instanceof Uint8Array); iconv.extendNodeEncodings = function extendNodeEncodings() { if (original) return; original = {}; if (!iconv.supportsNodeEncodingsExtension) { console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); return; } var nodeNativeEncodings = { 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true }; Buffer.isNativeEncoding = function (enc) { return enc && nodeNativeEncodings[enc.toLowerCase()]; }; // -- SlowBuffer ----------------------------------------------------------- var SlowBuffer = __webpack_require__(/*! buffer */ "buffer").SlowBuffer; original.SlowBufferToString = SlowBuffer.prototype.toString; SlowBuffer.prototype.toString = function (encoding, start, end) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.SlowBufferToString.call(this, encoding, start, end); // Otherwise, use our decoding method. if (typeof start == 'undefined') start = 0; if (typeof end == 'undefined') end = this.length; return iconv.decode(this.slice(start, end), encoding); }; original.SlowBufferWrite = SlowBuffer.prototype.write; SlowBuffer.prototype.write = function (string, offset, length, encoding) { // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length; length = undefined; } } else { // legacy var swap = encoding; encoding = offset; offset = length; length = swap; } offset = +offset || 0; var remaining = this.length - offset; if (!length) { length = remaining; } else { length = +length; if (length > remaining) { length = remaining; } } encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.SlowBufferWrite.call(this, string, offset, length, encoding); if (string.length > 0 && (length < 0 || offset < 0)) throw new RangeError('attempt to write beyond buffer bounds'); // Otherwise, use our encoding method. var buf = iconv.encode(string, encoding); if (buf.length < length) length = buf.length; buf.copy(this, offset, 0, length); return length; }; // -- Buffer --------------------------------------------------------------- original.BufferIsEncoding = Buffer.isEncoding; Buffer.isEncoding = function (encoding) { return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); }; original.BufferByteLength = Buffer.byteLength; Buffer.byteLength = SlowBuffer.byteLength = function (str, encoding) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferByteLength.call(this, str, encoding); // Slow, I know, but we don't have a better way yet. return iconv.encode(str, encoding).length; }; original.BufferToString = Buffer.prototype.toString; Buffer.prototype.toString = function (encoding, start, end) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferToString.call(this, encoding, start, end); // Otherwise, use our decoding method. if (typeof start == 'undefined') start = 0; if (typeof end == 'undefined') end = this.length; return iconv.decode(this.slice(start, end), encoding); }; original.BufferWrite = Buffer.prototype.write; Buffer.prototype.write = function (string, offset, length, encoding) { var _offset = offset, _length = length, _encoding = encoding; // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length; length = undefined; } } else { // legacy var swap = encoding; encoding = offset; offset = length; length = swap; } encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferWrite.call(this, string, _offset, _length, _encoding); offset = +offset || 0; var remaining = this.length - offset; if (!length) { length = remaining; } else { length = +length; if (length > remaining) { length = remaining; } } if (string.length > 0 && (length < 0 || offset < 0)) throw new RangeError('attempt to write beyond buffer bounds'); // Otherwise, use our encoding method. var buf = iconv.encode(string, encoding); if (buf.length < length) length = buf.length; buf.copy(this, offset, 0, length); return length; // TODO: Set _charsWritten. }; // -- Readable ------------------------------------------------------------- if (iconv.supportsStreams) { var Readable = __webpack_require__(/*! stream */ "stream").Readable; original.ReadableSetEncoding = Readable.prototype.setEncoding; Readable.prototype.setEncoding = function setEncoding(enc, options) { // Use our own decoder, it has the same interface. // We cannot use original function as it doesn't handle BOM-s. this._readableState.decoder = iconv.getDecoder(enc, options); this._readableState.encoding = enc; }; Readable.prototype.collect = iconv._collect; } }; // Remove iconv-lite Node primitive extensions. iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { if (!iconv.supportsNodeEncodingsExtension) return; if (!original) throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called."); delete Buffer.isNativeEncoding; var SlowBuffer = __webpack_require__(/*! buffer */ "buffer").SlowBuffer; SlowBuffer.prototype.toString = original.SlowBufferToString; SlowBuffer.prototype.write = original.SlowBufferWrite; Buffer.isEncoding = original.BufferIsEncoding; Buffer.byteLength = original.BufferByteLength; Buffer.prototype.toString = original.BufferToString; Buffer.prototype.write = original.BufferWrite; if (iconv.supportsStreams) { var Readable = __webpack_require__(/*! stream */ "stream").Readable; Readable.prototype.setEncoding = original.ReadableSetEncoding; delete Readable.prototype.collect; } original = undefined; }; }; /***/ }), /***/ "./node_modules/iconv-lite/lib/index.js": /*!**********************************************!*\ !*** ./node_modules/iconv-lite/lib/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Some environments don't have global Buffer (e.g. React Native). // Solution would be installing npm modules "buffer" and "stream" explicitly. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer; var bomHandling = __webpack_require__(/*! ./bom-handling */ "./node_modules/iconv-lite/lib/bom-handling.js"), iconv = module.exports; // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. iconv.encodings = null; // Characters emitted in case of error. iconv.defaultCharUnicode = '�'; iconv.defaultCharSingleByte = '?'; // Public API. iconv.encode = function encode(str, encoding, options) { str = "" + (str || ""); // Ensure string. var encoder = iconv.getEncoder(encoding, options); var res = encoder.write(str); var trail = encoder.end(); return trail && trail.length > 0 ? Buffer.concat([res, trail]) : res; }; iconv.decode = function decode(buf, encoding, options) { if (typeof buf === 'string') { if (!iconv.skipDecodeWarning) { console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); iconv.skipDecodeWarning = true; } buf = new Buffer("" + (buf || ""), "binary"); // Ensure buffer. } var decoder = iconv.getDecoder(encoding, options); var res = decoder.write(buf); var trail = decoder.end(); return trail ? res + trail : res; }; iconv.encodingExists = function encodingExists(enc) { try { iconv.getCodec(enc); return true; } catch (e) { return false; } }; // Legacy aliases to convert functions iconv.toEncoding = iconv.encode; iconv.fromEncoding = iconv.decode; // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = __webpack_require__(/*! ../encodings */ "./node_modules/iconv-lite/encodings/index.js"); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = ('' + encoding).toLowerCase().replace(/[^0-9a-z]|:\d{4}$/g, ""); // Traverse iconv.encodings to find actual codec. var codecOptions = {}; while (true) { var codec = iconv._codecDataCache[enc]; if (codec) return codec; var codecDef = iconv.encodings[enc]; switch (typeof codecDef === "undefined" ? "undefined" : _typeof(codecDef)) { case "string": // Direct alias to other encoding. enc = codecDef; break; case "object": // Alias with options. Can be layered. for (var key in codecDef) { codecOptions[key] = codecDef[key]; }if (!codecOptions.encodingName) codecOptions.encodingName = enc; enc = codecDef.type; break; case "function": // Codec itself. if (!codecOptions.encodingName) codecOptions.encodingName = enc; // The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv); iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. return codec; default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')"); } } }; iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options); return encoder; }; iconv.getDecoder = function getDecoder(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options); return decoder; }; // Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; if (nodeVer) { // Load streaming support in Node v0.10+ var nodeVerArr = nodeVer.split(".").map(Number); if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { __webpack_require__(/*! ./streams */ "./node_modules/iconv-lite/lib/streams.js")(iconv); } // Load Node primitive extensions. __webpack_require__(/*! ./extend-node */ "./node_modules/iconv-lite/lib/extend-node.js")(iconv); } if (false) {} /***/ }), /***/ "./node_modules/iconv-lite/lib/streams.js": /*!************************************************!*\ !*** ./node_modules/iconv-lite/lib/streams.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Buffer = __webpack_require__(/*! buffer */ "buffer").Buffer, Transform = __webpack_require__(/*! stream */ "stream").Transform; // == Exports ================================================================== module.exports = function (iconv) { // Additional Public API. iconv.encodeStream = function encodeStream(encoding, options) { return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); }; iconv.decodeStream = function decodeStream(encoding, options) { return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); }; iconv.supportsStreams = true; // Not published yet. iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; iconv._collect = IconvLiteDecoderStream.prototype.collect; }; // == Encoder stream ======================================================= function IconvLiteEncoderStream(conv, options) { this.conv = conv; options = options || {}; options.decodeStrings = false; // We accept only strings, so we don't need to decode them. Transform.call(this, options); } IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }); IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) { if (typeof chunk != 'string') return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } }; IconvLiteEncoderStream.prototype._flush = function (done) { try { var res = this.conv.end(); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } }; IconvLiteEncoderStream.prototype.collect = function (cb) { var chunks = []; this.on('error', cb); this.on('data', function (chunk) { chunks.push(chunk); }); this.on('end', function () { cb(null, Buffer.concat(chunks)); }); return this; }; // == Decoder stream ======================================================= function IconvLiteDecoderStream(conv, options) { this.conv = conv; options = options || {}; options.encoding = this.encoding = 'utf8'; // We output strings. Transform.call(this, options); } IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }); IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) { if (!Buffer.isBuffer(chunk)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } }; IconvLiteDecoderStream.prototype._flush = function (done) { try { var res = this.conv.end(); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } }; IconvLiteDecoderStream.prototype.collect = function (cb) { var res = ''; this.on('error', cb); this.on('data', function (chunk) { res += chunk; }); this.on('end', function () { cb(null, res); }); return this; }; /***/ }), /***/ "./node_modules/inherits/inherits.js": /*!*******************************************!*\ !*** ./node_modules/inherits/inherits.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; try { var util = __webpack_require__(/*! util */ "util"); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(/*! ./inherits_browser.js */ "./node_modules/inherits/inherits_browser.js"); } /***/ }), /***/ "./node_modules/inherits/inherits_browser.js": /*!***************************************************!*\ !*** ./node_modules/inherits/inherits_browser.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function TempCtor() {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }; } /***/ }), /***/ "./node_modules/ipaddr.js/lib/ipaddr.js": /*!**********************************************!*\ !*** ./node_modules/ipaddr.js/lib/ipaddr.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { (function () { var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex; ipaddr = {}; root = this; if (typeof module !== "undefined" && module !== null && module.exports) { module.exports = ipaddr; } else { root['ipaddr'] = ipaddr; } matchCIDR = function matchCIDR(first, second, partSize, cidrBits) { var part, shift; if (first.length !== second.length) { throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); } part = 0; while (cidrBits > 0) { shift = partSize - cidrBits; if (shift < 0) { shift = 0; } if (first[part] >> shift !== second[part] >> shift) { return false; } cidrBits -= partSize; part += 1; } return true; }; ipaddr.subnetMatch = function (address, rangeList, defaultName) { var k, len, rangeName, rangeSubnets, subnet; if (defaultName == null) { defaultName = 'unicast'; } for (rangeName in rangeList) { rangeSubnets = rangeList[rangeName]; if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { rangeSubnets = [rangeSubnets]; } for (k = 0, len = rangeSubnets.length; k < len; k++) { subnet = rangeSubnets[k]; if (address.kind() === subnet[0].kind()) { if (address.match.apply(address, subnet)) { return rangeName; } } } } return defaultName; }; ipaddr.IPv4 = function () { function IPv4(octets) { var k, len, octet; if (octets.length !== 4) { throw new Error("ipaddr: ipv4 octet count should be 4"); } for (k = 0, len = octets.length; k < len; k++) { octet = octets[k]; if (!(0 <= octet && octet <= 255)) { throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); } } this.octets = octets; } IPv4.prototype.kind = function () { return 'ipv4'; }; IPv4.prototype.toString = function () { return this.octets.join("."); }; IPv4.prototype.toNormalizedString = function () { return this.toString(); }; IPv4.prototype.toByteArray = function () { return this.octets.slice(0); }; IPv4.prototype.match = function (other, cidrRange) { var ref; if (cidrRange === void 0) { ref = other, other = ref[0], cidrRange = ref[1]; } if (other.kind() !== 'ipv4') { throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); } return matchCIDR(this.octets, other.octets, 8, cidrRange); }; IPv4.prototype.SpecialRanges = { unspecified: [[new IPv4([0, 0, 0, 0]), 8]], broadcast: [[new IPv4([255, 255, 255, 255]), 32]], multicast: [[new IPv4([224, 0, 0, 0]), 4]], linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], loopback: [[new IPv4([127, 0, 0, 0]), 8]], carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]], reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]] }; IPv4.prototype.range = function () { return ipaddr.subnetMatch(this, this.SpecialRanges); }; IPv4.prototype.toIPv4MappedAddress = function () { return ipaddr.IPv6.parse("::ffff:" + this.toString()); }; IPv4.prototype.prefixLengthFromSubnetMask = function () { var cidr, i, k, octet, stop, zeros, zerotable; zerotable = { 0: 8, 128: 7, 192: 6, 224: 5, 240: 4, 248: 3, 252: 2, 254: 1, 255: 0 }; cidr = 0; stop = false; for (i = k = 3; k >= 0; i = k += -1) { octet = this.octets[i]; if (octet in zerotable) { zeros = zerotable[octet]; if (stop && zeros !== 0) { return null; } if (zeros !== 8) { stop = true; } cidr += zeros; } else { return null; } } return 32 - cidr; }; return IPv4; }(); ipv4Part = "(0?\\d+|0x[a-f0-9]+)"; ipv4Regexes = { fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'), longValue: new RegExp("^" + ipv4Part + "$", 'i') }; ipaddr.IPv4.parser = function (string) { var match, parseIntAuto, part, shift, value; parseIntAuto = function parseIntAuto(string) { if (string[0] === "0" && string[1] !== "x") { return parseInt(string, 8); } else { return parseInt(string); } }; if (match = string.match(ipv4Regexes.fourOctet)) { return function () { var k, len, ref, results; ref = match.slice(1, 6); results = []; for (k = 0, len = ref.length; k < len; k++) { part = ref[k]; results.push(parseIntAuto(part)); } return results; }(); } else if (match = string.match(ipv4Regexes.longValue)) { value = parseIntAuto(match[1]); if (value > 0xffffffff || value < 0) { throw new Error("ipaddr: address outside defined range"); } return function () { var k, results; results = []; for (shift = k = 0; k <= 24; shift = k += 8) { results.push(value >> shift & 0xff); } return results; }().reverse(); } else { return null; } }; ipaddr.IPv6 = function () { function IPv6(parts, zoneId) { var i, k, l, len, part, ref; if (parts.length === 16) { this.parts = []; for (i = k = 0; k <= 14; i = k += 2) { this.parts.push(parts[i] << 8 | parts[i + 1]); } } else if (parts.length === 8) { this.parts = parts; } else { throw new Error("ipaddr: ipv6 part count should be 8 or 16"); } ref = this.parts; for (l = 0, len = ref.length; l < len; l++) { part = ref[l]; if (!(0 <= part && part <= 0xffff)) { throw new Error("ipaddr: ipv6 part should fit in 16 bits"); } } if (zoneId) { this.zoneId = zoneId; } } IPv6.prototype.kind = function () { return 'ipv6'; }; IPv6.prototype.toString = function () { return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::'); }; IPv6.prototype.toByteArray = function () { var bytes, k, len, part, ref; bytes = []; ref = this.parts; for (k = 0, len = ref.length; k < len; k++) { part = ref[k]; bytes.push(part >> 8); bytes.push(part & 0xff); } return bytes; }; IPv6.prototype.toNormalizedString = function () { var addr, part, suffix; addr = function () { var k, len, ref, results; ref = this.parts; results = []; for (k = 0, len = ref.length; k < len; k++) { part = ref[k]; results.push(part.toString(16)); } return results; }.call(this).join(":"); suffix = ''; if (this.zoneId) { suffix = '%' + this.zoneId; } return addr + suffix; }; IPv6.prototype.match = function (other, cidrRange) { var ref; if (cidrRange === void 0) { ref = other, other = ref[0], cidrRange = ref[1]; } if (other.kind() !== 'ipv6') { throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); } return matchCIDR(this.parts, other.parts, 16, cidrRange); }; IPv6.prototype.SpecialRanges = { unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128], linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10], multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8], loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128], uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7], ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96], rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96], rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96], '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16], teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32], reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]] }; IPv6.prototype.range = function () { return ipaddr.subnetMatch(this, this.SpecialRanges); }; IPv6.prototype.isIPv4MappedAddress = function () { return this.range() === 'ipv4Mapped'; }; IPv6.prototype.toIPv4Address = function () { var high, low, ref; if (!this.isIPv4MappedAddress()) { throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); } ref = this.parts.slice(-2), high = ref[0], low = ref[1]; return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]); }; IPv6.prototype.prefixLengthFromSubnetMask = function () { var cidr, i, k, part, stop, zeros, zerotable; zerotable = { 0: 16, 32768: 15, 49152: 14, 57344: 13, 61440: 12, 63488: 11, 64512: 10, 65024: 9, 65280: 8, 65408: 7, 65472: 6, 65504: 5, 65520: 4, 65528: 3, 65532: 2, 65534: 1, 65535: 0 }; cidr = 0; stop = false; for (i = k = 7; k >= 0; i = k += -1) { part = this.parts[i]; if (part in zerotable) { zeros = zerotable[part]; if (stop && zeros !== 0) { return null; } if (zeros !== 16) { stop = true; } cidr += zeros; } else { return null; } } return 128 - cidr; }; return IPv6; }(); ipv6Part = "(?:[0-9a-f]+::?)+"; zoneIndex = "%[0-9a-z]{1,}"; ipv6Regexes = { zoneIndex: new RegExp(zoneIndex, 'i'), "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?(" + zoneIndex + ")?$", 'i'), transitional: new RegExp("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)" + (ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part) + ("(" + zoneIndex + ")?$"), 'i') }; expandIPv6 = function expandIPv6(string, parts) { var colonCount, lastColon, part, replacement, replacementCount, zoneId; if (string.indexOf('::') !== string.lastIndexOf('::')) { return null; } zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0]; if (zoneId) { zoneId = zoneId.substring(1); string = string.replace(/%.+$/, ''); } colonCount = 0; lastColon = -1; while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) { colonCount++; } if (string.substr(0, 2) === '::') { colonCount--; } if (string.substr(-2, 2) === '::') { colonCount--; } if (colonCount > parts) { return null; } replacementCount = parts - colonCount; replacement = ':'; while (replacementCount--) { replacement += '0:'; } string = string.replace('::', replacement); if (string[0] === ':') { string = string.slice(1); } if (string[string.length - 1] === ':') { string = string.slice(0, -1); } parts = function () { var k, len, ref, results; ref = string.split(":"); results = []; for (k = 0, len = ref.length; k < len; k++) { part = ref[k]; results.push(parseInt(part, 16)); } return results; }(); return { parts: parts, zoneId: zoneId }; }; ipaddr.IPv6.parser = function (string) { var addr, k, len, match, octet, octets, zoneId; if (ipv6Regexes['native'].test(string)) { return expandIPv6(string, 8); } else if (match = string.match(ipv6Regexes['transitional'])) { zoneId = match[6] || ''; addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6); if (addr.parts) { octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; for (k = 0, len = octets.length; k < len; k++) { octet = octets[k]; if (!(0 <= octet && octet <= 255)) { return null; } } addr.parts.push(octets[0] << 8 | octets[1]); addr.parts.push(octets[2] << 8 | octets[3]); return { parts: addr.parts, zoneId: addr.zoneId }; } } return null; }; ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function (string) { return this.parser(string) !== null; }; ipaddr.IPv4.isValid = function (string) { var e; try { new this(this.parser(string)); return true; } catch (error1) { e = error1; return false; } }; ipaddr.IPv4.isValidFourPartDecimal = function (string) { if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) { return true; } else { return false; } }; ipaddr.IPv6.isValid = function (string) { var addr, e; if (typeof string === "string" && string.indexOf(":") === -1) { return false; } try { addr = this.parser(string); new this(addr.parts, addr.zoneId); return true; } catch (error1) { e = error1; return false; } }; ipaddr.IPv4.parse = function (string) { var parts; parts = this.parser(string); if (parts === null) { throw new Error("ipaddr: string is not formatted like ip address"); } return new this(parts); }; ipaddr.IPv6.parse = function (string) { var addr; addr = this.parser(string); if (addr.parts === null) { throw new Error("ipaddr: string is not formatted like ip address"); } return new this(addr.parts, addr.zoneId); }; ipaddr.IPv4.parseCIDR = function (string) { var maskLength, match, parsed; if (match = string.match(/^(.+)\/(\d+)$/)) { maskLength = parseInt(match[2]); if (maskLength >= 0 && maskLength <= 32) { parsed = [this.parse(match[1]), maskLength]; Object.defineProperty(parsed, 'toString', { value: function value() { return this.join('/'); } }); return parsed; } } throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); }; ipaddr.IPv4.subnetMaskFromPrefixLength = function (prefix) { var filledOctetCount, j, octets; prefix = parseInt(prefix); if (prefix < 0 || prefix > 32) { throw new Error('ipaddr: invalid IPv4 prefix length'); } octets = [0, 0, 0, 0]; j = 0; filledOctetCount = Math.floor(prefix / 8); while (j < filledOctetCount) { octets[j] = 255; j++; } if (filledOctetCount < 4) { octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - prefix % 8; } return new this(octets); }; ipaddr.IPv4.broadcastAddressFromCIDR = function (string) { var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; try { cidr = this.parseCIDR(string); ipInterfaceOctets = cidr[0].toByteArray(); subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); octets = []; i = 0; while (i < 4) { octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255); i++; } return new this(octets); } catch (error1) { error = error1; throw new Error('ipaddr: the address does not have IPv4 CIDR format'); } }; ipaddr.IPv4.networkAddressFromCIDR = function (string) { var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; try { cidr = this.parseCIDR(string); ipInterfaceOctets = cidr[0].toByteArray(); subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); octets = []; i = 0; while (i < 4) { octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)); i++; } return new this(octets); } catch (error1) { error = error1; throw new Error('ipaddr: the address does not have IPv4 CIDR format'); } }; ipaddr.IPv6.parseCIDR = function (string) { var maskLength, match, parsed; if (match = string.match(/^(.+)\/(\d+)$/)) { maskLength = parseInt(match[2]); if (maskLength >= 0 && maskLength <= 128) { parsed = [this.parse(match[1]), maskLength]; Object.defineProperty(parsed, 'toString', { value: function value() { return this.join('/'); } }); return parsed; } } throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); }; ipaddr.isValid = function (string) { return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string); }; ipaddr.parse = function (string) { if (ipaddr.IPv6.isValid(string)) { return ipaddr.IPv6.parse(string); } else if (ipaddr.IPv4.isValid(string)) { return ipaddr.IPv4.parse(string); } else { throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); } }; ipaddr.parseCIDR = function (string) { var e; try { return ipaddr.IPv6.parseCIDR(string); } catch (error1) { e = error1; try { return ipaddr.IPv4.parseCIDR(string); } catch (error1) { e = error1; throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); } } }; ipaddr.fromByteArray = function (bytes) { var length; length = bytes.length; if (length === 4) { return new ipaddr.IPv4(bytes); } else if (length === 16) { return new ipaddr.IPv6(bytes); } else { throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); } }; ipaddr.process = function (string) { var addr; addr = this.parse(string); if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) { return addr.toIPv4Address(); } else { return addr; } }; }).call(undefined); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) /***/ }), /***/ "./node_modules/media-typer/index.js": /*!*******************************************!*\ !*** ./node_modules/media-typer/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! * media-typer * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ /** * RegExp to match *( ";" parameter ) in RFC 2616 sec 3.7 * * parameter = token "=" ( token | quoted-string ) * token = 1*<any CHAR except CTLs or separators> * separators = "(" | ")" | "<" | ">" | "@" * | "," | ";" | ":" | "\" | <"> * | "/" | "[" | "]" | "?" | "=" * | "{" | "}" | SP | HT * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) * qdtext = <any TEXT except <">> * quoted-pair = "\" CHAR * CHAR = <any US-ASCII character (octets 0 - 127)> * TEXT = <any OCTET except CTLs, but including LWS> * LWS = [CRLF] 1*( SP | HT ) * CRLF = CR LF * CR = <US-ASCII CR, carriage return (13)> * LF = <US-ASCII LF, linefeed (10)> * SP = <US-ASCII SP, space (32)> * SHT = <US-ASCII HT, horizontal-tab (9)> * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)> * OCTET = <any 8-bit sequence of data> */ var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g; var textRegExp = /^[\u0020-\u007e\u0080-\u00ff]+$/; var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/; /** * RegExp to match quoted-pair in RFC 2616 * * quoted-pair = "\" CHAR * CHAR = <any US-ASCII character (octets 0 - 127)> */ var qescRegExp = /\\([\u0000-\u007f])/g; /** * RegExp to match chars that must be quoted-pair in RFC 2616 */ var quoteRegExp = /([\\"])/g; /** * RegExp to match type in RFC 6838 * * type-name = restricted-name * subtype-name = restricted-name * restricted-name = restricted-name-first *126restricted-name-chars * restricted-name-first = ALPHA / DIGIT * restricted-name-chars = ALPHA / DIGIT / "!" / "#" / * "$" / "&" / "-" / "^" / "_" * restricted-name-chars =/ "." ; Characters before first dot always * ; specify a facet name * restricted-name-chars =/ "+" ; Characters after last plus always * ; specify a structured syntax suffix * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z * DIGIT = %x30-39 ; 0-9 */ var subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/; var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/; var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/; /** * Module exports. */ exports.format = format; exports.parse = parse; /** * Format object to media type. * * @param {object} obj * @return {string} * @api public */ function format(obj) { if (!obj || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') { throw new TypeError('argument obj is required'); } var parameters = obj.parameters; var subtype = obj.subtype; var suffix = obj.suffix; var type = obj.type; if (!type || !typeNameRegExp.test(type)) { throw new TypeError('invalid type'); } if (!subtype || !subtypeNameRegExp.test(subtype)) { throw new TypeError('invalid subtype'); } // format as type/subtype var string = type + '/' + subtype; // append +suffix if (suffix) { if (!typeNameRegExp.test(suffix)) { throw new TypeError('invalid suffix'); } string += '+' + suffix; } // append parameters if (parameters && (typeof parameters === 'undefined' ? 'undefined' : _typeof(parameters)) === 'object') { var param; var params = Object.keys(parameters).sort(); for (var i = 0; i < params.length; i++) { param = params[i]; if (!tokenRegExp.test(param)) { throw new TypeError('invalid parameter name'); } string += '; ' + param + '=' + qstring(parameters[param]); } } return string; } /** * Parse media type to object. * * @param {string|object} string * @return {Object} * @api public */ function parse(string) { if (!string) { throw new TypeError('argument string is required'); } // support req/res-like objects as argument if ((typeof string === 'undefined' ? 'undefined' : _typeof(string)) === 'object') { string = getcontenttype(string); } if (typeof string !== 'string') { throw new TypeError('argument string is required to be a string'); } var index = string.indexOf(';'); var type = index !== -1 ? string.substr(0, index) : string; var key; var match; var obj = splitType(type); var params = {}; var value; paramRegExp.lastIndex = index; while (match = paramRegExp.exec(string)) { if (match.index !== index) { throw new TypeError('invalid parameter format'); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value[0] === '"') { // remove quotes and escapes value = value.substr(1, value.length - 2).replace(qescRegExp, '$1'); } params[key] = value; } if (index !== -1 && index !== string.length) { throw new TypeError('invalid parameter format'); } obj.parameters = params; return obj; } /** * Get content-type from req/res objects. * * @param {object} * @return {Object} * @api private */ function getcontenttype(obj) { if (typeof obj.getHeader === 'function') { // res-like return obj.getHeader('content-type'); } if (_typeof(obj.headers) === 'object') { // req-like return obj.headers && obj.headers['content-type']; } } /** * Quote a string if necessary. * * @param {string} val * @return {string} * @api private */ function qstring(val) { var str = String(val); // no need to quote tokens if (tokenRegExp.test(str)) { return str; } if (str.length > 0 && !textRegExp.test(str)) { throw new TypeError('invalid parameter value'); } return '"' + str.replace(quoteRegExp, '\\$1') + '"'; } /** * Simply "type/subtype+siffx" into parts. * * @param {string} string * @return {Object} * @api private */ function splitType(string) { var match = typeRegExp.exec(string.toLowerCase()); if (!match) { throw new TypeError('invalid media type'); } var type = match[1]; var subtype = match[2]; var suffix; // suffix after last + var index = subtype.lastIndexOf('+'); if (index !== -1) { suffix = subtype.substr(index + 1); subtype = subtype.substr(0, index); } var obj = { type: type, subtype: subtype, suffix: suffix }; return obj; } /***/ }), /***/ "./node_modules/merge-descriptors/index.js": /*!*************************************************!*\ !*** ./node_modules/merge-descriptors/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * merge-descriptors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = merge; /** * Module variables. * @private */ var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Merge the property descriptors of `src` into `dest` * * @param {object} dest Object to add descriptors to * @param {object} src Object to clone descriptors from * @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties * @returns {object} Reference to dest * @public */ function merge(dest, src, redefine) { if (!dest) { throw new TypeError('argument dest is required'); } if (!src) { throw new TypeError('argument src is required'); } if (redefine === undefined) { // Default to true redefine = true; } Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) { if (!redefine && hasOwnProperty.call(dest, name)) { // Skip desriptor return; } // Copy descriptor var descriptor = Object.getOwnPropertyDescriptor(src, name); Object.defineProperty(dest, name, descriptor); }); return dest; } /***/ }), /***/ "./node_modules/methods/index.js": /*!***************************************!*\ !*** ./node_modules/methods/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * methods * Copyright(c) 2013-2014 TJ Holowaychuk * Copyright(c) 2015-2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var http = __webpack_require__(/*! http */ "http"); /** * Module exports. * @public */ module.exports = getCurrentNodeMethods() || getBasicNodeMethods(); /** * Get the current Node.js methods. * @private */ function getCurrentNodeMethods() { return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) { return method.toLowerCase(); }); } /** * Get the "basic" Node.js methods, a snapshot from Node.js 0.10. * @private */ function getBasicNodeMethods() { return ['get', 'post', 'put', 'head', 'delete', 'options', 'trace', 'copy', 'lock', 'mkcol', 'move', 'purge', 'propfind', 'proppatch', 'unlock', 'report', 'mkactivity', 'checkout', 'merge', 'm-search', 'notify', 'subscribe', 'unsubscribe', 'patch', 'search', 'connect']; } /***/ }), /***/ "./node_modules/mime-types/index.js": /*!******************************************!*\ !*** ./node_modules/mime-types/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var db = __webpack_require__(/*! mime-db */ "./node_modules/mime-types/node_modules/mime-db/index.js"); var extname = __webpack_require__(/*! path */ "path").extname; /** * Module variables. * @private */ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; var TEXT_TYPE_REGEXP = /^text\//i; /** * Module exports. * @public */ exports.charset = charset; exports.charsets = { lookup: charset }; exports.contentType = contentType; exports.extension = extension; exports.extensions = Object.create(null); exports.lookup = lookup; exports.types = Object.create(null); // Populate the extensions/types maps populateMaps(exports.extensions, exports.types); /** * Get the default charset for a MIME type. * * @param {string} type * @return {boolean|string} */ function charset(type) { if (!type || typeof type !== 'string') { return false; } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type); var mime = match && db[match[1].toLowerCase()]; if (mime && mime.charset) { return mime.charset; } // default text/* to utf-8 if (match && TEXT_TYPE_REGEXP.test(match[1])) { return 'UTF-8'; } return false; } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {boolean|string} */ function contentType(str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false; } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str; if (!mime) { return false; } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime); if (charset) mime += '; charset=' + charset.toLowerCase(); } return mime; } /** * Get the default extension for a MIME type. * * @param {string} type * @return {boolean|string} */ function extension(type) { if (!type || typeof type !== 'string') { return false; } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type); // get extensions var exts = match && exports.extensions[match[1].toLowerCase()]; if (!exts || !exts.length) { return false; } return exts[0]; } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {boolean|string} */ function lookup(path) { if (!path || typeof path !== 'string') { return false; } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path).toLowerCase().substr(1); if (!extension) { return false; } return exports.types[extension] || false; } /** * Populate the extensions and types maps. * @private */ function populateMaps(extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana']; Object.keys(db).forEach(function forEachMimeType(type) { var mime = db[type]; var exts = mime.extensions; if (!exts || !exts.length) { return; } // mime -> extensions extensions[type] = exts; // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i]; if (types[extension]) { var from = preference.indexOf(db[types[extension]].source); var to = preference.indexOf(mime.source); if (types[extension] !== 'application/octet-stream' && (from > to || from === to && types[extension].substr(0, 12) === 'application/')) { // skip the remapping continue; } } // set the extension -> mime types[extension] = type; } }); } /***/ }), /***/ "./node_modules/mime-types/node_modules/mime-db/db.json": /*!**************************************************************!*\ !*** ./node_modules/mime-types/node_modules/mime-db/db.json ***! \**************************************************************/ /*! exports provided: application/1d-interleaved-parityfec, application/3gpdash-qoe-report+xml, application/3gpp-ims+xml, application/a2l, application/activemessage, application/activity+json, application/alto-costmap+json, application/alto-costmapfilter+json, application/alto-directory+json, application/alto-endpointcost+json, application/alto-endpointcostparams+json, application/alto-endpointprop+json, application/alto-endpointpropparams+json, application/alto-error+json, application/alto-networkmap+json, application/alto-networkmapfilter+json, application/aml, application/andrew-inset, application/applefile, application/applixware, application/atf, application/atfx, application/atom+xml, application/atomcat+xml, application/atomdeleted+xml, application/atomicmail, application/atomsvc+xml, application/atxml, application/auth-policy+xml, application/bacnet-xdd+zip, application/batch-smtp, application/bdoc, application/beep+xml, application/calendar+json, application/calendar+xml, application/call-completion, application/cals-1840, application/cbor, application/cccex, application/ccmp+xml, application/ccxml+xml, application/cdfx+xml, application/cdmi-capability, application/cdmi-container, application/cdmi-domain, application/cdmi-object, application/cdmi-queue, application/cdni, application/cea, application/cea-2018+xml, application/cellml+xml, application/cfw, application/clue_info+xml, application/cms, application/cnrp+xml, application/coap-group+json, application/coap-payload, application/commonground, application/conference-info+xml, application/cose, application/cose-key, application/cose-key-set, application/cpl+xml, application/csrattrs, application/csta+xml, application/cstadata+xml, application/csvm+json, application/cu-seeme, application/cwt, application/cybercash, application/dart, application/dash+xml, application/dashdelta, application/davmount+xml, application/dca-rft, application/dcd, application/dec-dx, application/dialog-info+xml, application/dicom, application/dicom+json, application/dicom+xml, application/dii, application/dit, application/dns, application/dns+json, application/docbook+xml, application/dskpp+xml, application/dssc+der, application/dssc+xml, application/dvcs, application/ecmascript, application/edi-consent, application/edi-x12, application/edifact, application/efi, application/emergencycalldata.comment+xml, application/emergencycalldata.control+xml, application/emergencycalldata.deviceinfo+xml, application/emergencycalldata.ecall.msd, application/emergencycalldata.providerinfo+xml, application/emergencycalldata.serviceinfo+xml, application/emergencycalldata.subscriberinfo+xml, application/emergencycalldata.veds+xml, application/emma+xml, application/emotionml+xml, application/encaprtp, application/epp+xml, application/epub+zip, application/eshop, application/exi, application/fastinfoset, application/fastsoap, application/fdt+xml, application/fhir+json, application/fhir+xml, application/fido.trusted-apps+json, application/fits, application/font-sfnt, application/font-tdpfr, application/font-woff, application/framework-attributes+xml, application/geo+json, application/geo+json-seq, application/geoxacml+xml, application/gltf-buffer, application/gml+xml, application/gpx+xml, application/gxf, application/gzip, application/h224, application/held+xml, application/hjson, application/http, application/hyperstudio, application/ibe-key-request+xml, application/ibe-pkg-reply+xml, application/ibe-pp-data, application/iges, application/im-iscomposing+xml, application/index, application/index.cmd, application/index.obj, application/index.response, application/index.vnd, application/inkml+xml, application/iotp, application/ipfix, application/ipp, application/isup, application/its+xml, application/java-archive, application/java-serialized-object, application/java-vm, application/javascript, application/jf2feed+json, application/jose, application/jose+json, application/jrd+json, application/json, application/json-patch+json, application/json-seq, application/json5, application/jsonml+json, application/jwk+json, application/jwk-set+json, application/jwt, application/kpml-request+xml, application/kpml-response+xml, application/ld+json, application/lgr+xml, application/link-format, application/load-control+xml, application/lost+xml, application/lostsync+xml, application/lxf, application/mac-binhex40, application/mac-compactpro, application/macwriteii, application/mads+xml, application/manifest+json, application/marc, application/marcxml+xml, application/mathematica, application/mathml+xml, application/mathml-content+xml, application/mathml-presentation+xml, application/mbms-associated-procedure-description+xml, application/mbms-deregister+xml, application/mbms-envelope+xml, application/mbms-msk+xml, application/mbms-msk-response+xml, application/mbms-protection-description+xml, application/mbms-reception-report+xml, application/mbms-register+xml, application/mbms-register-response+xml, application/mbms-schedule+xml, application/mbms-user-service-description+xml, application/mbox, application/media-policy-dataset+xml, application/media_control+xml, application/mediaservercontrol+xml, application/merge-patch+json, application/metalink+xml, application/metalink4+xml, application/mets+xml, application/mf4, application/mikey, application/mmt-usd+xml, application/mods+xml, application/moss-keys, application/moss-signature, application/mosskey-data, application/mosskey-request, application/mp21, application/mp4, application/mpeg4-generic, application/mpeg4-iod, application/mpeg4-iod-xmt, application/mrb-consumer+xml, application/mrb-publish+xml, application/msc-ivr+xml, application/msc-mixer+xml, application/msword, application/mud+json, application/mxf, application/n-quads, application/n-triples, application/nasdata, application/news-checkgroups, application/news-groupinfo, application/news-transmission, application/nlsml+xml, application/node, application/nss, application/ocsp-request, application/ocsp-response, application/octet-stream, application/oda, application/odx, application/oebps-package+xml, application/ogg, application/omdoc+xml, application/onenote, application/oxps, application/p2p-overlay+xml, application/parityfec, application/passport, application/patch-ops-error+xml, application/pdf, application/pdx, application/pgp-encrypted, application/pgp-keys, application/pgp-signature, application/pics-rules, application/pidf+xml, application/pidf-diff+xml, application/pkcs10, application/pkcs12, application/pkcs7-mime, application/pkcs7-signature, application/pkcs8, application/pkcs8-encrypted, application/pkix-attr-cert, application/pkix-cert, application/pkix-crl, application/pkix-pkipath, application/pkixcmp, application/pls+xml, application/poc-settings+xml, application/postscript, application/ppsp-tracker+json, application/problem+json, application/problem+xml, application/provenance+xml, application/prs.alvestrand.titrax-sheet, application/prs.cww, application/prs.hpub+zip, application/prs.nprend, application/prs.plucker, application/prs.rdf-xml-crypt, application/prs.xsf+xml, application/pskc+xml, application/qsig, application/raml+yaml, application/raptorfec, application/rdap+json, application/rdf+xml, application/reginfo+xml, application/relax-ng-compact-syntax, application/remote-printing, application/reputon+json, application/resource-lists+xml, application/resource-lists-diff+xml, application/rfc+xml, application/riscos, application/rlmi+xml, application/rls-services+xml, application/route-apd+xml, application/route-s-tsid+xml, application/route-usd+xml, application/rpki-ghostbusters, application/rpki-manifest, application/rpki-publication, application/rpki-roa, application/rpki-updown, application/rsd+xml, application/rss+xml, application/rtf, application/rtploopback, application/rtx, application/samlassertion+xml, application/samlmetadata+xml, application/sbml+xml, application/scaip+xml, application/scim+json, application/scvp-cv-request, application/scvp-cv-response, application/scvp-vp-request, application/scvp-vp-response, application/sdp, application/secevent+jwt, application/senml+cbor, application/senml+json, application/senml+xml, application/senml-exi, application/sensml+cbor, application/sensml+json, application/sensml+xml, application/sensml-exi, application/sep+xml, application/sep-exi, application/session-info, application/set-payment, application/set-payment-initiation, application/set-registration, application/set-registration-initiation, application/sgml, application/sgml-open-catalog, application/shf+xml, application/sieve, application/simple-filter+xml, application/simple-message-summary, application/simplesymbolcontainer, application/slate, application/smil, application/smil+xml, application/smpte336m, application/soap+fastinfoset, application/soap+xml, application/sparql-query, application/sparql-results+xml, application/spirits-event+xml, application/sql, application/srgs, application/srgs+xml, application/sru+xml, application/ssdl+xml, application/ssml+xml, application/stix+json, application/tamp-apex-update, application/tamp-apex-update-confirm, application/tamp-community-update, application/tamp-community-update-confirm, application/tamp-error, application/tamp-sequence-adjust, application/tamp-sequence-adjust-confirm, application/tamp-status-query, application/tamp-status-response, application/tamp-update, application/tamp-update-confirm, application/tar, application/taxii+json, application/tei+xml, application/thraud+xml, application/timestamp-query, application/timestamp-reply, application/timestamped-data, application/tlsrpt+gzip, application/tlsrpt+json, application/tnauthlist, application/trickle-ice-sdpfrag, application/trig, application/ttml+xml, application/tve-trigger, application/ulpfec, application/urc-grpsheet+xml, application/urc-ressheet+xml, application/urc-targetdesc+xml, application/urc-uisocketdesc+xml, application/vcard+json, application/vcard+xml, application/vemmi, application/vividence.scriptfile, application/vnd.1000minds.decision-model+xml, application/vnd.3gpp-prose+xml, application/vnd.3gpp-prose-pc3ch+xml, application/vnd.3gpp-v2x-local-service-information, application/vnd.3gpp.access-transfer-events+xml, application/vnd.3gpp.bsf+xml, application/vnd.3gpp.gmop+xml, application/vnd.3gpp.mcdata-payload, application/vnd.3gpp.mcdata-signalling, application/vnd.3gpp.mcptt-affiliation-command+xml, application/vnd.3gpp.mcptt-floor-request+xml, application/vnd.3gpp.mcptt-info+xml, application/vnd.3gpp.mcptt-location-info+xml, application/vnd.3gpp.mcptt-mbms-usage-info+xml, application/vnd.3gpp.mcptt-signed+xml, application/vnd.3gpp.mid-call+xml, application/vnd.3gpp.pic-bw-large, application/vnd.3gpp.pic-bw-small, application/vnd.3gpp.pic-bw-var, application/vnd.3gpp.sms, application/vnd.3gpp.sms+xml, application/vnd.3gpp.srvcc-ext+xml, application/vnd.3gpp.srvcc-info+xml, application/vnd.3gpp.state-and-event-info+xml, application/vnd.3gpp.ussd+xml, application/vnd.3gpp2.bcmcsinfo+xml, application/vnd.3gpp2.sms, application/vnd.3gpp2.tcap, application/vnd.3lightssoftware.imagescal, application/vnd.3m.post-it-notes, application/vnd.accpac.simply.aso, application/vnd.accpac.simply.imp, application/vnd.acucobol, application/vnd.acucorp, application/vnd.adobe.air-application-installer-package+zip, application/vnd.adobe.flash.movie, application/vnd.adobe.formscentral.fcdt, application/vnd.adobe.fxp, application/vnd.adobe.partial-upload, application/vnd.adobe.xdp+xml, application/vnd.adobe.xfdf, application/vnd.aether.imp, application/vnd.afpc.afplinedata, application/vnd.afpc.modca, application/vnd.ah-barcode, application/vnd.ahead.space, application/vnd.airzip.filesecure.azf, application/vnd.airzip.filesecure.azs, application/vnd.amadeus+json, application/vnd.amazon.ebook, application/vnd.amazon.mobi8-ebook, application/vnd.americandynamics.acc, application/vnd.amiga.ami, application/vnd.amundsen.maze+xml, application/vnd.android.package-archive, application/vnd.anki, application/vnd.anser-web-certificate-issue-initiation, application/vnd.anser-web-funds-transfer-initiation, application/vnd.antix.game-component, application/vnd.apache.thrift.binary, application/vnd.apache.thrift.compact, application/vnd.apache.thrift.json, application/vnd.api+json, application/vnd.apothekende.reservation+json, application/vnd.apple.installer+xml, application/vnd.apple.mpegurl, application/vnd.apple.pkpass, application/vnd.arastra.swi, application/vnd.aristanetworks.swi, application/vnd.artisan+json, application/vnd.artsquare, application/vnd.astraea-software.iota, application/vnd.audiograph, application/vnd.autopackage, application/vnd.avalon+json, application/vnd.avistar+xml, application/vnd.balsamiq.bmml+xml, application/vnd.balsamiq.bmpr, application/vnd.banana-accounting, application/vnd.bbf.usp.msg, application/vnd.bbf.usp.msg+json, application/vnd.bekitzur-stech+json, application/vnd.bint.med-content, application/vnd.biopax.rdf+xml, application/vnd.blink-idb-value-wrapper, application/vnd.blueice.multipass, application/vnd.bluetooth.ep.oob, application/vnd.bluetooth.le.oob, application/vnd.bmi, application/vnd.businessobjects, application/vnd.byu.uapi+json, application/vnd.cab-jscript, application/vnd.canon-cpdl, application/vnd.canon-lips, application/vnd.capasystems-pg+json, application/vnd.cendio.thinlinc.clientconf, application/vnd.century-systems.tcp_stream, application/vnd.chemdraw+xml, application/vnd.chess-pgn, application/vnd.chipnuts.karaoke-mmd, application/vnd.cinderella, application/vnd.cirpack.isdn-ext, application/vnd.citationstyles.style+xml, application/vnd.claymore, application/vnd.cloanto.rp9, application/vnd.clonk.c4group, application/vnd.cluetrust.cartomobile-config, application/vnd.cluetrust.cartomobile-config-pkg, application/vnd.coffeescript, application/vnd.collabio.xodocuments.document, application/vnd.collabio.xodocuments.document-template, application/vnd.collabio.xodocuments.presentation, application/vnd.collabio.xodocuments.presentation-template, application/vnd.collabio.xodocuments.spreadsheet, application/vnd.collabio.xodocuments.spreadsheet-template, application/vnd.collection+json, application/vnd.collection.doc+json, application/vnd.collection.next+json, application/vnd.comicbook+zip, application/vnd.comicbook-rar, application/vnd.commerce-battelle, application/vnd.commonspace, application/vnd.contact.cmsg, application/vnd.coreos.ignition+json, application/vnd.cosmocaller, application/vnd.crick.clicker, application/vnd.crick.clicker.keyboard, application/vnd.crick.clicker.palette, application/vnd.crick.clicker.template, application/vnd.crick.clicker.wordbank, application/vnd.criticaltools.wbs+xml, application/vnd.ctc-posml, application/vnd.ctct.ws+xml, application/vnd.cups-pdf, application/vnd.cups-postscript, application/vnd.cups-ppd, application/vnd.cups-raster, application/vnd.cups-raw, application/vnd.curl, application/vnd.curl.car, application/vnd.curl.pcurl, application/vnd.cyan.dean.root+xml, application/vnd.cybank, application/vnd.d2l.coursepackage1p0+zip, application/vnd.dart, application/vnd.data-vision.rdz, application/vnd.datapackage+json, application/vnd.dataresource+json, application/vnd.debian.binary-package, application/vnd.dece.data, application/vnd.dece.ttml+xml, application/vnd.dece.unspecified, application/vnd.dece.zip, application/vnd.denovo.fcselayout-link, application/vnd.desmume-movie, application/vnd.desmume.movie, application/vnd.dir-bi.plate-dl-nosuffix, application/vnd.dm.delegation+xml, application/vnd.dna, application/vnd.document+json, application/vnd.dolby.mlp, application/vnd.dolby.mobile.1, application/vnd.dolby.mobile.2, application/vnd.doremir.scorecloud-binary-document, application/vnd.dpgraph, application/vnd.dreamfactory, application/vnd.drive+json, application/vnd.ds-keypoint, application/vnd.dtg.local, application/vnd.dtg.local.flash, application/vnd.dtg.local.html, application/vnd.dvb.ait, application/vnd.dvb.dvbj, application/vnd.dvb.esgcontainer, application/vnd.dvb.ipdcdftnotifaccess, application/vnd.dvb.ipdcesgaccess, application/vnd.dvb.ipdcesgaccess2, application/vnd.dvb.ipdcesgpdd, application/vnd.dvb.ipdcroaming, application/vnd.dvb.iptv.alfec-base, application/vnd.dvb.iptv.alfec-enhancement, application/vnd.dvb.notif-aggregate-root+xml, application/vnd.dvb.notif-container+xml, application/vnd.dvb.notif-generic+xml, application/vnd.dvb.notif-ia-msglist+xml, application/vnd.dvb.notif-ia-registration-request+xml, application/vnd.dvb.notif-ia-registration-response+xml, application/vnd.dvb.notif-init+xml, application/vnd.dvb.pfr, application/vnd.dvb.service, application/vnd.dxr, application/vnd.dynageo, application/vnd.dzr, application/vnd.easykaraoke.cdgdownload, application/vnd.ecdis-update, application/vnd.ecip.rlp, application/vnd.ecowin.chart, application/vnd.ecowin.filerequest, application/vnd.ecowin.fileupdate, application/vnd.ecowin.series, application/vnd.ecowin.seriesrequest, application/vnd.ecowin.seriesupdate, application/vnd.efi.img, application/vnd.efi.iso, application/vnd.emclient.accessrequest+xml, application/vnd.enliven, application/vnd.enphase.envoy, application/vnd.eprints.data+xml, application/vnd.epson.esf, application/vnd.epson.msf, application/vnd.epson.quickanime, application/vnd.epson.salt, application/vnd.epson.ssf, application/vnd.ericsson.quickcall, application/vnd.espass-espass+zip, application/vnd.eszigno3+xml, application/vnd.etsi.aoc+xml, application/vnd.etsi.asic-e+zip, application/vnd.etsi.asic-s+zip, application/vnd.etsi.cug+xml, application/vnd.etsi.iptvcommand+xml, application/vnd.etsi.iptvdiscovery+xml, application/vnd.etsi.iptvprofile+xml, application/vnd.etsi.iptvsad-bc+xml, application/vnd.etsi.iptvsad-cod+xml, application/vnd.etsi.iptvsad-npvr+xml, application/vnd.etsi.iptvservice+xml, application/vnd.etsi.iptvsync+xml, application/vnd.etsi.iptvueprofile+xml, application/vnd.etsi.mcid+xml, application/vnd.etsi.mheg5, application/vnd.etsi.overload-control-policy-dataset+xml, application/vnd.etsi.pstn+xml, application/vnd.etsi.sci+xml, application/vnd.etsi.simservs+xml, application/vnd.etsi.timestamp-token, application/vnd.etsi.tsl+xml, application/vnd.etsi.tsl.der, application/vnd.eudora.data, application/vnd.evolv.ecig.profile, application/vnd.evolv.ecig.settings, application/vnd.evolv.ecig.theme, application/vnd.ezpix-album, application/vnd.ezpix-package, application/vnd.f-secure.mobile, application/vnd.fastcopy-disk-image, application/vnd.fdf, application/vnd.fdsn.mseed, application/vnd.fdsn.seed, application/vnd.ffsns, application/vnd.filmit.zfc, application/vnd.fints, application/vnd.firemonkeys.cloudcell, application/vnd.flographit, application/vnd.fluxtime.clip, application/vnd.font-fontforge-sfd, application/vnd.framemaker, application/vnd.frogans.fnc, application/vnd.frogans.ltf, application/vnd.fsc.weblaunch, application/vnd.fujitsu.oasys, application/vnd.fujitsu.oasys2, application/vnd.fujitsu.oasys3, application/vnd.fujitsu.oasysgp, application/vnd.fujitsu.oasysprs, application/vnd.fujixerox.art-ex, application/vnd.fujixerox.art4, application/vnd.fujixerox.ddd, application/vnd.fujixerox.docuworks, application/vnd.fujixerox.docuworks.binder, application/vnd.fujixerox.docuworks.container, application/vnd.fujixerox.hbpl, application/vnd.fut-misnet, application/vnd.fuzzysheet, application/vnd.genomatix.tuxedo, application/vnd.geo+json, application/vnd.geocube+xml, application/vnd.geogebra.file, application/vnd.geogebra.tool, application/vnd.geometry-explorer, application/vnd.geonext, application/vnd.geoplan, application/vnd.geospace, application/vnd.gerber, application/vnd.globalplatform.card-content-mgt, application/vnd.globalplatform.card-content-mgt-response, application/vnd.gmx, application/vnd.google-apps.document, application/vnd.google-apps.presentation, application/vnd.google-apps.spreadsheet, application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, application/vnd.gov.sk.e-form+xml, application/vnd.gov.sk.e-form+zip, application/vnd.gov.sk.xmldatacontainer+xml, application/vnd.grafeq, application/vnd.gridmp, application/vnd.groove-account, application/vnd.groove-help, application/vnd.groove-identity-message, application/vnd.groove-injector, application/vnd.groove-tool-message, application/vnd.groove-tool-template, application/vnd.groove-vcard, application/vnd.hal+json, application/vnd.hal+xml, application/vnd.handheld-entertainment+xml, application/vnd.hbci, application/vnd.hc+json, application/vnd.hcl-bireports, application/vnd.hdt, application/vnd.heroku+json, application/vnd.hhe.lesson-player, application/vnd.hp-hpgl, application/vnd.hp-hpid, application/vnd.hp-hps, application/vnd.hp-jlyt, application/vnd.hp-pcl, application/vnd.hp-pclxl, application/vnd.httphone, application/vnd.hydrostatix.sof-data, application/vnd.hyper+json, application/vnd.hyper-item+json, application/vnd.hyperdrive+json, application/vnd.hzn-3d-crossword, application/vnd.ibm.afplinedata, application/vnd.ibm.electronic-media, application/vnd.ibm.minipay, application/vnd.ibm.modcap, application/vnd.ibm.rights-management, application/vnd.ibm.secure-container, application/vnd.iccprofile, application/vnd.ieee.1905, application/vnd.igloader, application/vnd.imagemeter.folder+zip, application/vnd.imagemeter.image+zip, application/vnd.immervision-ivp, application/vnd.immervision-ivu, application/vnd.ims.imsccv1p1, application/vnd.ims.imsccv1p2, application/vnd.ims.imsccv1p3, application/vnd.ims.lis.v2.result+json, application/vnd.ims.lti.v2.toolconsumerprofile+json, application/vnd.ims.lti.v2.toolproxy+json, application/vnd.ims.lti.v2.toolproxy.id+json, application/vnd.ims.lti.v2.toolsettings+json, application/vnd.ims.lti.v2.toolsettings.simple+json, application/vnd.informedcontrol.rms+xml, application/vnd.informix-visionary, application/vnd.infotech.project, application/vnd.infotech.project+xml, application/vnd.innopath.wamp.notification, application/vnd.insors.igm, application/vnd.intercon.formnet, application/vnd.intergeo, application/vnd.intertrust.digibox, application/vnd.intertrust.nncp, application/vnd.intu.qbo, application/vnd.intu.qfx, application/vnd.iptc.g2.catalogitem+xml, application/vnd.iptc.g2.conceptitem+xml, application/vnd.iptc.g2.knowledgeitem+xml, application/vnd.iptc.g2.newsitem+xml, application/vnd.iptc.g2.newsmessage+xml, application/vnd.iptc.g2.packageitem+xml, application/vnd.iptc.g2.planningitem+xml, application/vnd.ipunplugged.rcprofile, application/vnd.irepository.package+xml, application/vnd.is-xpr, application/vnd.isac.fcs, application/vnd.jam, application/vnd.japannet-directory-service, application/vnd.japannet-jpnstore-wakeup, application/vnd.japannet-payment-wakeup, application/vnd.japannet-registration, application/vnd.japannet-registration-wakeup, application/vnd.japannet-setstore-wakeup, application/vnd.japannet-verification, application/vnd.japannet-verification-wakeup, application/vnd.jcp.javame.midlet-rms, application/vnd.jisp, application/vnd.joost.joda-archive, application/vnd.jsk.isdn-ngn, application/vnd.kahootz, application/vnd.kde.karbon, application/vnd.kde.kchart, application/vnd.kde.kformula, application/vnd.kde.kivio, application/vnd.kde.kontour, application/vnd.kde.kpresenter, application/vnd.kde.kspread, application/vnd.kde.kword, application/vnd.kenameaapp, application/vnd.kidspiration, application/vnd.kinar, application/vnd.koan, application/vnd.kodak-descriptor, application/vnd.las.las+json, application/vnd.las.las+xml, application/vnd.leap+json, application/vnd.liberty-request+xml, application/vnd.llamagraphics.life-balance.desktop, application/vnd.llamagraphics.life-balance.exchange+xml, application/vnd.lotus-1-2-3, application/vnd.lotus-approach, application/vnd.lotus-freelance, application/vnd.lotus-notes, application/vnd.lotus-organizer, application/vnd.lotus-screencam, application/vnd.lotus-wordpro, application/vnd.macports.portpkg, application/vnd.mapbox-vector-tile, application/vnd.marlin.drm.actiontoken+xml, application/vnd.marlin.drm.conftoken+xml, application/vnd.marlin.drm.license+xml, application/vnd.marlin.drm.mdcf, application/vnd.mason+json, application/vnd.maxmind.maxmind-db, application/vnd.mcd, application/vnd.medcalcdata, application/vnd.mediastation.cdkey, application/vnd.meridian-slingshot, application/vnd.mfer, application/vnd.mfmp, application/vnd.micro+json, application/vnd.micrografx.flo, application/vnd.micrografx.igx, application/vnd.microsoft.portable-executable, application/vnd.microsoft.windows.thumbnail-cache, application/vnd.miele+json, application/vnd.mif, application/vnd.minisoft-hp3000-save, application/vnd.mitsubishi.misty-guard.trustweb, application/vnd.mobius.daf, application/vnd.mobius.dis, application/vnd.mobius.mbk, application/vnd.mobius.mqy, application/vnd.mobius.msl, application/vnd.mobius.plc, application/vnd.mobius.txf, application/vnd.mophun.application, application/vnd.mophun.certificate, application/vnd.motorola.flexsuite, application/vnd.motorola.flexsuite.adsi, application/vnd.motorola.flexsuite.fis, application/vnd.motorola.flexsuite.gotap, application/vnd.motorola.flexsuite.kmr, application/vnd.motorola.flexsuite.ttc, application/vnd.motorola.flexsuite.wem, application/vnd.motorola.iprm, application/vnd.mozilla.xul+xml, application/vnd.ms-3mfdocument, application/vnd.ms-artgalry, application/vnd.ms-asf, application/vnd.ms-cab-compressed, application/vnd.ms-color.iccprofile, application/vnd.ms-excel, application/vnd.ms-excel.addin.macroenabled.12, application/vnd.ms-excel.sheet.binary.macroenabled.12, application/vnd.ms-excel.sheet.macroenabled.12, application/vnd.ms-excel.template.macroenabled.12, application/vnd.ms-fontobject, application/vnd.ms-htmlhelp, application/vnd.ms-ims, application/vnd.ms-lrm, application/vnd.ms-office.activex+xml, application/vnd.ms-officetheme, application/vnd.ms-opentype, application/vnd.ms-outlook, application/vnd.ms-package.obfuscated-opentype, application/vnd.ms-pki.seccat, application/vnd.ms-pki.stl, application/vnd.ms-playready.initiator+xml, application/vnd.ms-powerpoint, application/vnd.ms-powerpoint.addin.macroenabled.12, application/vnd.ms-powerpoint.presentation.macroenabled.12, application/vnd.ms-powerpoint.slide.macroenabled.12, application/vnd.ms-powerpoint.slideshow.macroenabled.12, application/vnd.ms-powerpoint.template.macroenabled.12, application/vnd.ms-printdevicecapabilities+xml, application/vnd.ms-printing.printticket+xml, application/vnd.ms-printschematicket+xml, application/vnd.ms-project, application/vnd.ms-tnef, application/vnd.ms-windows.devicepairing, application/vnd.ms-windows.nwprinting.oob, application/vnd.ms-windows.printerpairing, application/vnd.ms-windows.wsd.oob, application/vnd.ms-wmdrm.lic-chlg-req, application/vnd.ms-wmdrm.lic-resp, application/vnd.ms-wmdrm.meter-chlg-req, application/vnd.ms-wmdrm.meter-resp, application/vnd.ms-word.document.macroenabled.12, application/vnd.ms-word.template.macroenabled.12, application/vnd.ms-works, application/vnd.ms-wpl, application/vnd.ms-xpsdocument, application/vnd.msa-disk-image, application/vnd.mseq, application/vnd.msign, application/vnd.multiad.creator, application/vnd.multiad.creator.cif, application/vnd.music-niff, application/vnd.musician, application/vnd.muvee.style, application/vnd.mynfc, application/vnd.ncd.control, application/vnd.ncd.reference, application/vnd.nearst.inv+json, application/vnd.nervana, application/vnd.netfpx, application/vnd.neurolanguage.nlu, application/vnd.nimn, application/vnd.nintendo.nitro.rom, application/vnd.nintendo.snes.rom, application/vnd.nitf, application/vnd.noblenet-directory, application/vnd.noblenet-sealer, application/vnd.noblenet-web, application/vnd.nokia.catalogs, application/vnd.nokia.conml+wbxml, application/vnd.nokia.conml+xml, application/vnd.nokia.iptv.config+xml, application/vnd.nokia.isds-radio-presets, application/vnd.nokia.landmark+wbxml, application/vnd.nokia.landmark+xml, application/vnd.nokia.landmarkcollection+xml, application/vnd.nokia.n-gage.ac+xml, application/vnd.nokia.n-gage.data, application/vnd.nokia.n-gage.symbian.install, application/vnd.nokia.ncd, application/vnd.nokia.pcd+wbxml, application/vnd.nokia.pcd+xml, application/vnd.nokia.radio-preset, application/vnd.nokia.radio-presets, application/vnd.novadigm.edm, application/vnd.novadigm.edx, application/vnd.novadigm.ext, application/vnd.ntt-local.content-share, application/vnd.ntt-local.file-transfer, application/vnd.ntt-local.ogw_remote-access, application/vnd.ntt-local.sip-ta_remote, application/vnd.ntt-local.sip-ta_tcp_stream, application/vnd.oasis.opendocument.chart, application/vnd.oasis.opendocument.chart-template, application/vnd.oasis.opendocument.database, application/vnd.oasis.opendocument.formula, application/vnd.oasis.opendocument.formula-template, application/vnd.oasis.opendocument.graphics, application/vnd.oasis.opendocument.graphics-template, application/vnd.oasis.opendocument.image, application/vnd.oasis.opendocument.image-template, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.presentation-template, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.spreadsheet-template, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.text-master, application/vnd.oasis.opendocument.text-template, application/vnd.oasis.opendocument.text-web, application/vnd.obn, application/vnd.ocf+cbor, application/vnd.oftn.l10n+json, application/vnd.oipf.contentaccessdownload+xml, application/vnd.oipf.contentaccessstreaming+xml, application/vnd.oipf.cspg-hexbinary, application/vnd.oipf.dae.svg+xml, application/vnd.oipf.dae.xhtml+xml, application/vnd.oipf.mippvcontrolmessage+xml, application/vnd.oipf.pae.gem, application/vnd.oipf.spdiscovery+xml, application/vnd.oipf.spdlist+xml, application/vnd.oipf.ueprofile+xml, application/vnd.oipf.userprofile+xml, application/vnd.olpc-sugar, application/vnd.oma-scws-config, application/vnd.oma-scws-http-request, application/vnd.oma-scws-http-response, application/vnd.oma.bcast.associated-procedure-parameter+xml, application/vnd.oma.bcast.drm-trigger+xml, application/vnd.oma.bcast.imd+xml, application/vnd.oma.bcast.ltkm, application/vnd.oma.bcast.notification+xml, application/vnd.oma.bcast.provisioningtrigger, application/vnd.oma.bcast.sgboot, application/vnd.oma.bcast.sgdd+xml, application/vnd.oma.bcast.sgdu, application/vnd.oma.bcast.simple-symbol-container, application/vnd.oma.bcast.smartcard-trigger+xml, application/vnd.oma.bcast.sprov+xml, application/vnd.oma.bcast.stkm, application/vnd.oma.cab-address-book+xml, application/vnd.oma.cab-feature-handler+xml, application/vnd.oma.cab-pcc+xml, application/vnd.oma.cab-subs-invite+xml, application/vnd.oma.cab-user-prefs+xml, application/vnd.oma.dcd, application/vnd.oma.dcdc, application/vnd.oma.dd2+xml, application/vnd.oma.drm.risd+xml, application/vnd.oma.group-usage-list+xml, application/vnd.oma.lwm2m+json, application/vnd.oma.lwm2m+tlv, application/vnd.oma.pal+xml, application/vnd.oma.poc.detailed-progress-report+xml, application/vnd.oma.poc.final-report+xml, application/vnd.oma.poc.groups+xml, application/vnd.oma.poc.invocation-descriptor+xml, application/vnd.oma.poc.optimized-progress-report+xml, application/vnd.oma.push, application/vnd.oma.scidm.messages+xml, application/vnd.oma.xcap-directory+xml, application/vnd.omads-email+xml, application/vnd.omads-file+xml, application/vnd.omads-folder+xml, application/vnd.omaloc-supl-init, application/vnd.onepager, application/vnd.onepagertamp, application/vnd.onepagertamx, application/vnd.onepagertat, application/vnd.onepagertatp, application/vnd.onepagertatx, application/vnd.openblox.game+xml, application/vnd.openblox.game-binary, application/vnd.openeye.oeb, application/vnd.openofficeorg.extension, application/vnd.openstreetmap.data+xml, application/vnd.openxmlformats-officedocument.custom-properties+xml, application/vnd.openxmlformats-officedocument.customxmlproperties+xml, application/vnd.openxmlformats-officedocument.drawing+xml, application/vnd.openxmlformats-officedocument.drawingml.chart+xml, application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml, application/vnd.openxmlformats-officedocument.extended-properties+xml, application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml, application/vnd.openxmlformats-officedocument.presentationml.comments+xml, application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml, application/vnd.openxmlformats-officedocument.presentationml.presprops+xml, application/vnd.openxmlformats-officedocument.presentationml.slide, application/vnd.openxmlformats-officedocument.presentationml.slide+xml, application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml, application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml, application/vnd.openxmlformats-officedocument.presentationml.slideshow, application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml, application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml, application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml, application/vnd.openxmlformats-officedocument.presentationml.tags+xml, application/vnd.openxmlformats-officedocument.presentationml.template, application/vnd.openxmlformats-officedocument.presentationml.template.main+xml, application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.template, application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml, application/vnd.openxmlformats-officedocument.theme+xml, application/vnd.openxmlformats-officedocument.themeoverride+xml, application/vnd.openxmlformats-officedocument.vmldrawing, application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.template, application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml, application/vnd.openxmlformats-package.core-properties+xml, application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml, application/vnd.openxmlformats-package.relationships+xml, application/vnd.oracle.resource+json, application/vnd.orange.indata, application/vnd.osa.netdeploy, application/vnd.osgeo.mapguide.package, application/vnd.osgi.bundle, application/vnd.osgi.dp, application/vnd.osgi.subsystem, application/vnd.otps.ct-kip+xml, application/vnd.oxli.countgraph, application/vnd.pagerduty+json, application/vnd.palm, application/vnd.panoply, application/vnd.paos+xml, application/vnd.paos.xml, application/vnd.patentdive, application/vnd.pawaafile, application/vnd.pcos, application/vnd.pg.format, application/vnd.pg.osasli, application/vnd.piaccess.application-licence, application/vnd.picsel, application/vnd.pmi.widget, application/vnd.poc.group-advertisement+xml, application/vnd.pocketlearn, application/vnd.powerbuilder6, application/vnd.powerbuilder6-s, application/vnd.powerbuilder7, application/vnd.powerbuilder7-s, application/vnd.powerbuilder75, application/vnd.powerbuilder75-s, application/vnd.preminet, application/vnd.previewsystems.box, application/vnd.proteus.magazine, application/vnd.psfs, application/vnd.publishare-delta-tree, application/vnd.pvi.ptid1, application/vnd.pwg-multiplexed, application/vnd.pwg-xhtml-print+xml, application/vnd.qualcomm.brew-app-res, application/vnd.quarantainenet, application/vnd.quark.quarkxpress, application/vnd.quobject-quoxdocument, application/vnd.radisys.moml+xml, application/vnd.radisys.msml+xml, application/vnd.radisys.msml-audit+xml, application/vnd.radisys.msml-audit-conf+xml, application/vnd.radisys.msml-audit-conn+xml, application/vnd.radisys.msml-audit-dialog+xml, application/vnd.radisys.msml-audit-stream+xml, application/vnd.radisys.msml-conf+xml, application/vnd.radisys.msml-dialog+xml, application/vnd.radisys.msml-dialog-base+xml, application/vnd.radisys.msml-dialog-fax-detect+xml, application/vnd.radisys.msml-dialog-fax-sendrecv+xml, application/vnd.radisys.msml-dialog-group+xml, application/vnd.radisys.msml-dialog-speech+xml, application/vnd.radisys.msml-dialog-transform+xml, application/vnd.rainstor.data, application/vnd.rapid, application/vnd.rar, application/vnd.realvnc.bed, application/vnd.recordare.musicxml, application/vnd.recordare.musicxml+xml, application/vnd.renlearn.rlprint, application/vnd.restful+json, application/vnd.rig.cryptonote, application/vnd.rim.cod, application/vnd.rn-realmedia, application/vnd.rn-realmedia-vbr, application/vnd.route66.link66+xml, application/vnd.rs-274x, application/vnd.ruckus.download, application/vnd.s3sms, application/vnd.sailingtracker.track, application/vnd.sbm.cid, application/vnd.sbm.mid2, application/vnd.scribus, application/vnd.sealed.3df, application/vnd.sealed.csf, application/vnd.sealed.doc, application/vnd.sealed.eml, application/vnd.sealed.mht, application/vnd.sealed.net, application/vnd.sealed.ppt, application/vnd.sealed.tiff, application/vnd.sealed.xls, application/vnd.sealedmedia.softseal.html, application/vnd.sealedmedia.softseal.pdf, application/vnd.seemail, application/vnd.sema, application/vnd.semd, application/vnd.semf, application/vnd.shana.informed.formdata, application/vnd.shana.informed.formtemplate, application/vnd.shana.informed.interchange, application/vnd.shana.informed.package, application/vnd.shootproof+json, application/vnd.sigrok.session, application/vnd.simtech-mindmapper, application/vnd.siren+json, application/vnd.smaf, application/vnd.smart.notebook, application/vnd.smart.teacher, application/vnd.software602.filler.form+xml, application/vnd.software602.filler.form-xml-zip, application/vnd.solent.sdkm+xml, application/vnd.spotfire.dxp, application/vnd.spotfire.sfs, application/vnd.sqlite3, application/vnd.sss-cod, application/vnd.sss-dtf, application/vnd.sss-ntf, application/vnd.stardivision.calc, application/vnd.stardivision.draw, application/vnd.stardivision.impress, application/vnd.stardivision.math, application/vnd.stardivision.writer, application/vnd.stardivision.writer-global, application/vnd.stepmania.package, application/vnd.stepmania.stepchart, application/vnd.street-stream, application/vnd.sun.wadl+xml, application/vnd.sun.xml.calc, application/vnd.sun.xml.calc.template, application/vnd.sun.xml.draw, application/vnd.sun.xml.draw.template, application/vnd.sun.xml.impress, application/vnd.sun.xml.impress.template, application/vnd.sun.xml.math, application/vnd.sun.xml.writer, application/vnd.sun.xml.writer.global, application/vnd.sun.xml.writer.template, application/vnd.sus-calendar, application/vnd.svd, application/vnd.swiftview-ics, application/vnd.symbian.install, application/vnd.syncml+xml, application/vnd.syncml.dm+wbxml, application/vnd.syncml.dm+xml, application/vnd.syncml.dm.notification, application/vnd.syncml.dmddf+wbxml, application/vnd.syncml.dmddf+xml, application/vnd.syncml.dmtnds+wbxml, application/vnd.syncml.dmtnds+xml, application/vnd.syncml.ds.notification, application/vnd.tableschema+json, application/vnd.tao.intent-module-archive, application/vnd.tcpdump.pcap, application/vnd.think-cell.ppttc+json, application/vnd.tmd.mediaflex.api+xml, application/vnd.tml, application/vnd.tmobile-livetv, application/vnd.tri.onesource, application/vnd.trid.tpt, application/vnd.triscape.mxs, application/vnd.trueapp, application/vnd.truedoc, application/vnd.ubisoft.webplayer, application/vnd.ufdl, application/vnd.uiq.theme, application/vnd.umajin, application/vnd.unity, application/vnd.uoml+xml, application/vnd.uplanet.alert, application/vnd.uplanet.alert-wbxml, application/vnd.uplanet.bearer-choice, application/vnd.uplanet.bearer-choice-wbxml, application/vnd.uplanet.cacheop, application/vnd.uplanet.cacheop-wbxml, application/vnd.uplanet.channel, application/vnd.uplanet.channel-wbxml, application/vnd.uplanet.list, application/vnd.uplanet.list-wbxml, application/vnd.uplanet.listcmd, application/vnd.uplanet.listcmd-wbxml, application/vnd.uplanet.signal, application/vnd.uri-map, application/vnd.valve.source.material, application/vnd.vcx, application/vnd.vd-study, application/vnd.vectorworks, application/vnd.vel+json, application/vnd.verimatrix.vcas, application/vnd.vidsoft.vidconference, application/vnd.visio, application/vnd.visionary, application/vnd.vividence.scriptfile, application/vnd.vsf, application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.wbxml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.webturbo, application/vnd.wfa.p2p, application/vnd.wfa.wsc, application/vnd.windows.devicepairing, application/vnd.wmc, application/vnd.wmf.bootstrap, application/vnd.wolfram.mathematica, application/vnd.wolfram.mathematica.package, application/vnd.wolfram.player, application/vnd.wordperfect, application/vnd.wqd, application/vnd.wrq-hp3000-labelled, application/vnd.wt.stf, application/vnd.wv.csp+wbxml, application/vnd.wv.csp+xml, application/vnd.wv.ssp+xml, application/vnd.xacml+json, application/vnd.xara, application/vnd.xfdl, application/vnd.xfdl.webform, application/vnd.xmi+xml, application/vnd.xmpie.cpkg, application/vnd.xmpie.dpkg, application/vnd.xmpie.plan, application/vnd.xmpie.ppkg, application/vnd.xmpie.xlim, application/vnd.yamaha.hv-dic, application/vnd.yamaha.hv-script, application/vnd.yamaha.hv-voice, application/vnd.yamaha.openscoreformat, application/vnd.yamaha.openscoreformat.osfpvg+xml, application/vnd.yamaha.remote-setup, application/vnd.yamaha.smaf-audio, application/vnd.yamaha.smaf-phrase, application/vnd.yamaha.through-ngn, application/vnd.yamaha.tunnel-udpencap, application/vnd.yaoweme, application/vnd.yellowriver-custom-menu, application/vnd.youtube.yt, application/vnd.zul, application/vnd.zzazz.deck+xml, application/voicexml+xml, application/voucher-cms+json, application/vq-rtcpxr, application/wasm, application/watcherinfo+xml, application/webpush-options+json, application/whoispp-query, application/whoispp-response, application/widget, application/winhlp, application/wita, application/wordperfect5.1, application/wsdl+xml, application/wspolicy+xml, application/x-7z-compressed, application/x-abiword, application/x-ace-compressed, application/x-amf, application/x-apple-diskimage, application/x-arj, application/x-authorware-bin, application/x-authorware-map, application/x-authorware-seg, application/x-bcpio, application/x-bdoc, application/x-bittorrent, application/x-blorb, application/x-bzip, application/x-bzip2, application/x-cbr, application/x-cdlink, application/x-cfs-compressed, application/x-chat, application/x-chess-pgn, application/x-chrome-extension, application/x-cocoa, application/x-compress, application/x-conference, application/x-cpio, application/x-csh, application/x-deb, application/x-debian-package, application/x-dgc-compressed, application/x-director, application/x-doom, application/x-dtbncx+xml, application/x-dtbook+xml, application/x-dtbresource+xml, application/x-dvi, application/x-envoy, application/x-eva, application/x-font-bdf, application/x-font-dos, application/x-font-framemaker, application/x-font-ghostscript, application/x-font-libgrx, application/x-font-linux-psf, application/x-font-pcf, application/x-font-snf, application/x-font-speedo, application/x-font-sunos-news, application/x-font-type1, application/x-font-vfont, application/x-freearc, application/x-futuresplash, application/x-gca-compressed, application/x-glulx, application/x-gnumeric, application/x-gramps-xml, application/x-gtar, application/x-gzip, application/x-hdf, application/x-httpd-php, application/x-install-instructions, application/x-iso9660-image, application/x-java-archive-diff, application/x-java-jnlp-file, application/x-javascript, application/x-latex, application/x-lua-bytecode, application/x-lzh-compressed, application/x-makeself, application/x-mie, application/x-mobipocket-ebook, application/x-mpegurl, application/x-ms-application, application/x-ms-shortcut, application/x-ms-wmd, application/x-ms-wmz, application/x-ms-xbap, application/x-msaccess, application/x-msbinder, application/x-mscardfile, application/x-msclip, application/x-msdos-program, application/x-msdownload, application/x-msmediaview, application/x-msmetafile, application/x-msmoney, application/x-mspublisher, application/x-msschedule, application/x-msterminal, application/x-mswrite, application/x-netcdf, application/x-ns-proxy-autoconfig, application/x-nzb, application/x-perl, application/x-pilot, application/x-pkcs12, application/x-pkcs7-certificates, application/x-pkcs7-certreqresp, application/x-rar-compressed, application/x-redhat-package-manager, application/x-research-info-systems, application/x-sea, application/x-sh, application/x-shar, application/x-shockwave-flash, application/x-silverlight-app, application/x-sql, application/x-stuffit, application/x-stuffitx, application/x-subrip, application/x-sv4cpio, application/x-sv4crc, application/x-t3vm-image, application/x-tads, application/x-tar, application/x-tcl, application/x-tex, application/x-tex-tfm, application/x-texinfo, application/x-tgif, application/x-ustar, application/x-virtualbox-hdd, application/x-virtualbox-ova, application/x-virtualbox-ovf, application/x-virtualbox-vbox, application/x-virtualbox-vbox-extpack, application/x-virtualbox-vdi, application/x-virtualbox-vhd, application/x-virtualbox-vmdk, application/x-wais-source, application/x-web-app-manifest+json, application/x-www-form-urlencoded, application/x-x509-ca-cert, application/x-xfig, application/x-xliff+xml, application/x-xpinstall, application/x-xz, application/x-zmachine, application/x400-bp, application/xacml+xml, application/xaml+xml, application/xcap-att+xml, application/xcap-caps+xml, application/xcap-diff+xml, application/xcap-el+xml, application/xcap-error+xml, application/xcap-ns+xml, application/xcon-conference-info+xml, application/xcon-conference-info-diff+xml, application/xenc+xml, application/xhtml+xml, application/xhtml-voice+xml, application/xliff+xml, application/xml, application/xml-dtd, application/xml-external-parsed-entity, application/xml-patch+xml, application/xmpp+xml, application/xop+xml, application/xproc+xml, application/xslt+xml, application/xspf+xml, application/xv+xml, application/yang, application/yang-data+json, application/yang-data+xml, application/yang-patch+json, application/yang-patch+xml, application/yin+xml, application/zip, application/zlib, audio/1d-interleaved-parityfec, audio/32kadpcm, audio/3gpp, audio/3gpp2, audio/aac, audio/ac3, audio/adpcm, audio/amr, audio/amr-wb, audio/amr-wb+, audio/aptx, audio/asc, audio/atrac-advanced-lossless, audio/atrac-x, audio/atrac3, audio/basic, audio/bv16, audio/bv32, audio/clearmode, audio/cn, audio/dat12, audio/dls, audio/dsr-es201108, audio/dsr-es202050, audio/dsr-es202211, audio/dsr-es202212, audio/dv, audio/dvi4, audio/eac3, audio/encaprtp, audio/evrc, audio/evrc-qcp, audio/evrc0, audio/evrc1, audio/evrcb, audio/evrcb0, audio/evrcb1, audio/evrcnw, audio/evrcnw0, audio/evrcnw1, audio/evrcwb, audio/evrcwb0, audio/evrcwb1, audio/evs, audio/fwdred, audio/g711-0, audio/g719, audio/g722, audio/g7221, audio/g723, audio/g726-16, audio/g726-24, audio/g726-32, audio/g726-40, audio/g728, audio/g729, audio/g7291, audio/g729d, audio/g729e, audio/gsm, audio/gsm-efr, audio/gsm-hr-08, audio/ilbc, audio/ip-mr_v2.5, audio/isac, audio/l16, audio/l20, audio/l24, audio/l8, audio/lpc, audio/melp, audio/melp1200, audio/melp2400, audio/melp600, audio/midi, audio/mobile-xmf, audio/mp3, audio/mp4, audio/mp4a-latm, audio/mpa, audio/mpa-robust, audio/mpeg, audio/mpeg4-generic, audio/musepack, audio/ogg, audio/opus, audio/parityfec, audio/pcma, audio/pcma-wb, audio/pcmu, audio/pcmu-wb, audio/prs.sid, audio/qcelp, audio/raptorfec, audio/red, audio/rtp-enc-aescm128, audio/rtp-midi, audio/rtploopback, audio/rtx, audio/s3m, audio/silk, audio/smv, audio/smv-qcp, audio/smv0, audio/sp-midi, audio/speex, audio/t140c, audio/t38, audio/telephone-event, audio/tone, audio/uemclip, audio/ulpfec, audio/usac, audio/vdvi, audio/vmr-wb, audio/vnd.3gpp.iufp, audio/vnd.4sb, audio/vnd.audiokoz, audio/vnd.celp, audio/vnd.cisco.nse, audio/vnd.cmles.radio-events, audio/vnd.cns.anp1, audio/vnd.cns.inf1, audio/vnd.dece.audio, audio/vnd.digital-winds, audio/vnd.dlna.adts, audio/vnd.dolby.heaac.1, audio/vnd.dolby.heaac.2, audio/vnd.dolby.mlp, audio/vnd.dolby.mps, audio/vnd.dolby.pl2, audio/vnd.dolby.pl2x, audio/vnd.dolby.pl2z, audio/vnd.dolby.pulse.1, audio/vnd.dra, audio/vnd.dts, audio/vnd.dts.hd, audio/vnd.dvb.file, audio/vnd.everad.plj, audio/vnd.hns.audio, audio/vnd.lucent.voice, audio/vnd.ms-playready.media.pya, audio/vnd.nokia.mobile-xmf, audio/vnd.nortel.vbk, audio/vnd.nuera.ecelp4800, audio/vnd.nuera.ecelp7470, audio/vnd.nuera.ecelp9600, audio/vnd.octel.sbc, audio/vnd.presonus.multitrack, audio/vnd.qcelp, audio/vnd.rhetorex.32kadpcm, audio/vnd.rip, audio/vnd.rn-realaudio, audio/vnd.sealedmedia.softseal.mpeg, audio/vnd.vmx.cvsd, audio/vnd.wave, audio/vorbis, audio/vorbis-config, audio/wav, audio/wave, audio/webm, audio/x-aac, audio/x-aiff, audio/x-caf, audio/x-flac, audio/x-m4a, audio/x-matroska, audio/x-mpegurl, audio/x-ms-wax, audio/x-ms-wma, audio/x-pn-realaudio, audio/x-pn-realaudio-plugin, audio/x-realaudio, audio/x-tta, audio/x-wav, audio/xm, chemical/x-cdx, chemical/x-cif, chemical/x-cmdf, chemical/x-cml, chemical/x-csml, chemical/x-pdb, chemical/x-xyz, font/collection, font/otf, font/sfnt, font/ttf, font/woff, font/woff2, image/aces, image/apng, image/bmp, image/cgm, image/dicom-rle, image/emf, image/fits, image/g3fax, image/gif, image/ief, image/jls, image/jp2, image/jpeg, image/jpm, image/jpx, image/ktx, image/naplps, image/pjpeg, image/png, image/prs.btif, image/prs.pti, image/pwg-raster, image/sgi, image/svg+xml, image/t38, image/tiff, image/tiff-fx, image/vnd.adobe.photoshop, image/vnd.airzip.accelerator.azv, image/vnd.cns.inf2, image/vnd.dece.graphic, image/vnd.djvu, image/vnd.dvb.subtitle, image/vnd.dwg, image/vnd.dxf, image/vnd.fastbidsheet, image/vnd.fpx, image/vnd.fst, image/vnd.fujixerox.edmics-mmr, image/vnd.fujixerox.edmics-rlc, image/vnd.globalgraphics.pgb, image/vnd.microsoft.icon, image/vnd.mix, image/vnd.mozilla.apng, image/vnd.ms-modi, image/vnd.ms-photo, image/vnd.net-fpx, image/vnd.radiance, image/vnd.sealed.png, image/vnd.sealedmedia.softseal.gif, image/vnd.sealedmedia.softseal.jpg, image/vnd.svf, image/vnd.tencent.tap, image/vnd.valve.source.texture, image/vnd.wap.wbmp, image/vnd.xiff, image/vnd.zbrush.pcx, image/webp, image/wmf, image/x-3ds, image/x-cmu-raster, image/x-cmx, image/x-freehand, image/x-icon, image/x-jng, image/x-mrsid-image, image/x-ms-bmp, image/x-pcx, image/x-pict, image/x-portable-anymap, image/x-portable-bitmap, image/x-portable-graymap, image/x-portable-pixmap, image/x-rgb, image/x-tga, image/x-xbitmap, image/x-xcf, image/x-xpixmap, image/x-xwindowdump, message/cpim, message/delivery-status, message/disposition-notification, message/external-body, message/feedback-report, message/global, message/global-delivery-status, message/global-disposition-notification, message/global-headers, message/http, message/imdn+xml, message/news, message/partial, message/rfc822, message/s-http, message/sip, message/sipfrag, message/tracking-status, message/vnd.si.simp, message/vnd.wfa.wsc, model/3mf, model/gltf+json, model/gltf-binary, model/iges, model/mesh, model/stl, model/vnd.collada+xml, model/vnd.dwf, model/vnd.flatland.3dml, model/vnd.gdl, model/vnd.gs-gdl, model/vnd.gs.gdl, model/vnd.gtw, model/vnd.moml+xml, model/vnd.mts, model/vnd.opengex, model/vnd.parasolid.transmit.binary, model/vnd.parasolid.transmit.text, model/vnd.rosette.annotated-data-model, model/vnd.usdz+zip, model/vnd.valve.source.compiled-map, model/vnd.vtu, model/vrml, model/x3d+binary, model/x3d+fastinfoset, model/x3d+vrml, model/x3d+xml, model/x3d-vrml, multipart/alternative, multipart/appledouble, multipart/byteranges, multipart/digest, multipart/encrypted, multipart/form-data, multipart/header-set, multipart/mixed, multipart/multilingual, multipart/parallel, multipart/related, multipart/report, multipart/signed, multipart/vnd.bint.med-plus, multipart/voice-message, multipart/x-mixed-replace, text/1d-interleaved-parityfec, text/cache-manifest, text/calendar, text/calender, text/cmd, text/coffeescript, text/css, text/csv, text/csv-schema, text/directory, text/dns, text/ecmascript, text/encaprtp, text/enriched, text/fwdred, text/grammar-ref-list, text/html, text/jade, text/javascript, text/jcr-cnd, text/jsx, text/less, text/markdown, text/mathml, text/mizar, text/n3, text/parameters, text/parityfec, text/plain, text/provenance-notation, text/prs.fallenstein.rst, text/prs.lines.tag, text/prs.prop.logic, text/raptorfec, text/red, text/rfc822-headers, text/richtext, text/rtf, text/rtp-enc-aescm128, text/rtploopback, text/rtx, text/sgml, text/shex, text/slim, text/strings, text/stylus, text/t140, text/tab-separated-values, text/troff, text/turtle, text/ulpfec, text/uri-list, text/vcard, text/vnd.a, text/vnd.abc, text/vnd.ascii-art, text/vnd.curl, text/vnd.curl.dcurl, text/vnd.curl.mcurl, text/vnd.curl.scurl, text/vnd.debian.copyright, text/vnd.dmclientscript, text/vnd.dvb.subtitle, text/vnd.esmertec.theme-descriptor, text/vnd.fly, text/vnd.fmi.flexstor, text/vnd.gml, text/vnd.graphviz, text/vnd.hgl, text/vnd.in3d.3dml, text/vnd.in3d.spot, text/vnd.iptc.newsml, text/vnd.iptc.nitf, text/vnd.latex-z, text/vnd.motorola.reflex, text/vnd.ms-mediapackage, text/vnd.net2phone.commcenter.command, text/vnd.radisys.msml-basic-layout, text/vnd.si.uricatalogue, text/vnd.sun.j2me.app-descriptor, text/vnd.trolltech.linguist, text/vnd.wap.si, text/vnd.wap.sl, text/vnd.wap.wml, text/vnd.wap.wmlscript, text/vtt, text/x-asm, text/x-c, text/x-component, text/x-fortran, text/x-gwt-rpc, text/x-handlebars-template, text/x-java-source, text/x-jquery-tmpl, text/x-lua, text/x-markdown, text/x-nfo, text/x-opml, text/x-org, text/x-pascal, text/x-processing, text/x-sass, text/x-scss, text/x-setext, text/x-sfv, text/x-suse-ymp, text/x-uuencode, text/x-vcalendar, text/x-vcard, text/xml, text/xml-external-parsed-entity, text/yaml, video/1d-interleaved-parityfec, video/3gpp, video/3gpp-tt, video/3gpp2, video/bmpeg, video/bt656, video/celb, video/dv, video/encaprtp, video/h261, video/h263, video/h263-1998, video/h263-2000, video/h264, video/h264-rcdo, video/h264-svc, video/h265, video/iso.segment, video/jpeg, video/jpeg2000, video/jpm, video/mj2, video/mp1s, video/mp2p, video/mp2t, video/mp4, video/mp4v-es, video/mpeg, video/mpeg4-generic, video/mpv, video/nv, video/ogg, video/parityfec, video/pointer, video/quicktime, video/raptorfec, video/raw, video/rtp-enc-aescm128, video/rtploopback, video/rtx, video/smpte291, video/smpte292m, video/ulpfec, video/vc1, video/vnd.cctv, video/vnd.dece.hd, video/vnd.dece.mobile, video/vnd.dece.mp4, video/vnd.dece.pd, video/vnd.dece.sd, video/vnd.dece.video, video/vnd.directv.mpeg, video/vnd.directv.mpeg-tts, video/vnd.dlna.mpeg-tts, video/vnd.dvb.file, video/vnd.fvt, video/vnd.hns.video, video/vnd.iptvforum.1dparityfec-1010, video/vnd.iptvforum.1dparityfec-2005, video/vnd.iptvforum.2dparityfec-1010, video/vnd.iptvforum.2dparityfec-2005, video/vnd.iptvforum.ttsavc, video/vnd.iptvforum.ttsmpeg2, video/vnd.motorola.video, video/vnd.motorola.videop, video/vnd.mpegurl, video/vnd.ms-playready.media.pyv, video/vnd.nokia.interleaved-multimedia, video/vnd.nokia.mp4vr, video/vnd.nokia.videovoip, video/vnd.objectvideo, video/vnd.radgamettools.bink, video/vnd.radgamettools.smacker, video/vnd.sealed.mpeg1, video/vnd.sealed.mpeg4, video/vnd.sealed.swf, video/vnd.sealedmedia.softseal.mov, video/vnd.uvvu.mp4, video/vnd.vivo, video/vp8, video/webm, video/x-f4v, video/x-fli, video/x-flv, video/x-m4v, video/x-matroska, video/x-mng, video/x-ms-asf, video/x-ms-vob, video/x-ms-wm, video/x-ms-wmv, video/x-ms-wmx, video/x-ms-wvx, video/x-msvideo, video/x-sgi-movie, video/x-smv, x-conference/x-cooltalk, x-shader/x-fragment, x-shader/x-vertex, default */ /***/ (function(module) { module.exports = {"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/cbor":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["ecma","es"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true},"application/fhir+json":{"source":"iana","compressible":true},"application/fhir+xml":{"source":"iana","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mmt-usd+xml":{"source":"iana","compressible":true},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","compressible":true},"application/msc-mixer+xml":{"source":"iana","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana"},"application/n-triples":{"source":"iana"},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana"},"application/news-groupinfo":{"source":"iana"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana"},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","compressible":true},"application/pidf-diff+xml":{"source":"iana","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true},"application/route-s-tsid+xml":{"source":"iana","compressible":true},"application/route-usd+xml":{"source":"iana","compressible":true},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana"},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true},"application/tve-trigger":{"source":"iana"},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true},"application/urc-targetdesc+xml":{"source":"iana","compressible":true},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume-movie":{"source":"iana"},"application/vnd.desmume.movie":{"source":"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos+xml":{"source":"iana","compressible":true},"application/vnd.paos.xml":{"source":"apache"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana"},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","compressible":true},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"apache","extensions":["der","crt","pem"]},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true},"application/xcap-caps+xml":{"source":"iana","compressible":true},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana"},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana"},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana"},"image/apng":{"compressible":false,"extensions":["apng"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana"},"image/emf":{"source":"iana"},"image/fits":{"source":"iana"},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana"},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana"},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana"},"image/tiff":{"source":"iana","compressible":false,"extensions":["tiff","tif"]},"image/tiff-fx":{"source":"iana"},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana"},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana"},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana"},"image/vnd.valve.source.texture":{"source":"iana"},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana"},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana"},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/stl":{"source":"iana"},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana"},"model/vnd.parasolid.transmit.binary":{"source":"iana"},"model/vnd.parasolid.transmit.text":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.usdz+zip":{"source":"iana","compressible":false},"model/vnd.valve.source.compiled-map":{"source":"iana"},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana"},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana"},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana","compressible":false},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana"},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}; /***/ }), /***/ "./node_modules/mime-types/node_modules/mime-db/index.js": /*!***************************************************************!*\ !*** ./node_modules/mime-types/node_modules/mime-db/index.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * mime-db * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. */ module.exports = __webpack_require__(/*! ./db.json */ "./node_modules/mime-types/node_modules/mime-db/db.json"); /***/ }), /***/ "./node_modules/mime/mime.js": /*!***********************************!*\ !*** ./node_modules/mime/mime.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(/*! path */ "path"); var fs = __webpack_require__(/*! fs */ "fs"); function Mime() { // Map of extension -> mime type this.types = Object.create(null); // Map of mime type -> extension this.extensions = Object.create(null); } /** * Define mimetype -> extension mappings. Each key is a mime-type that maps * to an array of extensions associated with the type. The first extension is * used as the default extension for the type. * * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); * * @param map (Object) type definitions */ Mime.prototype.define = function (map) { for (var type in map) { var exts = map[type]; for (var i = 0; i < exts.length; i++) { if (process.env.DEBUG_MIME && this.types[exts[i]]) { console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + ' to ' + type); } this.types[exts[i]] = type; } // Default extension is the first one we encounter if (!this.extensions[type]) { this.extensions[type] = exts[0]; } } }; /** * Load an Apache2-style ".types" file * * This may be called multiple times (it's expected). Where files declare * overlapping types/extensions, the last file wins. * * @param file (String) path of file to load. */ Mime.prototype.load = function (file) { this._loading = file; // Read file and split into lines var map = {}, content = fs.readFileSync(file, 'ascii'), lines = content.split(/[\r\n]+/); lines.forEach(function (line) { // Clean up whitespace/comments, and split into fields var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); map[fields.shift()] = fields; }); this.define(map); this._loading = null; }; /** * Lookup a mime type based on extension */ Mime.prototype.lookup = function (path, fallback) { var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase(); return this.types[ext] || fallback || this.default_type; }; /** * Return file extension associated with a mime type */ Mime.prototype.extension = function (mimeType) { var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); return this.extensions[type]; }; // Default instance var mime = new Mime(); // Define built-in types mime.define(__webpack_require__(/*! ./types.json */ "./node_modules/mime/types.json")); // Default type mime.default_type = mime.lookup('bin'); // // Additional API specific to the default instance // mime.Mime = Mime; /** * Lookup a charset based on mime type. */ mime.charsets = { lookup: function lookup(mimeType, fallback) { // Assume text types are utf8 return (/^text\/|^application\/(javascript|json)/.test(mimeType) ? 'UTF-8' : fallback ); } }; module.exports = mime; /***/ }), /***/ "./node_modules/mime/types.json": /*!**************************************!*\ !*** ./node_modules/mime/types.json ***! \**************************************/ /*! exports provided: application/andrew-inset, application/applixware, application/atom+xml, application/atomcat+xml, application/atomsvc+xml, application/bdoc, application/ccxml+xml, application/cdmi-capability, application/cdmi-container, application/cdmi-domain, application/cdmi-object, application/cdmi-queue, application/cu-seeme, application/dash+xml, application/davmount+xml, application/docbook+xml, application/dssc+der, application/dssc+xml, application/ecmascript, application/emma+xml, application/epub+zip, application/exi, application/font-tdpfr, application/font-woff, application/font-woff2, application/geo+json, application/gml+xml, application/gpx+xml, application/gxf, application/gzip, application/hyperstudio, application/inkml+xml, application/ipfix, application/java-archive, application/java-serialized-object, application/java-vm, application/javascript, application/json, application/json5, application/jsonml+json, application/ld+json, application/lost+xml, application/mac-binhex40, application/mac-compactpro, application/mads+xml, application/manifest+json, application/marc, application/marcxml+xml, application/mathematica, application/mathml+xml, application/mbox, application/mediaservercontrol+xml, application/metalink+xml, application/metalink4+xml, application/mets+xml, application/mods+xml, application/mp21, application/mp4, application/msword, application/mxf, application/octet-stream, application/oda, application/oebps-package+xml, application/ogg, application/omdoc+xml, application/onenote, application/oxps, application/patch-ops-error+xml, application/pdf, application/pgp-encrypted, application/pgp-signature, application/pics-rules, application/pkcs10, application/pkcs7-mime, application/pkcs7-signature, application/pkcs8, application/pkix-attr-cert, application/pkix-cert, application/pkix-crl, application/pkix-pkipath, application/pkixcmp, application/pls+xml, application/postscript, application/prs.cww, application/pskc+xml, application/rdf+xml, application/reginfo+xml, application/relax-ng-compact-syntax, application/resource-lists+xml, application/resource-lists-diff+xml, application/rls-services+xml, application/rpki-ghostbusters, application/rpki-manifest, application/rpki-roa, application/rsd+xml, application/rss+xml, application/rtf, application/sbml+xml, application/scvp-cv-request, application/scvp-cv-response, application/scvp-vp-request, application/scvp-vp-response, application/sdp, application/set-payment-initiation, application/set-registration-initiation, application/shf+xml, application/smil+xml, application/sparql-query, application/sparql-results+xml, application/srgs, application/srgs+xml, application/sru+xml, application/ssdl+xml, application/ssml+xml, application/tei+xml, application/thraud+xml, application/timestamped-data, application/vnd.3gpp.pic-bw-large, application/vnd.3gpp.pic-bw-small, application/vnd.3gpp.pic-bw-var, application/vnd.3gpp2.tcap, application/vnd.3m.post-it-notes, application/vnd.accpac.simply.aso, application/vnd.accpac.simply.imp, application/vnd.acucobol, application/vnd.acucorp, application/vnd.adobe.air-application-installer-package+zip, application/vnd.adobe.formscentral.fcdt, application/vnd.adobe.fxp, application/vnd.adobe.xdp+xml, application/vnd.adobe.xfdf, application/vnd.ahead.space, application/vnd.airzip.filesecure.azf, application/vnd.airzip.filesecure.azs, application/vnd.amazon.ebook, application/vnd.americandynamics.acc, application/vnd.amiga.ami, application/vnd.android.package-archive, application/vnd.anser-web-certificate-issue-initiation, application/vnd.anser-web-funds-transfer-initiation, application/vnd.antix.game-component, application/vnd.apple.installer+xml, application/vnd.apple.mpegurl, application/vnd.apple.pkpass, application/vnd.aristanetworks.swi, application/vnd.astraea-software.iota, application/vnd.audiograph, application/vnd.blueice.multipass, application/vnd.bmi, application/vnd.businessobjects, application/vnd.chemdraw+xml, application/vnd.chipnuts.karaoke-mmd, application/vnd.cinderella, application/vnd.claymore, application/vnd.cloanto.rp9, application/vnd.clonk.c4group, application/vnd.cluetrust.cartomobile-config, application/vnd.cluetrust.cartomobile-config-pkg, application/vnd.commonspace, application/vnd.contact.cmsg, application/vnd.cosmocaller, application/vnd.crick.clicker, application/vnd.crick.clicker.keyboard, application/vnd.crick.clicker.palette, application/vnd.crick.clicker.template, application/vnd.crick.clicker.wordbank, application/vnd.criticaltools.wbs+xml, application/vnd.ctc-posml, application/vnd.cups-ppd, application/vnd.curl.car, application/vnd.curl.pcurl, application/vnd.dart, application/vnd.data-vision.rdz, application/vnd.dece.data, application/vnd.dece.ttml+xml, application/vnd.dece.unspecified, application/vnd.dece.zip, application/vnd.denovo.fcselayout-link, application/vnd.dna, application/vnd.dolby.mlp, application/vnd.dpgraph, application/vnd.dreamfactory, application/vnd.ds-keypoint, application/vnd.dvb.ait, application/vnd.dvb.service, application/vnd.dynageo, application/vnd.ecowin.chart, application/vnd.enliven, application/vnd.epson.esf, application/vnd.epson.msf, application/vnd.epson.quickanime, application/vnd.epson.salt, application/vnd.epson.ssf, application/vnd.eszigno3+xml, application/vnd.ezpix-album, application/vnd.ezpix-package, application/vnd.fdf, application/vnd.fdsn.mseed, application/vnd.fdsn.seed, application/vnd.flographit, application/vnd.fluxtime.clip, application/vnd.framemaker, application/vnd.frogans.fnc, application/vnd.frogans.ltf, application/vnd.fsc.weblaunch, application/vnd.fujitsu.oasys, application/vnd.fujitsu.oasys2, application/vnd.fujitsu.oasys3, application/vnd.fujitsu.oasysgp, application/vnd.fujitsu.oasysprs, application/vnd.fujixerox.ddd, application/vnd.fujixerox.docuworks, application/vnd.fujixerox.docuworks.binder, application/vnd.fuzzysheet, application/vnd.genomatix.tuxedo, application/vnd.geogebra.file, application/vnd.geogebra.tool, application/vnd.geometry-explorer, application/vnd.geonext, application/vnd.geoplan, application/vnd.geospace, application/vnd.gmx, application/vnd.google-apps.document, application/vnd.google-apps.presentation, application/vnd.google-apps.spreadsheet, application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, application/vnd.grafeq, application/vnd.groove-account, application/vnd.groove-help, application/vnd.groove-identity-message, application/vnd.groove-injector, application/vnd.groove-tool-message, application/vnd.groove-tool-template, application/vnd.groove-vcard, application/vnd.hal+xml, application/vnd.handheld-entertainment+xml, application/vnd.hbci, application/vnd.hhe.lesson-player, application/vnd.hp-hpgl, application/vnd.hp-hpid, application/vnd.hp-hps, application/vnd.hp-jlyt, application/vnd.hp-pcl, application/vnd.hp-pclxl, application/vnd.hydrostatix.sof-data, application/vnd.ibm.minipay, application/vnd.ibm.modcap, application/vnd.ibm.rights-management, application/vnd.ibm.secure-container, application/vnd.iccprofile, application/vnd.igloader, application/vnd.immervision-ivp, application/vnd.immervision-ivu, application/vnd.insors.igm, application/vnd.intercon.formnet, application/vnd.intergeo, application/vnd.intu.qbo, application/vnd.intu.qfx, application/vnd.ipunplugged.rcprofile, application/vnd.irepository.package+xml, application/vnd.is-xpr, application/vnd.isac.fcs, application/vnd.jam, application/vnd.jcp.javame.midlet-rms, application/vnd.jisp, application/vnd.joost.joda-archive, application/vnd.kahootz, application/vnd.kde.karbon, application/vnd.kde.kchart, application/vnd.kde.kformula, application/vnd.kde.kivio, application/vnd.kde.kontour, application/vnd.kde.kpresenter, application/vnd.kde.kspread, application/vnd.kde.kword, application/vnd.kenameaapp, application/vnd.kidspiration, application/vnd.kinar, application/vnd.koan, application/vnd.kodak-descriptor, application/vnd.las.las+xml, application/vnd.llamagraphics.life-balance.desktop, application/vnd.llamagraphics.life-balance.exchange+xml, application/vnd.lotus-1-2-3, application/vnd.lotus-approach, application/vnd.lotus-freelance, application/vnd.lotus-notes, application/vnd.lotus-organizer, application/vnd.lotus-screencam, application/vnd.lotus-wordpro, application/vnd.macports.portpkg, application/vnd.mcd, application/vnd.medcalcdata, application/vnd.mediastation.cdkey, application/vnd.mfer, application/vnd.mfmp, application/vnd.micrografx.flo, application/vnd.micrografx.igx, application/vnd.mif, application/vnd.mobius.daf, application/vnd.mobius.dis, application/vnd.mobius.mbk, application/vnd.mobius.mqy, application/vnd.mobius.msl, application/vnd.mobius.plc, application/vnd.mobius.txf, application/vnd.mophun.application, application/vnd.mophun.certificate, application/vnd.mozilla.xul+xml, application/vnd.ms-artgalry, application/vnd.ms-cab-compressed, application/vnd.ms-excel, application/vnd.ms-excel.addin.macroenabled.12, application/vnd.ms-excel.sheet.binary.macroenabled.12, application/vnd.ms-excel.sheet.macroenabled.12, application/vnd.ms-excel.template.macroenabled.12, application/vnd.ms-fontobject, application/vnd.ms-htmlhelp, application/vnd.ms-ims, application/vnd.ms-lrm, application/vnd.ms-officetheme, application/vnd.ms-outlook, application/vnd.ms-pki.seccat, application/vnd.ms-pki.stl, application/vnd.ms-powerpoint, application/vnd.ms-powerpoint.addin.macroenabled.12, application/vnd.ms-powerpoint.presentation.macroenabled.12, application/vnd.ms-powerpoint.slide.macroenabled.12, application/vnd.ms-powerpoint.slideshow.macroenabled.12, application/vnd.ms-powerpoint.template.macroenabled.12, application/vnd.ms-project, application/vnd.ms-word.document.macroenabled.12, application/vnd.ms-word.template.macroenabled.12, application/vnd.ms-works, application/vnd.ms-wpl, application/vnd.ms-xpsdocument, application/vnd.mseq, application/vnd.musician, application/vnd.muvee.style, application/vnd.mynfc, application/vnd.neurolanguage.nlu, application/vnd.nitf, application/vnd.noblenet-directory, application/vnd.noblenet-sealer, application/vnd.noblenet-web, application/vnd.nokia.n-gage.data, application/vnd.nokia.n-gage.symbian.install, application/vnd.nokia.radio-preset, application/vnd.nokia.radio-presets, application/vnd.novadigm.edm, application/vnd.novadigm.edx, application/vnd.novadigm.ext, application/vnd.oasis.opendocument.chart, application/vnd.oasis.opendocument.chart-template, application/vnd.oasis.opendocument.database, application/vnd.oasis.opendocument.formula, application/vnd.oasis.opendocument.formula-template, application/vnd.oasis.opendocument.graphics, application/vnd.oasis.opendocument.graphics-template, application/vnd.oasis.opendocument.image, application/vnd.oasis.opendocument.image-template, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.presentation-template, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.spreadsheet-template, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.text-master, application/vnd.oasis.opendocument.text-template, application/vnd.oasis.opendocument.text-web, application/vnd.olpc-sugar, application/vnd.oma.dd2+xml, application/vnd.openofficeorg.extension, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.presentationml.slide, application/vnd.openxmlformats-officedocument.presentationml.slideshow, application/vnd.openxmlformats-officedocument.presentationml.template, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.template, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.wordprocessingml.template, application/vnd.osgeo.mapguide.package, application/vnd.osgi.dp, application/vnd.osgi.subsystem, application/vnd.palm, application/vnd.pawaafile, application/vnd.pg.format, application/vnd.pg.osasli, application/vnd.picsel, application/vnd.pmi.widget, application/vnd.pocketlearn, application/vnd.powerbuilder6, application/vnd.previewsystems.box, application/vnd.proteus.magazine, application/vnd.publishare-delta-tree, application/vnd.pvi.ptid1, application/vnd.quark.quarkxpress, application/vnd.realvnc.bed, application/vnd.recordare.musicxml, application/vnd.recordare.musicxml+xml, application/vnd.rig.cryptonote, application/vnd.rim.cod, application/vnd.rn-realmedia, application/vnd.rn-realmedia-vbr, application/vnd.route66.link66+xml, application/vnd.sailingtracker.track, application/vnd.seemail, application/vnd.sema, application/vnd.semd, application/vnd.semf, application/vnd.shana.informed.formdata, application/vnd.shana.informed.formtemplate, application/vnd.shana.informed.interchange, application/vnd.shana.informed.package, application/vnd.simtech-mindmapper, application/vnd.smaf, application/vnd.smart.teacher, application/vnd.solent.sdkm+xml, application/vnd.spotfire.dxp, application/vnd.spotfire.sfs, application/vnd.stardivision.calc, application/vnd.stardivision.draw, application/vnd.stardivision.impress, application/vnd.stardivision.math, application/vnd.stardivision.writer, application/vnd.stardivision.writer-global, application/vnd.stepmania.package, application/vnd.stepmania.stepchart, application/vnd.sun.wadl+xml, application/vnd.sun.xml.calc, application/vnd.sun.xml.calc.template, application/vnd.sun.xml.draw, application/vnd.sun.xml.draw.template, application/vnd.sun.xml.impress, application/vnd.sun.xml.impress.template, application/vnd.sun.xml.math, application/vnd.sun.xml.writer, application/vnd.sun.xml.writer.global, application/vnd.sun.xml.writer.template, application/vnd.sus-calendar, application/vnd.svd, application/vnd.symbian.install, application/vnd.syncml+xml, application/vnd.syncml.dm+wbxml, application/vnd.syncml.dm+xml, application/vnd.tao.intent-module-archive, application/vnd.tcpdump.pcap, application/vnd.tmobile-livetv, application/vnd.trid.tpt, application/vnd.triscape.mxs, application/vnd.trueapp, application/vnd.ufdl, application/vnd.uiq.theme, application/vnd.umajin, application/vnd.unity, application/vnd.uoml+xml, application/vnd.vcx, application/vnd.visio, application/vnd.visionary, application/vnd.vsf, application/vnd.wap.wbxml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.webturbo, application/vnd.wolfram.player, application/vnd.wordperfect, application/vnd.wqd, application/vnd.wt.stf, application/vnd.xara, application/vnd.xfdl, application/vnd.yamaha.hv-dic, application/vnd.yamaha.hv-script, application/vnd.yamaha.hv-voice, application/vnd.yamaha.openscoreformat, application/vnd.yamaha.openscoreformat.osfpvg+xml, application/vnd.yamaha.smaf-audio, application/vnd.yamaha.smaf-phrase, application/vnd.yellowriver-custom-menu, application/vnd.zul, application/vnd.zzazz.deck+xml, application/voicexml+xml, application/widget, application/winhlp, application/wsdl+xml, application/wspolicy+xml, application/x-7z-compressed, application/x-abiword, application/x-ace-compressed, application/x-apple-diskimage, application/x-arj, application/x-authorware-bin, application/x-authorware-map, application/x-authorware-seg, application/x-bcpio, application/x-bdoc, application/x-bittorrent, application/x-blorb, application/x-bzip, application/x-bzip2, application/x-cbr, application/x-cdlink, application/x-cfs-compressed, application/x-chat, application/x-chess-pgn, application/x-chrome-extension, application/x-cocoa, application/x-conference, application/x-cpio, application/x-csh, application/x-debian-package, application/x-dgc-compressed, application/x-director, application/x-doom, application/x-dtbncx+xml, application/x-dtbook+xml, application/x-dtbresource+xml, application/x-dvi, application/x-envoy, application/x-eva, application/x-font-bdf, application/x-font-ghostscript, application/x-font-linux-psf, application/x-font-otf, application/x-font-pcf, application/x-font-snf, application/x-font-ttf, application/x-font-type1, application/x-freearc, application/x-futuresplash, application/x-gca-compressed, application/x-glulx, application/x-gnumeric, application/x-gramps-xml, application/x-gtar, application/x-hdf, application/x-httpd-php, application/x-install-instructions, application/x-iso9660-image, application/x-java-archive-diff, application/x-java-jnlp-file, application/x-latex, application/x-lua-bytecode, application/x-lzh-compressed, application/x-makeself, application/x-mie, application/x-mobipocket-ebook, application/x-ms-application, application/x-ms-shortcut, application/x-ms-wmd, application/x-ms-wmz, application/x-ms-xbap, application/x-msaccess, application/x-msbinder, application/x-mscardfile, application/x-msclip, application/x-msdos-program, application/x-msdownload, application/x-msmediaview, application/x-msmetafile, application/x-msmoney, application/x-mspublisher, application/x-msschedule, application/x-msterminal, application/x-mswrite, application/x-netcdf, application/x-ns-proxy-autoconfig, application/x-nzb, application/x-perl, application/x-pilot, application/x-pkcs12, application/x-pkcs7-certificates, application/x-pkcs7-certreqresp, application/x-rar-compressed, application/x-redhat-package-manager, application/x-research-info-systems, application/x-sea, application/x-sh, application/x-shar, application/x-shockwave-flash, application/x-silverlight-app, application/x-sql, application/x-stuffit, application/x-stuffitx, application/x-subrip, application/x-sv4cpio, application/x-sv4crc, application/x-t3vm-image, application/x-tads, application/x-tar, application/x-tcl, application/x-tex, application/x-tex-tfm, application/x-texinfo, application/x-tgif, application/x-ustar, application/x-virtualbox-hdd, application/x-virtualbox-ova, application/x-virtualbox-ovf, application/x-virtualbox-vbox, application/x-virtualbox-vbox-extpack, application/x-virtualbox-vdi, application/x-virtualbox-vhd, application/x-virtualbox-vmdk, application/x-wais-source, application/x-web-app-manifest+json, application/x-x509-ca-cert, application/x-xfig, application/x-xliff+xml, application/x-xpinstall, application/x-xz, application/x-zmachine, application/xaml+xml, application/xcap-diff+xml, application/xenc+xml, application/xhtml+xml, application/xml, application/xml-dtd, application/xop+xml, application/xproc+xml, application/xslt+xml, application/xspf+xml, application/xv+xml, application/yang, application/yin+xml, application/zip, audio/3gpp, audio/adpcm, audio/basic, audio/midi, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/s3m, audio/silk, audio/vnd.dece.audio, audio/vnd.digital-winds, audio/vnd.dra, audio/vnd.dts, audio/vnd.dts.hd, audio/vnd.lucent.voice, audio/vnd.ms-playready.media.pya, audio/vnd.nuera.ecelp4800, audio/vnd.nuera.ecelp7470, audio/vnd.nuera.ecelp9600, audio/vnd.rip, audio/wav, audio/wave, audio/webm, audio/x-aac, audio/x-aiff, audio/x-caf, audio/x-flac, audio/x-m4a, audio/x-matroska, audio/x-mpegurl, audio/x-ms-wax, audio/x-ms-wma, audio/x-pn-realaudio, audio/x-pn-realaudio-plugin, audio/x-realaudio, audio/x-wav, audio/xm, chemical/x-cdx, chemical/x-cif, chemical/x-cmdf, chemical/x-cml, chemical/x-csml, chemical/x-xyz, font/otf, image/apng, image/bmp, image/cgm, image/g3fax, image/gif, image/ief, image/jpeg, image/ktx, image/png, image/prs.btif, image/sgi, image/svg+xml, image/tiff, image/vnd.adobe.photoshop, image/vnd.dece.graphic, image/vnd.djvu, image/vnd.dvb.subtitle, image/vnd.dwg, image/vnd.dxf, image/vnd.fastbidsheet, image/vnd.fpx, image/vnd.fst, image/vnd.fujixerox.edmics-mmr, image/vnd.fujixerox.edmics-rlc, image/vnd.ms-modi, image/vnd.ms-photo, image/vnd.net-fpx, image/vnd.wap.wbmp, image/vnd.xiff, image/webp, image/x-3ds, image/x-cmu-raster, image/x-cmx, image/x-freehand, image/x-icon, image/x-jng, image/x-mrsid-image, image/x-ms-bmp, image/x-pcx, image/x-pict, image/x-portable-anymap, image/x-portable-bitmap, image/x-portable-graymap, image/x-portable-pixmap, image/x-rgb, image/x-tga, image/x-xbitmap, image/x-xpixmap, image/x-xwindowdump, message/rfc822, model/gltf+json, model/gltf-binary, model/iges, model/mesh, model/vnd.collada+xml, model/vnd.dwf, model/vnd.gdl, model/vnd.gtw, model/vnd.mts, model/vnd.vtu, model/vrml, model/x3d+binary, model/x3d+vrml, model/x3d+xml, text/cache-manifest, text/calendar, text/coffeescript, text/css, text/csv, text/hjson, text/html, text/jade, text/jsx, text/less, text/markdown, text/mathml, text/n3, text/plain, text/prs.lines.tag, text/richtext, text/rtf, text/sgml, text/slim, text/stylus, text/tab-separated-values, text/troff, text/turtle, text/uri-list, text/vcard, text/vnd.curl, text/vnd.curl.dcurl, text/vnd.curl.mcurl, text/vnd.curl.scurl, text/vnd.dvb.subtitle, text/vnd.fly, text/vnd.fmi.flexstor, text/vnd.graphviz, text/vnd.in3d.3dml, text/vnd.in3d.spot, text/vnd.sun.j2me.app-descriptor, text/vnd.wap.wml, text/vnd.wap.wmlscript, text/vtt, text/x-asm, text/x-c, text/x-component, text/x-fortran, text/x-handlebars-template, text/x-java-source, text/x-lua, text/x-markdown, text/x-nfo, text/x-opml, text/x-org, text/x-pascal, text/x-processing, text/x-sass, text/x-scss, text/x-setext, text/x-sfv, text/x-suse-ymp, text/x-uuencode, text/x-vcalendar, text/x-vcard, text/xml, text/yaml, video/3gpp, video/3gpp2, video/h261, video/h263, video/h264, video/jpeg, video/jpm, video/mj2, video/mp2t, video/mp4, video/mpeg, video/ogg, video/quicktime, video/vnd.dece.hd, video/vnd.dece.mobile, video/vnd.dece.pd, video/vnd.dece.sd, video/vnd.dece.video, video/vnd.dvb.file, video/vnd.fvt, video/vnd.mpegurl, video/vnd.ms-playready.media.pyv, video/vnd.uvvu.mp4, video/vnd.vivo, video/webm, video/x-f4v, video/x-fli, video/x-flv, video/x-m4v, video/x-matroska, video/x-mng, video/x-ms-asf, video/x-ms-vob, video/x-ms-wm, video/x-ms-wmv, video/x-ms-wmx, video/x-ms-wvx, video/x-msvideo, video/x-sgi-movie, video/x-smv, x-conference/x-cooltalk, default */ /***/ (function(module) { module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["exe"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":["mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":["wav"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["ra"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["bmp"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":["rtf"],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":["xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}; /***/ }), /***/ "./node_modules/ms/index.js": /*!**********************************!*\ !*** ./node_modules/ms/index.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = typeof val === 'undefined' ? 'undefined' : _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { if (ms >= d) { return Math.round(ms / d) + 'd'; } if (ms >= h) { return Math.round(ms / h) + 'h'; } if (ms >= m) { return Math.round(ms / m) + 'm'; } if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + ' ' + name; } return Math.ceil(ms / n) + ' ' + name + 's'; } /***/ }), /***/ "./node_modules/negotiator/index.js": /*!******************************************!*\ !*** ./node_modules/negotiator/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * negotiator * Copyright(c) 2012 Federico Romero * Copyright(c) 2012-2014 Isaac Z. Schlueter * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Cached loaded submodules. * @private */ var modules = Object.create(null); /** * Module exports. * @public */ module.exports = Negotiator; module.exports.Negotiator = Negotiator; /** * Create a Negotiator instance from a request. * @param {object} request * @public */ function Negotiator(request) { if (!(this instanceof Negotiator)) { return new Negotiator(request); } this.request = request; } Negotiator.prototype.charset = function charset(available) { var set = this.charsets(available); return set && set[0]; }; Negotiator.prototype.charsets = function charsets(available) { var preferredCharsets = loadModule('charset').preferredCharsets; return preferredCharsets(this.request.headers['accept-charset'], available); }; Negotiator.prototype.encoding = function encoding(available) { var set = this.encodings(available); return set && set[0]; }; Negotiator.prototype.encodings = function encodings(available) { var preferredEncodings = loadModule('encoding').preferredEncodings; return preferredEncodings(this.request.headers['accept-encoding'], available); }; Negotiator.prototype.language = function language(available) { var set = this.languages(available); return set && set[0]; }; Negotiator.prototype.languages = function languages(available) { var preferredLanguages = loadModule('language').preferredLanguages; return preferredLanguages(this.request.headers['accept-language'], available); }; Negotiator.prototype.mediaType = function mediaType(available) { var set = this.mediaTypes(available); return set && set[0]; }; Negotiator.prototype.mediaTypes = function mediaTypes(available) { var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes; return preferredMediaTypes(this.request.headers.accept, available); }; // Backwards compatibility Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; /** * Load the given module. * @private */ function loadModule(moduleName) { var module = modules[moduleName]; if (module !== undefined) { return module; } // This uses a switch for static require analysis switch (moduleName) { case 'charset': module = __webpack_require__(/*! ./lib/charset */ "./node_modules/negotiator/lib/charset.js"); break; case 'encoding': module = __webpack_require__(/*! ./lib/encoding */ "./node_modules/negotiator/lib/encoding.js"); break; case 'language': module = __webpack_require__(/*! ./lib/language */ "./node_modules/negotiator/lib/language.js"); break; case 'mediaType': module = __webpack_require__(/*! ./lib/mediaType */ "./node_modules/negotiator/lib/mediaType.js"); break; default: throw new Error('Cannot find module \'' + moduleName + '\''); } // Store to prevent invoking require() modules[moduleName] = module; return module; } /***/ }), /***/ "./node_modules/negotiator/lib/charset.js": /*!************************************************!*\ !*** ./node_modules/negotiator/lib/charset.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = preferredCharsets; module.exports.preferredCharsets = preferredCharsets; /** * Module variables. * @private */ var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; /** * Parse the Accept-Charset header. * @private */ function parseAcceptCharset(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var charset = parseCharset(accepts[i].trim(), i); if (charset) { accepts[j++] = charset; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a charset from the Accept-Charset header. * @private */ function parseCharset(str, i) { var match = simpleCharsetRegExp.exec(str); if (!match) return null; var charset = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';'); for (var i = 0; i < params.length; i++) { var p = params[i].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; } } } return { charset: charset, q: q, i: i }; } /** * Get the priority of a charset. * @private */ function getCharsetPriority(charset, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i = 0; i < accepted.length; i++) { var spec = specify(charset, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the charset. * @private */ function specify(charset, spec, index) { var s = 0; if (spec.charset.toLowerCase() === charset.toLowerCase()) { s |= 1; } else if (spec.charset !== '*') { return null; } return { i: index, o: spec.i, q: spec.q, s: s }; } /** * Get the preferred charsets from an Accept-Charset header. * @public */ function preferredCharsets(accept, provided) { // RFC 2616 sec 14.2: no header = * var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all charsets return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset); } var priorities = provided.map(function getPriority(type, index) { return getCharsetPriority(type, accepts, index); }); // sorted list of accepted charsets return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } /** * Get full charset string. * @private */ function getFullCharset(spec) { return spec.charset; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /***/ }), /***/ "./node_modules/negotiator/lib/encoding.js": /*!*************************************************!*\ !*** ./node_modules/negotiator/lib/encoding.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = preferredEncodings; module.exports.preferredEncodings = preferredEncodings; /** * Module variables. * @private */ var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; /** * Parse the Accept-Encoding header. * @private */ function parseAcceptEncoding(accept) { var accepts = accept.split(','); var hasIdentity = false; var minQuality = 1; for (var i = 0, j = 0; i < accepts.length; i++) { var encoding = parseEncoding(accepts[i].trim(), i); if (encoding) { accepts[j++] = encoding; hasIdentity = hasIdentity || specify('identity', encoding); minQuality = Math.min(minQuality, encoding.q || 1); } } if (!hasIdentity) { /* * If identity doesn't explicitly appear in the accept-encoding header, * it's added to the list of acceptable encoding with the lowest q */ accepts[j++] = { encoding: 'identity', q: minQuality, i: i }; } // trim accepts accepts.length = j; return accepts; } /** * Parse an encoding from the Accept-Encoding header. * @private */ function parseEncoding(str, i) { var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';'); for (var i = 0; i < params.length; i++) { var p = params[i].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; } } } return { encoding: encoding, q: q, i: i }; } /** * Get the priority of an encoding. * @private */ function getEncodingPriority(encoding, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i = 0; i < accepted.length; i++) { var spec = specify(encoding, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the encoding. * @private */ function specify(encoding, spec, index) { var s = 0; if (spec.encoding.toLowerCase() === encoding.toLowerCase()) { s |= 1; } else if (spec.encoding !== '*') { return null; } return { i: index, o: spec.i, q: spec.q, s: s }; }; /** * Get the preferred encodings from an Accept-Encoding header. * @public */ function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ''); if (!provided) { // sorted list of all encodings return accepts.filter(isQuality).sort(compareSpecs).map(getFullEncoding); } var priorities = provided.map(function getPriority(type, index) { return getEncodingPriority(type, accepts, index); }); // sorted list of accepted encodings return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } /** * Get full encoding string. * @private */ function getFullEncoding(spec) { return spec.encoding; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /***/ }), /***/ "./node_modules/negotiator/lib/language.js": /*!*************************************************!*\ !*** ./node_modules/negotiator/lib/language.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = preferredLanguages; module.exports.preferredLanguages = preferredLanguages; /** * Module variables. * @private */ var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; /** * Parse the Accept-Language header. * @private */ function parseAcceptLanguage(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var langauge = parseLanguage(accepts[i].trim(), i); if (langauge) { accepts[j++] = langauge; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a language from the Accept-Language header. * @private */ function parseLanguage(str, i) { var match = simpleLanguageRegExp.exec(str); if (!match) return null; var prefix = match[1], suffix = match[2], full = prefix; if (suffix) full += "-" + suffix; var q = 1; if (match[3]) { var params = match[3].split(';'); for (var i = 0; i < params.length; i++) { var p = params[i].split('='); if (p[0] === 'q') q = parseFloat(p[1]); } } return { prefix: prefix, suffix: suffix, q: q, i: i, full: full }; } /** * Get the priority of a language. * @private */ function getLanguagePriority(language, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i = 0; i < accepted.length; i++) { var spec = specify(language, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the language. * @private */ function specify(language, spec, index) { var p = parseLanguage(language); if (!p) return null; var s = 0; if (spec.full.toLowerCase() === p.full.toLowerCase()) { s |= 4; } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { s |= 2; } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { s |= 1; } else if (spec.full !== '*') { return null; } return { i: index, o: spec.i, q: spec.q, s: s }; }; /** * Get the preferred languages from an Accept-Language header. * @public */ function preferredLanguages(accept, provided) { // RFC 2616 sec 14.4: no header = * var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all languages return accepts.filter(isQuality).sort(compareSpecs).map(getFullLanguage); } var priorities = provided.map(function getPriority(type, index) { return getLanguagePriority(type, accepts, index); }); // sorted list of accepted languages return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } /** * Get full language string. * @private */ function getFullLanguage(spec) { return spec.full; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /***/ }), /***/ "./node_modules/negotiator/lib/mediaType.js": /*!**************************************************!*\ !*** ./node_modules/negotiator/lib/mediaType.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = preferredMediaTypes; module.exports.preferredMediaTypes = preferredMediaTypes; /** * Module variables. * @private */ var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; /** * Parse the Accept header. * @private */ function parseAccept(accept) { var accepts = splitMediaTypes(accept); for (var i = 0, j = 0; i < accepts.length; i++) { var mediaType = parseMediaType(accepts[i].trim(), i); if (mediaType) { accepts[j++] = mediaType; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a media type from the Accept header. * @private */ function parseMediaType(str, i) { var match = simpleMediaTypeRegExp.exec(str); if (!match) return null; var params = Object.create(null); var q = 1; var subtype = match[2]; var type = match[1]; if (match[3]) { var kvps = splitParameters(match[3]).map(splitKeyValuePair); for (var j = 0; j < kvps.length; j++) { var pair = kvps[j]; var key = pair[0].toLowerCase(); var val = pair[1]; // get the value, unwrapping quotes var value = val && val[0] === '"' && val[val.length - 1] === '"' ? val.substr(1, val.length - 2) : val; if (key === 'q') { q = parseFloat(value); break; } // store parameter params[key] = value; } } return { type: type, subtype: subtype, params: params, q: q, i: i }; } /** * Get the priority of a media type. * @private */ function getMediaTypePriority(type, accepted, index) { var priority = { o: -1, q: 0, s: 0 }; for (var i = 0; i < accepted.length; i++) { var spec = specify(type, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the media type. * @private */ function specify(type, spec, index) { var p = parseMediaType(type); var s = 0; if (!p) { return null; } if (spec.type.toLowerCase() == p.type.toLowerCase()) { s |= 4; } else if (spec.type != '*') { return null; } if (spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { s |= 2; } else if (spec.subtype != '*') { return null; } var keys = Object.keys(spec.params); if (keys.length > 0) { if (keys.every(function (k) { return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); })) { s |= 1; } else { return null; } } return { i: index, o: spec.i, q: spec.q, s: s }; } /** * Get the preferred media types from an Accept header. * @public */ function preferredMediaTypes(accept, provided) { // RFC 2616 sec 14.2: no header = */* var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); if (!provided) { // sorted list of all types return accepts.filter(isQuality).sort(compareSpecs).map(getFullType); } var priorities = provided.map(function getPriority(type, index) { return getMediaTypePriority(type, accepts, index); }); // sorted list of accepted types return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0; } /** * Get full type string. * @private */ function getFullType(spec) { return spec.type + '/' + spec.subtype; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * Count the number of quotes in a string. * @private */ function quoteCount(string) { var count = 0; var index = 0; while ((index = string.indexOf('"', index)) !== -1) { count++; index++; } return count; } /** * Split a key value pair. * @private */ function splitKeyValuePair(str) { var index = str.indexOf('='); var key; var val; if (index === -1) { key = str; } else { key = str.substr(0, index); val = str.substr(index + 1); } return [key, val]; } /** * Split an Accept header into media types. * @private */ function splitMediaTypes(accept) { var accepts = accept.split(','); for (var i = 1, j = 0; i < accepts.length; i++) { if (quoteCount(accepts[j]) % 2 == 0) { accepts[++j] = accepts[i]; } else { accepts[j] += ',' + accepts[i]; } } // trim accepts accepts.length = j + 1; return accepts; } /** * Split a string of parameters. * @private */ function splitParameters(str) { var parameters = str.split(';'); for (var i = 1, j = 0; i < parameters.length; i++) { if (quoteCount(parameters[j]) % 2 == 0) { parameters[++j] = parameters[i]; } else { parameters[j] += ';' + parameters[i]; } } // trim parameters parameters.length = j + 1; for (var i = 0; i < parameters.length; i++) { parameters[i] = parameters[i].trim(); } return parameters; } /***/ }), /***/ "./node_modules/on-finished/index.js": /*!*******************************************!*\ !*** ./node_modules/on-finished/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * on-finished * Copyright(c) 2013 Jonathan Ong * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = onFinished; module.exports.isFinished = isFinished; /** * Module dependencies. * @private */ var first = __webpack_require__(/*! ee-first */ "./node_modules/ee-first/index.js"); /** * Variables. * @private */ /* istanbul ignore next */ var defer = typeof setImmediate === 'function' ? setImmediate : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)); }; /** * Invoke callback when the response has finished, useful for * cleaning up resources afterwards. * * @param {object} msg * @param {function} listener * @return {object} * @public */ function onFinished(msg, listener) { if (isFinished(msg) !== false) { defer(listener, null, msg); return msg; } // attach the listener to the message attachListener(msg, listener); return msg; } /** * Determine if message is already finished. * * @param {object} msg * @return {boolean} * @public */ function isFinished(msg) { var socket = msg.socket; if (typeof msg.finished === 'boolean') { // OutgoingMessage return Boolean(msg.finished || socket && !socket.writable); } if (typeof msg.complete === 'boolean') { // IncomingMessage return Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable); } // don't know return undefined; } /** * Attach a finished listener to the message. * * @param {object} msg * @param {function} callback * @private */ function attachFinishedListener(msg, callback) { var eeMsg; var eeSocket; var finished = false; function onFinish(error) { eeMsg.cancel(); eeSocket.cancel(); finished = true; callback(error); } // finished on first message event eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish); function onSocket(socket) { // remove listener msg.removeListener('socket', onSocket); if (finished) return; if (eeMsg !== eeSocket) return; // finished on first socket event eeSocket = first([[socket, 'error', 'close']], onFinish); } if (msg.socket) { // socket already assigned onSocket(msg.socket); return; } // wait for socket to be assigned msg.on('socket', onSocket); if (msg.socket === undefined) { // node.js 0.8 patch patchAssignSocket(msg, onSocket); } } /** * Attach the listener to the message. * * @param {object} msg * @return {function} * @private */ function attachListener(msg, listener) { var attached = msg.__onFinished; // create a private single listener with queue if (!attached || !attached.queue) { attached = msg.__onFinished = createListener(msg); attachFinishedListener(msg, attached); } attached.queue.push(listener); } /** * Create listener on message. * * @param {object} msg * @return {function} * @private */ function createListener(msg) { function listener(err) { if (msg.__onFinished === listener) msg.__onFinished = null; if (!listener.queue) return; var queue = listener.queue; listener.queue = null; for (var i = 0; i < queue.length; i++) { queue[i](err, msg); } } listener.queue = []; return listener; } /** * Patch ServerResponse.prototype.assignSocket for node.js 0.8. * * @param {ServerResponse} res * @param {function} callback * @private */ function patchAssignSocket(res, callback) { var assignSocket = res.assignSocket; if (typeof assignSocket !== 'function') return; // res.on('socket', callback) is broken in 0.8 res.assignSocket = function _assignSocket(socket) { assignSocket.call(this, socket); callback(socket); }; } /***/ }), /***/ "./node_modules/parseurl/index.js": /*!****************************************!*\ !*** ./node_modules/parseurl/index.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * parseurl * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var url = __webpack_require__(/*! url */ "url"); var parse = url.parse; var Url = url.Url; /** * Module exports. * @public */ module.exports = parseurl; module.exports.original = originalurl; /** * Parse the `req` url with memoization. * * @param {ServerRequest} req * @return {Object} * @public */ function parseurl(req) { var url = req.url; if (url === undefined) { // URL is undefined return undefined; } var parsed = req._parsedUrl; if (fresh(url, parsed)) { // Return cached URL parse return parsed; } // Parse the URL parsed = fastparse(url); parsed._raw = url; return req._parsedUrl = parsed; }; /** * Parse the `req` original url with fallback and memoization. * * @param {ServerRequest} req * @return {Object} * @public */ function originalurl(req) { var url = req.originalUrl; if (typeof url !== 'string') { // Fallback return parseurl(req); } var parsed = req._parsedOriginalUrl; if (fresh(url, parsed)) { // Return cached URL parse return parsed; } // Parse the URL parsed = fastparse(url); parsed._raw = url; return req._parsedOriginalUrl = parsed; }; /** * Parse the `str` url with fast-path short-cut. * * @param {string} str * @return {Object} * @private */ function fastparse(str) { if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) { return parse(str); } var pathname = str; var query = null; var search = null; // This takes the regexp from https://github.com/joyent/node/pull/7878 // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/ // And unrolls it into a for loop for (var i = 1; i < str.length; i++) { switch (str.charCodeAt(i)) { case 0x3f: /* ? */ if (search === null) { pathname = str.substring(0, i); query = str.substring(i + 1); search = str.substring(i); } break; case 0x09: /* \t */ case 0x0a: /* \n */ case 0x0c: /* \f */ case 0x0d: /* \r */ case 0x20: /* */ case 0x23: /* # */ case 0xa0: case 0xfeff: return parse(str); } } var url = Url !== undefined ? new Url() : {}; url.path = str; url.href = str; url.pathname = pathname; url.query = query; url.search = search; return url; } /** * Determine if parsed is still fresh for url. * * @param {string} url * @param {object} parsedUrl * @return {boolean} * @private */ function fresh(url, parsedUrl) { return (typeof parsedUrl === 'undefined' ? 'undefined' : _typeof(parsedUrl)) === 'object' && parsedUrl !== null && (Url === undefined || parsedUrl instanceof Url) && parsedUrl._raw === url; } /***/ }), /***/ "./node_modules/path-to-regexp/index.js": /*!**********************************************!*\ !*** ./node_modules/path-to-regexp/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Expose `pathtoRegexp`. */ module.exports = pathtoRegexp; /** * Match matching groups in a regular expression. */ var MATCHING_GROUP_REGEXP = /\((?!\?)/g; /** * Normalize the given path string, * returning a regular expression. * * An empty array should be passed, * which will contain the placeholder * key names. For example "/user/:id" will * then contain ["id"]. * * @param {String|RegExp|Array} path * @param {Array} keys * @param {Object} options * @return {RegExp} * @api private */ function pathtoRegexp(path, keys, options) { options = options || {}; keys = keys || []; var strict = options.strict; var end = options.end !== false; var flags = options.sensitive ? '' : 'i'; var extraOffset = 0; var keysOffset = keys.length; var i = 0; var name = 0; var m; if (path instanceof RegExp) { while (m = MATCHING_GROUP_REGEXP.exec(path.source)) { keys.push({ name: name++, optional: false, offset: m.index }); } return path; } if (Array.isArray(path)) { // Map array parts into regexps and return their source. We also pass // the same keys and options instance into every generation to get // consistent matching groups before we join the sources together. path = path.map(function (value) { return pathtoRegexp(value, keys, options).source; }); return new RegExp('(?:' + path.join('|') + ')', flags); } path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?')).replace(/\/\(/g, '/(?:').replace(/([\/\.])/g, '\\$1').replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function (match, slash, format, key, capture, star, optional, offset) { slash = slash || ''; format = format || ''; capture = capture || '([^\\/' + format + ']+?)'; optional = optional || ''; keys.push({ name: key, optional: !!optional, offset: offset + extraOffset }); var result = '' + (optional ? '' : slash) + '(?:' + format + (optional ? slash : '') + capture + (star ? '((?:[\\/' + format + '].+?)?)' : '') + ')' + optional; extraOffset += result.length - match.length; return result; }).replace(/\*/g, function (star, index) { var len = keys.length; while (len-- > keysOffset && keys[len].offset > index) { keys[len].offset += 3; // Replacement length minus asterisk length. } return '(.*)'; }); // This is a workaround for handling unnamed matching groups. while (m = MATCHING_GROUP_REGEXP.exec(path)) { var escapeCount = 0; var index = m.index; while (path.charAt(--index) === '\\') { escapeCount++; } // It's possible to escape the bracket. if (escapeCount % 2 === 1) { continue; } if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) { keys.splice(keysOffset + i, 0, { name: name++, // Unnamed matching groups must be consistently linear. optional: false, offset: m.index }); } i++; } // If the path is non-ending, match until the end or a slash. path += end ? '$' : path[path.length - 1] === '/' ? '' : '(?=\\/|$)'; return new RegExp(path, flags); }; /***/ }), /***/ "./node_modules/proxy-addr/index.js": /*!******************************************!*\ !*** ./node_modules/proxy-addr/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * proxy-addr * Copyright(c) 2014-2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = proxyaddr; module.exports.all = alladdrs; module.exports.compile = compile; /** * Module dependencies. * @private */ var forwarded = __webpack_require__(/*! forwarded */ "./node_modules/forwarded/index.js"); var ipaddr = __webpack_require__(/*! ipaddr.js */ "./node_modules/ipaddr.js/lib/ipaddr.js"); /** * Variables. * @private */ var DIGIT_REGEXP = /^[0-9]+$/; var isip = ipaddr.isValid; var parseip = ipaddr.parse; /** * Pre-defined IP ranges. * @private */ var IP_RANGES = { linklocal: ['169.254.0.0/16', 'fe80::/10'], loopback: ['127.0.0.1/8', '::1/128'], uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7'] /** * Get all addresses in the request, optionally stopping * at the first untrusted. * * @param {Object} request * @param {Function|Array|String} [trust] * @public */ };function alladdrs(req, trust) { // get addresses var addrs = forwarded(req); if (!trust) { // Return all addresses return addrs; } if (typeof trust !== 'function') { trust = compile(trust); } for (var i = 0; i < addrs.length - 1; i++) { if (trust(addrs[i], i)) continue; addrs.length = i + 1; } return addrs; } /** * Compile argument into trust function. * * @param {Array|String} val * @private */ function compile(val) { if (!val) { throw new TypeError('argument is required'); } var trust; if (typeof val === 'string') { trust = [val]; } else if (Array.isArray(val)) { trust = val.slice(); } else { throw new TypeError('unsupported trust argument'); } for (var i = 0; i < trust.length; i++) { val = trust[i]; if (!IP_RANGES.hasOwnProperty(val)) { continue; } // Splice in pre-defined range val = IP_RANGES[val]; trust.splice.apply(trust, [i, 1].concat(val)); i += val.length - 1; } return compileTrust(compileRangeSubnets(trust)); } /** * Compile `arr` elements into range subnets. * * @param {Array} arr * @private */ function compileRangeSubnets(arr) { var rangeSubnets = new Array(arr.length); for (var i = 0; i < arr.length; i++) { rangeSubnets[i] = parseipNotation(arr[i]); } return rangeSubnets; } /** * Compile range subnet array into trust function. * * @param {Array} rangeSubnets * @private */ function compileTrust(rangeSubnets) { // Return optimized function based on length var len = rangeSubnets.length; return len === 0 ? trustNone : len === 1 ? trustSingle(rangeSubnets[0]) : trustMulti(rangeSubnets); } /** * Parse IP notation string into range subnet. * * @param {String} note * @private */ function parseipNotation(note) { var pos = note.lastIndexOf('/'); var str = pos !== -1 ? note.substring(0, pos) : note; if (!isip(str)) { throw new TypeError('invalid IP address: ' + str); } var ip = parseip(str); if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { // Store as IPv4 ip = ip.toIPv4Address(); } var max = ip.kind() === 'ipv6' ? 128 : 32; var range = pos !== -1 ? note.substring(pos + 1, note.length) : null; if (range === null) { range = max; } else if (DIGIT_REGEXP.test(range)) { range = parseInt(range, 10); } else if (ip.kind() === 'ipv4' && isip(range)) { range = parseNetmask(range); } else { range = null; } if (range <= 0 || range > max) { throw new TypeError('invalid range on address: ' + note); } return [ip, range]; } /** * Parse netmask string into CIDR range. * * @param {String} netmask * @private */ function parseNetmask(netmask) { var ip = parseip(netmask); var kind = ip.kind(); return kind === 'ipv4' ? ip.prefixLengthFromSubnetMask() : null; } /** * Determine address of proxied request. * * @param {Object} request * @param {Function|Array|String} trust * @public */ function proxyaddr(req, trust) { if (!req) { throw new TypeError('req argument is required'); } if (!trust) { throw new TypeError('trust argument is required'); } var addrs = alladdrs(req, trust); var addr = addrs[addrs.length - 1]; return addr; } /** * Static trust function to trust nothing. * * @private */ function trustNone() { return false; } /** * Compile trust function for multiple subnets. * * @param {Array} subnets * @private */ function trustMulti(subnets) { return function trust(addr) { if (!isip(addr)) return false; var ip = parseip(addr); var ipconv; var kind = ip.kind(); for (var i = 0; i < subnets.length; i++) { var subnet = subnets[i]; var subnetip = subnet[0]; var subnetkind = subnetip.kind(); var subnetrange = subnet[1]; var trusted = ip; if (kind !== subnetkind) { if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) { // Incompatible IP addresses continue; } if (!ipconv) { // Convert IP to match subnet IP kind ipconv = subnetkind === 'ipv4' ? ip.toIPv4Address() : ip.toIPv4MappedAddress(); } trusted = ipconv; } if (trusted.match(subnetip, subnetrange)) { return true; } } return false; }; } /** * Compile trust function for single subnet. * * @param {Object} subnet * @private */ function trustSingle(subnet) { var subnetip = subnet[0]; var subnetkind = subnetip.kind(); var subnetisipv4 = subnetkind === 'ipv4'; var subnetrange = subnet[1]; return function trust(addr) { if (!isip(addr)) return false; var ip = parseip(addr); var kind = ip.kind(); if (kind !== subnetkind) { if (subnetisipv4 && !ip.isIPv4MappedAddress()) { // Incompatible IP addresses return false; } // Convert IP to match subnet IP kind ip = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress(); } return ip.match(subnetip, subnetrange); }; } /***/ }), /***/ "./node_modules/qs/lib/formats.js": /*!****************************************!*\ !*** ./node_modules/qs/lib/formats.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var replace = String.prototype.replace; var percentTwenties = /%20/g; module.exports = { 'default': 'RFC3986', formatters: { RFC1738: function RFC1738(value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function RFC3986(value) { return value; } }, RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; /***/ }), /***/ "./node_modules/qs/lib/index.js": /*!**************************************!*\ !*** ./node_modules/qs/lib/index.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var stringify = __webpack_require__(/*! ./stringify */ "./node_modules/qs/lib/stringify.js"); var parse = __webpack_require__(/*! ./parse */ "./node_modules/qs/lib/parse.js"); var formats = __webpack_require__(/*! ./formats */ "./node_modules/qs/lib/formats.js"); module.exports = { formats: formats, parse: parse, stringify: stringify }; /***/ }), /***/ "./node_modules/qs/lib/parse.js": /*!**************************************!*\ !*** ./node_modules/qs/lib/parse.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(/*! ./utils */ "./node_modules/qs/lib/utils.js"); var has = Object.prototype.hasOwnProperty; var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, decoder: utils.decode, delimiter: '&', depth: 5, parameterLimit: 1000, plainObjects: false, strictNullHandling: false }; var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults.decoder); val = options.decoder(part.slice(pos + 1), defaults.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } } return obj; }; var parseObject = function parseObject(chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]') { obj = []; obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; /***/ }), /***/ "./node_modules/qs/lib/stringify.js": /*!******************************************!*\ !*** ./node_modules/qs/lib/stringify.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var utils = __webpack_require__(/*! ./utils */ "./node_modules/qs/lib/utils.js"); var formats = __webpack_require__(/*! ./formats */ "./node_modules/qs/lib/formats.js"); var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { // eslint-disable-line func-name-matching return prefix; } }; var toISO = Date.prototype.toISOString; var defaults = { delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var stringify = function stringify( // eslint-disable-line func-name-matching object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly)); } else { values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly)); } } return values; }; module.exports = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; if (typeof options.format === 'undefined') { options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (sort) { objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly)); } var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; return joined.length > 0 ? prefix + joined : ''; }; /***/ }), /***/ "./node_modules/qs/lib/utils.js": /*!**************************************!*\ !*** ./node_modules/qs/lib/utils.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var has = Object.prototype.hasOwnProperty; var hexTable = function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }(); var compactQueue = function compactQueue(queue) { var obj; while (queue.length) { var item = queue.pop(); obj = item.obj[item.prop]; if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } return obj; }; exports.arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; exports.merge = function merge(target, source, options) { if (!source) { return target; } if ((typeof source === 'undefined' ? 'undefined' : _typeof(source)) !== 'object') { if (Array.isArray(target)) { target.push(source); } else if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object') { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) !== 'object') { return [target].concat(source); } var mergeTarget = target; if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = exports.arrayToObject(target, options); } if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { if (target[i] && _typeof(target[i]) === 'object') { target[i] = exports.merge(target[i], item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = exports.merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; exports.assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; exports.decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { return str; } }; exports.encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = typeof str === 'string' ? str : String(str); var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if (c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || c >= 0x30 && c <= 0x39 // 0-9 || c >= 0x41 && c <= 0x5A // a-z || c >= 0x61 && c <= 0x7A // A-Z ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | c >> 6] + hexTable[0x80 | c & 0x3F]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | c >> 12] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]); continue; } i += 1; c = 0x10000 + ((c & 0x3FF) << 10 | string.charCodeAt(i) & 0x3FF); out += hexTable[0xF0 | c >> 18] + hexTable[0x80 | c >> 12 & 0x3F] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]; } return out; }; exports.compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } return compactQueue(queue); }; exports.isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; exports.isBuffer = function isBuffer(obj) { if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; /***/ }), /***/ "./node_modules/range-parser/index.js": /*!********************************************!*\ !*** ./node_modules/range-parser/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * range-parser * Copyright(c) 2012-2014 TJ Holowaychuk * Copyright(c) 2015-2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = rangeParser; /** * Parse "Range" header `str` relative to the given file `size`. * * @param {Number} size * @param {String} str * @param {Object} [options] * @return {Array} * @public */ function rangeParser(size, str, options) { var index = str.indexOf('='); if (index === -1) { return -2; } // split the range string var arr = str.slice(index + 1).split(','); var ranges = []; // add ranges type ranges.type = str.slice(0, index); // parse all ranges for (var i = 0; i < arr.length; i++) { var range = arr[i].split('-'); var start = parseInt(range[0], 10); var end = parseInt(range[1], 10); // -nnn if (isNaN(start)) { start = size - end; end = size - 1; // nnn- } else if (isNaN(end)) { end = size - 1; } // limit last-byte-pos to current length if (end > size - 1) { end = size - 1; } // invalid or unsatisifiable if (isNaN(start) || isNaN(end) || start > end || start < 0) { continue; } // add range ranges.push({ start: start, end: end }); } if (ranges.length < 1) { // unsatisifiable return -1; } return options && options.combine ? combineRanges(ranges) : ranges; } /** * Combine overlapping & adjacent ranges. * @private */ function combineRanges(ranges) { var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart); for (var j = 0, i = 1; i < ordered.length; i++) { var range = ordered[i]; var current = ordered[j]; if (range.start > current.end + 1) { // next range ordered[++j] = range; } else if (range.end > current.end) { // extend range current.end = range.end; current.index = Math.min(current.index, range.index); } } // trim ordered array ordered.length = j + 1; // generate combined range var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex); // copy ranges type combined.type = ranges.type; return combined; } /** * Map function to add index value to ranges. * @private */ function mapWithIndex(range, index) { return { start: range.start, end: range.end, index: index }; } /** * Map function to remove index value from ranges. * @private */ function mapWithoutIndex(range) { return { start: range.start, end: range.end }; } /** * Sort function to sort ranges by index. * @private */ function sortByRangeIndex(a, b) { return a.index - b.index; } /** * Sort function to sort ranges by start position. * @private */ function sortByRangeStart(a, b) { return a.start - b.start; } /***/ }), /***/ "./node_modules/raw-body/index.js": /*!****************************************!*\ !*** ./node_modules/raw-body/index.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * raw-body * Copyright(c) 2013-2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var bytes = __webpack_require__(/*! bytes */ "./node_modules/bytes/index.js"); var createError = __webpack_require__(/*! http-errors */ "./node_modules/raw-body/node_modules/http-errors/index.js"); var iconv = __webpack_require__(/*! iconv-lite */ "./node_modules/iconv-lite/lib/index.js"); var unpipe = __webpack_require__(/*! unpipe */ "./node_modules/unpipe/index.js"); /** * Module exports. * @public */ module.exports = getRawBody; /** * Module variables. * @private */ var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /; /** * Get the decoder for a given encoding. * * @param {string} encoding * @private */ function getDecoder(encoding) { if (!encoding) return null; try { return iconv.getDecoder(encoding); } catch (e) { // error getting decoder if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e; // the encoding was not found throw createError(415, 'specified encoding unsupported', { encoding: encoding, type: 'encoding.unsupported' }); } } /** * Get the raw body of a stream (typically HTTP). * * @param {object} stream * @param {object|string|function} [options] * @param {function} [callback] * @public */ function getRawBody(stream, options, callback) { var done = callback; var opts = options || {}; if (options === true || typeof options === 'string') { // short cut for encoding opts = { encoding: options }; } if (typeof options === 'function') { done = options; opts = {}; } // validate callback is a function, if provided if (done !== undefined && typeof done !== 'function') { throw new TypeError('argument callback must be a function'); } // require the callback without promises if (!done && !global.Promise) { throw new TypeError('argument callback is required'); } // get encoding var encoding = opts.encoding !== true ? opts.encoding : 'utf-8'; // convert the limit to an integer var limit = bytes.parse(opts.limit); // convert the expected length to an integer var length = opts.length != null && !isNaN(opts.length) ? parseInt(opts.length, 10) : null; if (done) { // classic callback style return readStream(stream, encoding, length, limit, done); } return new Promise(function executor(resolve, reject) { readStream(stream, encoding, length, limit, function onRead(err, buf) { if (err) return reject(err); resolve(buf); }); }); } /** * Halt a stream. * * @param {Object} stream * @private */ function halt(stream) { // unpipe everything from the stream unpipe(stream); // pause stream if (typeof stream.pause === 'function') { stream.pause(); } } /** * Read the data from the stream. * * @param {object} stream * @param {string} encoding * @param {number} length * @param {number} limit * @param {function} callback * @public */ function readStream(stream, encoding, length, limit, callback) { var complete = false; var sync = true; // check the length and limit options. // note: we intentionally leave the stream paused, // so users should handle the stream themselves. if (limit !== null && length !== null && length > limit) { return done(createError(413, 'request entity too large', { expected: length, length: length, limit: limit, type: 'entity.too.large' })); } // streams1: assert request encoding is buffer. // streams2+: assert the stream encoding is buffer. // stream._decoder: streams1 // state.encoding: streams2 // state.decoder: streams2, specifically < 0.10.6 var state = stream._readableState; if (stream._decoder || state && (state.encoding || state.decoder)) { // developer error return done(createError(500, 'stream encoding should not be set', { type: 'stream.encoding.set' })); } var received = 0; var decoder; try { decoder = getDecoder(encoding); } catch (err) { return done(err); } var buffer = decoder ? '' : []; // attach listeners stream.on('aborted', onAborted); stream.on('close', cleanup); stream.on('data', onData); stream.on('end', onEnd); stream.on('error', onEnd); // mark sync section complete sync = false; function done() { var args = new Array(arguments.length); // copy arguments for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } // mark complete complete = true; if (sync) { process.nextTick(invokeCallback); } else { invokeCallback(); } function invokeCallback() { cleanup(); if (args[0]) { // halt the stream on error halt(stream); } callback.apply(null, args); } } function onAborted() { if (complete) return; done(createError(400, 'request aborted', { code: 'ECONNABORTED', expected: length, length: length, received: received, type: 'request.aborted' })); } function onData(chunk) { if (complete) return; received += chunk.length; if (limit !== null && received > limit) { done(createError(413, 'request entity too large', { limit: limit, received: received, type: 'entity.too.large' })); } else if (decoder) { buffer += decoder.write(chunk); } else { buffer.push(chunk); } } function onEnd(err) { if (complete) return; if (err) return done(err); if (length !== null && received !== length) { done(createError(400, 'request size did not match content length', { expected: length, length: length, received: received, type: 'request.size.invalid' })); } else { var string = decoder ? buffer + (decoder.end() || '') : Buffer.concat(buffer); done(null, string); } } function cleanup() { buffer = null; stream.removeListener('aborted', onAborted); stream.removeListener('data', onData); stream.removeListener('end', onEnd); stream.removeListener('error', onEnd); stream.removeListener('close', cleanup); } } /***/ }), /***/ "./node_modules/raw-body/node_modules/depd/index.js": /*!**********************************************************!*\ !*** ./node_modules/raw-body/node_modules/depd/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! * depd * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var callSiteToString = __webpack_require__(/*! ./lib/compat */ "./node_modules/raw-body/node_modules/depd/lib/compat/index.js").callSiteToString; var eventListenerCount = __webpack_require__(/*! ./lib/compat */ "./node_modules/raw-body/node_modules/depd/lib/compat/index.js").eventListenerCount; var relative = __webpack_require__(/*! path */ "path").relative; /** * Module exports. */ module.exports = depd; /** * Get the path to base files on. */ var basePath = process.cwd(); /** * Determine if namespace is contained in the string. */ function containsNamespace(str, namespace) { var val = str.split(/[ ,]+/); namespace = String(namespace).toLowerCase(); for (var i = 0; i < val.length; i++) { if (!(str = val[i])) continue; // namespace contained if (str === '*' || str.toLowerCase() === namespace) { return true; } } return false; } /** * Convert a data descriptor to accessor descriptor. */ function convertDataDescriptorToAccessor(obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop); var value = descriptor.value; descriptor.get = function getter() { return value; }; if (descriptor.writable) { descriptor.set = function setter(val) { return value = val; }; } delete descriptor.value; delete descriptor.writable; Object.defineProperty(obj, prop, descriptor); return descriptor; } /** * Create arguments string to keep arity. */ function createArgumentsString(arity) { var str = ''; for (var i = 0; i < arity; i++) { str += ', arg' + i; } return str.substr(2); } /** * Create stack string from stack. */ function createStackString(stack) { var str = this.name + ': ' + this.namespace; if (this.message) { str += ' deprecated ' + this.message; } for (var i = 0; i < stack.length; i++) { str += '\n at ' + callSiteToString(stack[i]); } return str; } /** * Create deprecate for namespace in caller. */ function depd(namespace) { if (!namespace) { throw new TypeError('argument namespace is required'); } var stack = getStack(); var site = callSiteLocation(stack[1]); var file = site[0]; function deprecate(message) { // call to self as log log.call(deprecate, message); } deprecate._file = file; deprecate._ignored = isignored(namespace); deprecate._namespace = namespace; deprecate._traced = istraced(namespace); deprecate._warned = Object.create(null); deprecate.function = wrapfunction; deprecate.property = wrapproperty; return deprecate; } /** * Determine if namespace is ignored. */ function isignored(namespace) { /* istanbul ignore next: tested in a child processs */ if (process.noDeprecation) { // --no-deprecation support return true; } var str = process.env.NO_DEPRECATION || ''; // namespace ignored return containsNamespace(str, namespace); } /** * Determine if namespace is traced. */ function istraced(namespace) { /* istanbul ignore next: tested in a child processs */ if (process.traceDeprecation) { // --trace-deprecation support return true; } var str = process.env.TRACE_DEPRECATION || ''; // namespace traced return containsNamespace(str, namespace); } /** * Display deprecation message. */ function log(message, site) { var haslisteners = eventListenerCount(process, 'deprecation') !== 0; // abort early if no destination if (!haslisteners && this._ignored) { return; } var caller; var callFile; var callSite; var i = 0; var seen = false; var stack = getStack(); var file = this._file; if (site) { // provided site callSite = callSiteLocation(stack[1]); callSite.name = site.name; file = callSite[0]; } else { // get call site i = 2; site = callSiteLocation(stack[i]); callSite = site; } // get caller of deprecated thing in relation to file for (; i < stack.length; i++) { caller = callSiteLocation(stack[i]); callFile = caller[0]; if (callFile === file) { seen = true; } else if (callFile === this._file) { file = this._file; } else if (seen) { break; } } var key = caller ? site.join(':') + '__' + caller.join(':') : undefined; if (key !== undefined && key in this._warned) { // already warned return; } this._warned[key] = true; // generate automatic message from call site if (!message) { message = callSite === site || !callSite.name ? defaultMessage(site) : defaultMessage(callSite); } // emit deprecation if listeners exist if (haslisteners) { var err = DeprecationError(this._namespace, message, stack.slice(i)); process.emit('deprecation', err); return; } // format and write message var format = process.stderr.isTTY ? formatColor : formatPlain; var msg = format.call(this, message, caller, stack.slice(i)); process.stderr.write(msg + '\n', 'utf8'); } /** * Get call site location as array. */ function callSiteLocation(callSite) { var file = callSite.getFileName() || '<anonymous>'; var line = callSite.getLineNumber(); var colm = callSite.getColumnNumber(); if (callSite.isEval()) { file = callSite.getEvalOrigin() + ', ' + file; } var site = [file, line, colm]; site.callSite = callSite; site.name = callSite.getFunctionName(); return site; } /** * Generate a default message from the site. */ function defaultMessage(site) { var callSite = site.callSite; var funcName = site.name; // make useful anonymous name if (!funcName) { funcName = '<anonymous@' + formatLocation(site) + '>'; } var context = callSite.getThis(); var typeName = context && callSite.getTypeName(); // ignore useless type name if (typeName === 'Object') { typeName = undefined; } // make useful type name if (typeName === 'Function') { typeName = context.name || typeName; } return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName; } /** * Format deprecation message without color. */ function formatPlain(msg, caller, stack) { var timestamp = new Date().toUTCString(); var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg; // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n at ' + callSiteToString(stack[i]); } return formatted; } if (caller) { formatted += ' at ' + formatLocation(caller); } return formatted; } /** * Format deprecation message with color. */ function formatColor(msg, caller, stack) { var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow ' \x1b[0m' + msg + '\x1b[39m'; // reset // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m'; // cyan } return formatted; } if (caller) { formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m'; // cyan } return formatted; } /** * Format call site location. */ function formatLocation(callSite) { return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2]; } /** * Get the stack as array of call sites. */ function getStack() { var limit = Error.stackTraceLimit; var obj = {}; var prep = Error.prepareStackTrace; Error.prepareStackTrace = prepareObjectStackTrace; Error.stackTraceLimit = Math.max(10, limit); // capture the stack Error.captureStackTrace(obj); // slice this function off the top var stack = obj.stack.slice(1); Error.prepareStackTrace = prep; Error.stackTraceLimit = limit; return stack; } /** * Capture call site stack from v8. */ function prepareObjectStackTrace(obj, stack) { return stack; } /** * Return a wrapped function in a deprecation message. */ function wrapfunction(fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function'); } var args = createArgumentsString(fn.length); var deprecate = this; // eslint-disable-line no-unused-vars var stack = getStack(); var site = callSiteLocation(stack[1]); site.name = fn.name; // eslint-disable-next-line no-eval var deprecatedfn = eval('(function (' + args + ') {\n' + '"use strict"\n' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '})'); return deprecatedfn; } /** * Wrap property in a deprecation message. */ function wrapproperty(obj, prop, message) { if (!obj || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && typeof obj !== 'function') { throw new TypeError('argument obj must be object'); } var descriptor = Object.getOwnPropertyDescriptor(obj, prop); if (!descriptor) { throw new TypeError('must call property on owner object'); } if (!descriptor.configurable) { throw new TypeError('property must be configurable'); } var deprecate = this; var stack = getStack(); var site = callSiteLocation(stack[1]); // set site name site.name = prop; // convert data descriptor if ('value' in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message); } var get = descriptor.get; var set = descriptor.set; // wrap getter if (typeof get === 'function') { descriptor.get = function getter() { log.call(deprecate, message, site); return get.apply(this, arguments); }; } // wrap setter if (typeof set === 'function') { descriptor.set = function setter() { log.call(deprecate, message, site); return set.apply(this, arguments); }; } Object.defineProperty(obj, prop, descriptor); } /** * Create DeprecationError for deprecation */ function DeprecationError(namespace, message, stack) { var error = new Error(); var stackString; Object.defineProperty(error, 'constructor', { value: DeprecationError }); Object.defineProperty(error, 'message', { configurable: true, enumerable: false, value: message, writable: true }); Object.defineProperty(error, 'name', { enumerable: false, configurable: true, value: 'DeprecationError', writable: true }); Object.defineProperty(error, 'namespace', { configurable: true, enumerable: false, value: namespace, writable: true }); Object.defineProperty(error, 'stack', { configurable: true, enumerable: false, get: function get() { if (stackString !== undefined) { return stackString; } // prepare stack trace return stackString = createStackString.call(this, stack); }, set: function setter(val) { stackString = val; } }); return error; } /***/ }), /***/ "./node_modules/raw-body/node_modules/depd/lib/compat/callsite-tostring.js": /*!*********************************************************************************!*\ !*** ./node_modules/raw-body/node_modules/depd/lib/compat/callsite-tostring.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. */ module.exports = callSiteToString; /** * Format a CallSite file location to a string. */ function callSiteFileLocation(callSite) { var fileName; var fileLocation = ''; if (callSite.isNative()) { fileLocation = 'native'; } else if (callSite.isEval()) { fileName = callSite.getScriptNameOrSourceURL(); if (!fileName) { fileLocation = callSite.getEvalOrigin(); } } else { fileName = callSite.getFileName(); } if (fileName) { fileLocation += fileName; var lineNumber = callSite.getLineNumber(); if (lineNumber != null) { fileLocation += ':' + lineNumber; var columnNumber = callSite.getColumnNumber(); if (columnNumber) { fileLocation += ':' + columnNumber; } } } return fileLocation || 'unknown source'; } /** * Format a CallSite to a string. */ function callSiteToString(callSite) { var addSuffix = true; var fileLocation = callSiteFileLocation(callSite); var functionName = callSite.getFunctionName(); var isConstructor = callSite.isConstructor(); var isMethodCall = !(callSite.isToplevel() || isConstructor); var line = ''; if (isMethodCall) { var methodName = callSite.getMethodName(); var typeName = getConstructorName(callSite); if (functionName) { if (typeName && functionName.indexOf(typeName) !== 0) { line += typeName + '.'; } line += functionName; if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { line += ' [as ' + methodName + ']'; } } else { line += typeName + '.' + (methodName || '<anonymous>'); } } else if (isConstructor) { line += 'new ' + (functionName || '<anonymous>'); } else if (functionName) { line += functionName; } else { addSuffix = false; line += fileLocation; } if (addSuffix) { line += ' (' + fileLocation + ')'; } return line; } /** * Get constructor name of reviver. */ function getConstructorName(obj) { var receiver = obj.receiver; return receiver.constructor && receiver.constructor.name || null; } /***/ }), /***/ "./node_modules/raw-body/node_modules/depd/lib/compat/event-listener-count.js": /*!************************************************************************************!*\ !*** ./node_modules/raw-body/node_modules/depd/lib/compat/event-listener-count.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = eventListenerCount; /** * Get the count of listeners on an event emitter of a specific type. */ function eventListenerCount(emitter, type) { return emitter.listeners(type).length; } /***/ }), /***/ "./node_modules/raw-body/node_modules/depd/lib/compat/index.js": /*!*********************************************************************!*\ !*** ./node_modules/raw-body/node_modules/depd/lib/compat/index.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * depd * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var EventEmitter = __webpack_require__(/*! events */ "events").EventEmitter; /** * Module exports. * @public */ lazyProperty(module.exports, 'callSiteToString', function callSiteToString() { var limit = Error.stackTraceLimit; var obj = {}; var prep = Error.prepareStackTrace; function prepareObjectStackTrace(obj, stack) { return stack; } Error.prepareStackTrace = prepareObjectStackTrace; Error.stackTraceLimit = 2; // capture the stack Error.captureStackTrace(obj); // slice the stack var stack = obj.stack.slice(); Error.prepareStackTrace = prep; Error.stackTraceLimit = limit; return stack[0].toString ? toString : __webpack_require__(/*! ./callsite-tostring */ "./node_modules/raw-body/node_modules/depd/lib/compat/callsite-tostring.js"); }); lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount() { return EventEmitter.listenerCount || __webpack_require__(/*! ./event-listener-count */ "./node_modules/raw-body/node_modules/depd/lib/compat/event-listener-count.js"); }); /** * Define a lazy property. */ function lazyProperty(obj, prop, getter) { function get() { var val = getter(); Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: val }); return val; } Object.defineProperty(obj, prop, { configurable: true, enumerable: true, get: get }); } /** * Call toString() on the obj */ function toString(obj) { return obj.toString(); } /***/ }), /***/ "./node_modules/raw-body/node_modules/http-errors/index.js": /*!*****************************************************************!*\ !*** ./node_modules/raw-body/node_modules/http-errors/index.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * http-errors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var deprecate = __webpack_require__(/*! depd */ "./node_modules/raw-body/node_modules/depd/index.js")('http-errors'); var setPrototypeOf = __webpack_require__(/*! setprototypeof */ "./node_modules/raw-body/node_modules/setprototypeof/index.js"); var statuses = __webpack_require__(/*! statuses */ "./node_modules/raw-body/node_modules/statuses/index.js"); var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits.js"); /** * Module exports. * @public */ module.exports = createError; module.exports.HttpError = createHttpErrorConstructor(); // Populate exports for all constructors populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError); /** * Get the code class of a status code. * @private */ function codeClass(status) { return Number(String(status).charAt(0) + '00'); } /** * Create a new HTTP Error. * * @returns {Error} * @public */ function createError() { // so much arity going on ~_~ var err; var msg; var status = 500; var props = {}; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (arg instanceof Error) { err = arg; status = err.status || err.statusCode || status; continue; } switch (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) { case 'string': msg = arg; break; case 'number': status = arg; if (i !== 0) { deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)'); } break; case 'object': props = arg; break; } } if (typeof status === 'number' && (status < 400 || status >= 600)) { deprecate('non-error status code; use only 4xx or 5xx status codes'); } if (typeof status !== 'number' || !statuses[status] && (status < 400 || status >= 600)) { status = 500; } // constructor var HttpError = createError[status] || createError[codeClass(status)]; if (!err) { // create error err = HttpError ? new HttpError(msg) : new Error(msg || statuses[status]); Error.captureStackTrace(err, createError); } if (!HttpError || !(err instanceof HttpError) || err.status !== status) { // add properties to generic error err.expose = status < 500; err.status = err.statusCode = status; } for (var key in props) { if (key !== 'status' && key !== 'statusCode') { err[key] = props[key]; } } return err; } /** * Create HTTP error abstract base class. * @private */ function createHttpErrorConstructor() { function HttpError() { throw new TypeError('cannot construct abstract class'); } inherits(HttpError, Error); return HttpError; } /** * Create a constructor for a client error. * @private */ function createClientErrorConstructor(HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error'; function ClientError(message) { // create the error object var msg = message != null ? message : statuses[code]; var err = new Error(msg); // capture a stack trace to the construction point Error.captureStackTrace(err, ClientError); // adjust the [[Prototype]] setPrototypeOf(err, ClientError.prototype); // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }); // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ClientError, HttpError); ClientError.prototype.status = code; ClientError.prototype.statusCode = code; ClientError.prototype.expose = true; return ClientError; } /** * Create a constructor for a server error. * @private */ function createServerErrorConstructor(HttpError, name, code) { var className = name.match(/Error$/) ? name : name + 'Error'; function ServerError(message) { // create the error object var msg = message != null ? message : statuses[code]; var err = new Error(msg); // capture a stack trace to the construction point Error.captureStackTrace(err, ServerError); // adjust the [[Prototype]] setPrototypeOf(err, ServerError.prototype); // redefine the error message Object.defineProperty(err, 'message', { enumerable: true, configurable: true, value: msg, writable: true }); // redefine the error name Object.defineProperty(err, 'name', { enumerable: false, configurable: true, value: className, writable: true }); return err; } inherits(ServerError, HttpError); ServerError.prototype.status = code; ServerError.prototype.statusCode = code; ServerError.prototype.expose = false; return ServerError; } /** * Populate the exports object with constructors for every error class. * @private */ function populateConstructorExports(exports, codes, HttpError) { codes.forEach(function forEachCode(code) { var CodeError; var name = toIdentifier(statuses[code]); switch (codeClass(code)) { case 400: CodeError = createClientErrorConstructor(HttpError, name, code); break; case 500: CodeError = createServerErrorConstructor(HttpError, name, code); break; } if (CodeError) { // export the constructor exports[code] = CodeError; exports[name] = CodeError; } }); // backwards-compatibility exports["I'mateapot"] = deprecate.function(exports.ImATeapot, '"I\'mateapot"; use "ImATeapot" instead'); } /** * Convert a string of words to a JavaScript identifier. * @private */ function toIdentifier(str) { return str.split(' ').map(function (token) { return token.slice(0, 1).toUpperCase() + token.slice(1); }).join('').replace(/[^ _0-9a-z]/gi, ''); } /***/ }), /***/ "./node_modules/raw-body/node_modules/setprototypeof/index.js": /*!********************************************************************!*\ !*** ./node_modules/raw-body/node_modules/setprototypeof/index.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); function setProtoOf(obj, proto) { obj.__proto__ = proto; return obj; } function mixinProperties(obj, proto) { for (var prop in proto) { if (!obj.hasOwnProperty(prop)) { obj[prop] = proto[prop]; } } return obj; } /***/ }), /***/ "./node_modules/raw-body/node_modules/statuses/codes.json": /*!****************************************************************!*\ !*** ./node_modules/raw-body/node_modules/statuses/codes.json ***! \****************************************************************/ /*! exports provided: 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, default */ /***/ (function(module) { module.exports = {"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}; /***/ }), /***/ "./node_modules/raw-body/node_modules/statuses/index.js": /*!**************************************************************!*\ !*** ./node_modules/raw-body/node_modules/statuses/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * statuses * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var codes = __webpack_require__(/*! ./codes.json */ "./node_modules/raw-body/node_modules/statuses/codes.json"); /** * Module exports. * @public */ module.exports = status; // status code to message map status.STATUS_CODES = codes; // array of status codes status.codes = populateStatusesMap(status, codes); // status codes for redirects status.redirect = { 300: true, 301: true, 302: true, 303: true, 305: true, 307: true, 308: true // status codes for empty bodies };status.empty = { 204: true, 205: true, 304: true // status codes for when you should retry the request };status.retry = { 502: true, 503: true, 504: true /** * Populate the statuses map for given codes. * @private */ };function populateStatusesMap(statuses, codes) { var arr = []; Object.keys(codes).forEach(function forEachCode(code) { var message = codes[code]; var status = Number(code); // Populate properties statuses[status] = message; statuses[message] = status; statuses[message.toLowerCase()] = status; // Add to array arr.push(status); }); return arr; } /** * Get the status code. * * Given a number, this will throw if it is not a known status * code, otherwise the code will be returned. Given a string, * the string will be parsed for a number and return the code * if valid, otherwise will lookup the code assuming this is * the status message. * * @param {string|number} code * @returns {number} * @public */ function status(code) { if (typeof code === 'number') { if (!status[code]) throw new Error('invalid status code: ' + code); return code; } if (typeof code !== 'string') { throw new TypeError('code must be a number or string'); } // '403' var n = parseInt(code, 10); if (!isNaN(n)) { if (!status[n]) throw new Error('invalid status code: ' + n); return n; } n = status[code.toLowerCase()]; if (!n) throw new Error('invalid status message: "' + code + '"'); return n; } /***/ }), /***/ "./node_modules/send/index.js": /*!************************************!*\ !*** ./node_modules/send/index.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * send * Copyright(c) 2012 TJ Holowaychuk * Copyright(c) 2014-2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var createError = __webpack_require__(/*! http-errors */ "./node_modules/http-errors/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/index.js")('send'); var deprecate = __webpack_require__(/*! depd */ "./node_modules/depd/index.js")('send'); var destroy = __webpack_require__(/*! destroy */ "./node_modules/destroy/index.js"); var encodeUrl = __webpack_require__(/*! encodeurl */ "./node_modules/encodeurl/index.js"); var escapeHtml = __webpack_require__(/*! escape-html */ "./node_modules/escape-html/index.js"); var etag = __webpack_require__(/*! etag */ "./node_modules/etag/index.js"); var fresh = __webpack_require__(/*! fresh */ "./node_modules/fresh/index.js"); var fs = __webpack_require__(/*! fs */ "fs"); var mime = __webpack_require__(/*! mime */ "./node_modules/mime/mime.js"); var ms = __webpack_require__(/*! ms */ "./node_modules/ms/index.js"); var onFinished = __webpack_require__(/*! on-finished */ "./node_modules/on-finished/index.js"); var parseRange = __webpack_require__(/*! range-parser */ "./node_modules/range-parser/index.js"); var path = __webpack_require__(/*! path */ "path"); var statuses = __webpack_require__(/*! statuses */ "./node_modules/statuses/index.js"); var Stream = __webpack_require__(/*! stream */ "stream"); var util = __webpack_require__(/*! util */ "util"); /** * Path function references. * @private */ var extname = path.extname; var join = path.join; var normalize = path.normalize; var resolve = path.resolve; var sep = path.sep; /** * Regular expression for identifying a bytes Range header. * @private */ var BYTES_RANGE_REGEXP = /^ *bytes=/; /** * Maximum value allowed for the max age. * @private */ var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000; // 1 year /** * Regular expression to match a path with a directory up component. * @private */ var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/; /** * Module exports. * @public */ module.exports = send; module.exports.mime = mime; /** * Return a `SendStream` for `req` and `path`. * * @param {object} req * @param {string} path * @param {object} [options] * @return {SendStream} * @public */ function send(req, path, options) { return new SendStream(req, path, options); } /** * Initialize a `SendStream` with the given `path`. * * @param {Request} req * @param {String} path * @param {object} [options] * @private */ function SendStream(req, path, options) { Stream.call(this); var opts = options || {}; this.options = opts; this.path = path; this.req = req; this._acceptRanges = opts.acceptRanges !== undefined ? Boolean(opts.acceptRanges) : true; this._cacheControl = opts.cacheControl !== undefined ? Boolean(opts.cacheControl) : true; this._etag = opts.etag !== undefined ? Boolean(opts.etag) : true; this._dotfiles = opts.dotfiles !== undefined ? opts.dotfiles : 'ignore'; if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') { throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"'); } this._hidden = Boolean(opts.hidden); if (opts.hidden !== undefined) { deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead'); } // legacy support if (opts.dotfiles === undefined) { this._dotfiles = undefined; } this._extensions = opts.extensions !== undefined ? normalizeList(opts.extensions, 'extensions option') : []; this._immutable = opts.immutable !== undefined ? Boolean(opts.immutable) : false; this._index = opts.index !== undefined ? normalizeList(opts.index, 'index option') : ['index.html']; this._lastModified = opts.lastModified !== undefined ? Boolean(opts.lastModified) : true; this._maxage = opts.maxAge || opts.maxage; this._maxage = typeof this._maxage === 'string' ? ms(this._maxage) : Number(this._maxage); this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0; this._root = opts.root ? resolve(opts.root) : null; if (!this._root && opts.from) { this.from(opts.from); } } /** * Inherits from `Stream`. */ util.inherits(SendStream, Stream); /** * Enable or disable etag generation. * * @param {Boolean} val * @return {SendStream} * @api public */ SendStream.prototype.etag = deprecate.function(function etag(val) { this._etag = Boolean(val); debug('etag %s', this._etag); return this; }, 'send.etag: pass etag as option'); /** * Enable or disable "hidden" (dot) files. * * @param {Boolean} path * @return {SendStream} * @api public */ SendStream.prototype.hidden = deprecate.function(function hidden(val) { this._hidden = Boolean(val); this._dotfiles = undefined; debug('hidden %s', this._hidden); return this; }, 'send.hidden: use dotfiles option'); /** * Set index `paths`, set to a falsy * value to disable index support. * * @param {String|Boolean|Array} paths * @return {SendStream} * @api public */ SendStream.prototype.index = deprecate.function(function index(paths) { var index = !paths ? [] : normalizeList(paths, 'paths argument'); debug('index %o', paths); this._index = index; return this; }, 'send.index: pass index as option'); /** * Set root `path`. * * @param {String} path * @return {SendStream} * @api public */ SendStream.prototype.root = function root(path) { this._root = resolve(String(path)); debug('root %s', this._root); return this; }; SendStream.prototype.from = deprecate.function(SendStream.prototype.root, 'send.from: pass root as option'); SendStream.prototype.root = deprecate.function(SendStream.prototype.root, 'send.root: pass root as option'); /** * Set max-age to `maxAge`. * * @param {Number} maxAge * @return {SendStream} * @api public */ SendStream.prototype.maxage = deprecate.function(function maxage(maxAge) { this._maxage = typeof maxAge === 'string' ? ms(maxAge) : Number(maxAge); this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0; debug('max-age %d', this._maxage); return this; }, 'send.maxage: pass maxAge as option'); /** * Emit error with `status`. * * @param {number} status * @param {Error} [err] * @private */ SendStream.prototype.error = function error(status, err) { // emit if listeners instead of responding if (hasListeners(this, 'error')) { return this.emit('error', createError(status, err, { expose: false })); } var res = this.res; var msg = statuses[status] || String(status); var doc = createHtmlDocument('Error', escapeHtml(msg)); // clear existing headers clearHeaders(res); // add error headers if (err && err.headers) { setHeaders(res, err.headers); } // send basic response res.statusCode = status; res.setHeader('Content-Type', 'text/html; charset=UTF-8'); res.setHeader('Content-Length', Buffer.byteLength(doc)); res.setHeader('Content-Security-Policy', "default-src 'self'"); res.setHeader('X-Content-Type-Options', 'nosniff'); res.end(doc); }; /** * Check if the pathname ends with "/". * * @return {boolean} * @private */ SendStream.prototype.hasTrailingSlash = function hasTrailingSlash() { return this.path[this.path.length - 1] === '/'; }; /** * Check if this is a conditional GET request. * * @return {Boolean} * @api private */ SendStream.prototype.isConditionalGET = function isConditionalGET() { return this.req.headers['if-match'] || this.req.headers['if-unmodified-since'] || this.req.headers['if-none-match'] || this.req.headers['if-modified-since']; }; /** * Check if the request preconditions failed. * * @return {boolean} * @private */ SendStream.prototype.isPreconditionFailure = function isPreconditionFailure() { var req = this.req; var res = this.res; // if-match var match = req.headers['if-match']; if (match) { var etag = res.getHeader('ETag'); return !etag || match !== '*' && parseTokenList(match).every(function (match) { return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag; }); } // if-unmodified-since var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']); if (!isNaN(unmodifiedSince)) { var lastModified = parseHttpDate(res.getHeader('Last-Modified')); return isNaN(lastModified) || lastModified > unmodifiedSince; } return false; }; /** * Strip content-* header fields. * * @private */ SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields() { var res = this.res; var headers = getHeaderNames(res); for (var i = 0; i < headers.length; i++) { var header = headers[i]; if (header.substr(0, 8) === 'content-' && header !== 'content-location') { res.removeHeader(header); } } }; /** * Respond with 304 not modified. * * @api private */ SendStream.prototype.notModified = function notModified() { var res = this.res; debug('not modified'); this.removeContentHeaderFields(); res.statusCode = 304; res.end(); }; /** * Raise error that headers already sent. * * @api private */ SendStream.prototype.headersAlreadySent = function headersAlreadySent() { var err = new Error('Can\'t set headers after they are sent.'); debug('headers already sent'); this.error(500, err); }; /** * Check if the request is cacheable, aka * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). * * @return {Boolean} * @api private */ SendStream.prototype.isCachable = function isCachable() { var statusCode = this.res.statusCode; return statusCode >= 200 && statusCode < 300 || statusCode === 304; }; /** * Handle stat() error. * * @param {Error} error * @private */ SendStream.prototype.onStatError = function onStatError(error) { switch (error.code) { case 'ENAMETOOLONG': case 'ENOENT': case 'ENOTDIR': this.error(404, error); break; default: this.error(500, error); break; } }; /** * Check if the cache is fresh. * * @return {Boolean} * @api private */ SendStream.prototype.isFresh = function isFresh() { return fresh(this.req.headers, { 'etag': this.res.getHeader('ETag'), 'last-modified': this.res.getHeader('Last-Modified') }); }; /** * Check if the range is fresh. * * @return {Boolean} * @api private */ SendStream.prototype.isRangeFresh = function isRangeFresh() { var ifRange = this.req.headers['if-range']; if (!ifRange) { return true; } // if-range as etag if (ifRange.indexOf('"') !== -1) { var etag = this.res.getHeader('ETag'); return Boolean(etag && ifRange.indexOf(etag) !== -1); } // if-range as modified date var lastModified = this.res.getHeader('Last-Modified'); return parseHttpDate(lastModified) <= parseHttpDate(ifRange); }; /** * Redirect to path. * * @param {string} path * @private */ SendStream.prototype.redirect = function redirect(path) { var res = this.res; if (hasListeners(this, 'directory')) { this.emit('directory', res, path); return; } if (this.hasTrailingSlash()) { this.error(403); return; } var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')); var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href="' + escapeHtml(loc) + '">' + escapeHtml(loc) + '</a>'); // redirect res.statusCode = 301; res.setHeader('Content-Type', 'text/html; charset=UTF-8'); res.setHeader('Content-Length', Buffer.byteLength(doc)); res.setHeader('Content-Security-Policy', "default-src 'self'"); res.setHeader('X-Content-Type-Options', 'nosniff'); res.setHeader('Location', loc); res.end(doc); }; /** * Pipe to `res. * * @param {Stream} res * @return {Stream} res * @api public */ SendStream.prototype.pipe = function pipe(res) { // root path var root = this._root; // references this.res = res; // decode the path var path = decode(this.path); if (path === -1) { this.error(400); return res; } // null byte(s) if (~path.indexOf('\0')) { this.error(400); return res; } var parts; if (root !== null) { // normalize if (path) { path = normalize('.' + sep + path); } // malicious path if (UP_PATH_REGEXP.test(path)) { debug('malicious path "%s"', path); this.error(403); return res; } // explode path parts parts = path.split(sep); // join / normalize from optional root dir path = normalize(join(root, path)); root = normalize(root + sep); } else { // ".." is malicious without "root" if (UP_PATH_REGEXP.test(path)) { debug('malicious path "%s"', path); this.error(403); return res; } // explode path parts parts = normalize(path).split(sep); // resolve the path path = resolve(path); } // dotfile handling if (containsDotFile(parts)) { var access = this._dotfiles; // legacy support if (access === undefined) { access = parts[parts.length - 1][0] === '.' ? this._hidden ? 'allow' : 'ignore' : 'allow'; } debug('%s dotfile "%s"', access, path); switch (access) { case 'allow': break; case 'deny': this.error(403); return res; case 'ignore': default: this.error(404); return res; } } // index file support if (this._index.length && this.hasTrailingSlash()) { this.sendIndex(path); return res; } this.sendFile(path); return res; }; /** * Transfer `path`. * * @param {String} path * @api public */ SendStream.prototype.send = function send(path, stat) { var len = stat.size; var options = this.options; var opts = {}; var res = this.res; var req = this.req; var ranges = req.headers.range; var offset = options.start || 0; if (headersSent(res)) { // impossible to send now this.headersAlreadySent(); return; } debug('pipe "%s"', path); // set header fields this.setHeader(path, stat); // set content-type this.type(path); // conditional GET support if (this.isConditionalGET()) { if (this.isPreconditionFailure()) { this.error(412); return; } if (this.isCachable() && this.isFresh()) { this.notModified(); return; } } // adjust len to start/end options len = Math.max(0, len - offset); if (options.end !== undefined) { var bytes = options.end - offset + 1; if (len > bytes) len = bytes; } // Range support if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { // parse ranges = parseRange(len, ranges, { combine: true }); // If-Range support if (!this.isRangeFresh()) { debug('range stale'); ranges = -2; } // unsatisfiable if (ranges === -1) { debug('range unsatisfiable'); // Content-Range res.setHeader('Content-Range', contentRange('bytes', len)); // 416 Requested Range Not Satisfiable return this.error(416, { headers: { 'Content-Range': res.getHeader('Content-Range') } }); } // valid (syntactically invalid/multiple ranges are treated as a regular response) if (ranges !== -2 && ranges.length === 1) { debug('range %j', ranges); // Content-Range res.statusCode = 206; res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])); // adjust for requested range offset += ranges[0].start; len = ranges[0].end - ranges[0].start + 1; } } // clone options for (var prop in options) { opts[prop] = options[prop]; } // set read options opts.start = offset; opts.end = Math.max(offset, offset + len - 1); // content-length res.setHeader('Content-Length', len); // HEAD support if (req.method === 'HEAD') { res.end(); return; } this.stream(path, opts); }; /** * Transfer file for `path`. * * @param {String} path * @api private */ SendStream.prototype.sendFile = function sendFile(path) { var i = 0; var self = this; debug('stat "%s"', path); fs.stat(path, function onstat(err, stat) { if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) { // not found, check extensions return next(err); } if (err) return self.onStatError(err); if (stat.isDirectory()) return self.redirect(path); self.emit('file', path, stat); self.send(path, stat); }); function next(err) { if (self._extensions.length <= i) { return err ? self.onStatError(err) : self.error(404); } var p = path + '.' + self._extensions[i++]; debug('stat "%s"', p); fs.stat(p, function (err, stat) { if (err) return next(err); if (stat.isDirectory()) return next(); self.emit('file', p, stat); self.send(p, stat); }); } }; /** * Transfer index for `path`. * * @param {String} path * @api private */ SendStream.prototype.sendIndex = function sendIndex(path) { var i = -1; var self = this; function next(err) { if (++i >= self._index.length) { if (err) return self.onStatError(err); return self.error(404); } var p = join(path, self._index[i]); debug('stat "%s"', p); fs.stat(p, function (err, stat) { if (err) return next(err); if (stat.isDirectory()) return next(); self.emit('file', p, stat); self.send(p, stat); }); } next(); }; /** * Stream `path` to the response. * * @param {String} path * @param {Object} options * @api private */ SendStream.prototype.stream = function stream(path, options) { // TODO: this is all lame, refactor meeee var finished = false; var self = this; var res = this.res; // pipe var stream = fs.createReadStream(path, options); this.emit('stream', stream); stream.pipe(res); // response finished, done with the fd onFinished(res, function onfinished() { finished = true; destroy(stream); }); // error handling code-smell stream.on('error', function onerror(err) { // request already finished if (finished) return; // clean up stream finished = true; destroy(stream); // error self.onStatError(err); }); // end stream.on('end', function onend() { self.emit('end'); }); }; /** * Set content-type based on `path` * if it hasn't been explicitly set. * * @param {String} path * @api private */ SendStream.prototype.type = function type(path) { var res = this.res; if (res.getHeader('Content-Type')) return; var type = mime.lookup(path); if (!type) { debug('no content-type'); return; } var charset = mime.charsets.lookup(type); debug('content-type %s', type); res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); }; /** * Set response header fields, most * fields may be pre-defined. * * @param {String} path * @param {Object} stat * @api private */ SendStream.prototype.setHeader = function setHeader(path, stat) { var res = this.res; this.emit('headers', res, path, stat); if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { debug('accept ranges'); res.setHeader('Accept-Ranges', 'bytes'); } if (this._cacheControl && !res.getHeader('Cache-Control')) { var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000); if (this._immutable) { cacheControl += ', immutable'; } debug('cache-control %s', cacheControl); res.setHeader('Cache-Control', cacheControl); } if (this._lastModified && !res.getHeader('Last-Modified')) { var modified = stat.mtime.toUTCString(); debug('modified %s', modified); res.setHeader('Last-Modified', modified); } if (this._etag && !res.getHeader('ETag')) { var val = etag(stat); debug('etag %s', val); res.setHeader('ETag', val); } }; /** * Clear all headers from a response. * * @param {object} res * @private */ function clearHeaders(res) { var headers = getHeaderNames(res); for (var i = 0; i < headers.length; i++) { res.removeHeader(headers[i]); } } /** * Collapse all leading slashes into a single slash * * @param {string} str * @private */ function collapseLeadingSlashes(str) { for (var i = 0; i < str.length; i++) { if (str[i] !== '/') { break; } } return i > 1 ? '/' + str.substr(i) : str; } /** * Determine if path parts contain a dotfile. * * @api private */ function containsDotFile(parts) { for (var i = 0; i < parts.length; i++) { var part = parts[i]; if (part.length > 1 && part[0] === '.') { return true; } } return false; } /** * Create a Content-Range header. * * @param {string} type * @param {number} size * @param {array} [range] */ function contentRange(type, size, range) { return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size; } /** * Create a minimal HTML document. * * @param {string} title * @param {string} body * @private */ function createHtmlDocument(title, body) { return '<!DOCTYPE html>\n' + '<html lang="en">\n' + '<head>\n' + '<meta charset="utf-8">\n' + '<title>' + title + '</title>\n' + '</head>\n' + '<body>\n' + '<pre>' + body + '</pre>\n' + '</body>\n' + '</html>\n'; } /** * decodeURIComponent. * * Allows V8 to only deoptimize this fn instead of all * of send(). * * @param {String} path * @api private */ function decode(path) { try { return decodeURIComponent(path); } catch (err) { return -1; } } /** * Get the header names on a respnse. * * @param {object} res * @returns {array[string]} * @private */ function getHeaderNames(res) { return typeof res.getHeaderNames !== 'function' ? Object.keys(res._headers || {}) : res.getHeaderNames(); } /** * Determine if emitter has listeners of a given type. * * The way to do this check is done three different ways in Node.js >= 0.8 * so this consolidates them into a minimal set using instance methods. * * @param {EventEmitter} emitter * @param {string} type * @returns {boolean} * @private */ function hasListeners(emitter, type) { var count = typeof emitter.listenerCount !== 'function' ? emitter.listeners(type).length : emitter.listenerCount(type); return count > 0; } /** * Determine if the response headers have been sent. * * @param {object} res * @returns {boolean} * @private */ function headersSent(res) { return typeof res.headersSent !== 'boolean' ? Boolean(res._header) : res.headersSent; } /** * Normalize the index option into an array. * * @param {boolean|string|array} val * @param {string} name * @private */ function normalizeList(val, name) { var list = [].concat(val || []); for (var i = 0; i < list.length; i++) { if (typeof list[i] !== 'string') { throw new TypeError(name + ' must be array of strings or false'); } } return list; } /** * Parse an HTTP Date into a number. * * @param {string} date * @private */ function parseHttpDate(date) { var timestamp = date && Date.parse(date); return typeof timestamp === 'number' ? timestamp : NaN; } /** * Parse a HTTP token list. * * @param {string} str * @private */ function parseTokenList(str) { var end = 0; var list = []; var start = 0; // gather tokens for (var i = 0, len = str.length; i < len; i++) { switch (str.charCodeAt(i)) { case 0x20: /* */ if (start === end) { start = end = i + 1; } break; case 0x2c: /* , */ list.push(str.substring(start, end)); start = end = i + 1; break; default: end = i + 1; break; } } // final token list.push(str.substring(start, end)); return list; } /** * Set an object of headers on a response. * * @param {object} res * @param {object} headers * @private */ function setHeaders(res, headers) { var keys = Object.keys(headers); for (var i = 0; i < keys.length; i++) { var key = keys[i]; res.setHeader(key, headers[key]); } } /***/ }), /***/ "./node_modules/serve-static/index.js": /*!********************************************!*\ !*** ./node_modules/serve-static/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * serve-static * Copyright(c) 2010 Sencha Inc. * Copyright(c) 2011 TJ Holowaychuk * Copyright(c) 2014-2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var encodeUrl = __webpack_require__(/*! encodeurl */ "./node_modules/encodeurl/index.js"); var escapeHtml = __webpack_require__(/*! escape-html */ "./node_modules/escape-html/index.js"); var parseUrl = __webpack_require__(/*! parseurl */ "./node_modules/parseurl/index.js"); var resolve = __webpack_require__(/*! path */ "path").resolve; var send = __webpack_require__(/*! send */ "./node_modules/send/index.js"); var url = __webpack_require__(/*! url */ "url"); /** * Module exports. * @public */ module.exports = serveStatic; module.exports.mime = send.mime; /** * @param {string} root * @param {object} [options] * @return {function} * @public */ function serveStatic(root, options) { if (!root) { throw new TypeError('root path required'); } if (typeof root !== 'string') { throw new TypeError('root path must be a string'); } // copy options object var opts = Object.create(options || null); // fall-though var fallthrough = opts.fallthrough !== false; // default redirect var redirect = opts.redirect !== false; // headers listener var setHeaders = opts.setHeaders; if (setHeaders && typeof setHeaders !== 'function') { throw new TypeError('option setHeaders must be function'); } // setup options for send opts.maxage = opts.maxage || opts.maxAge || 0; opts.root = resolve(root); // construct directory listener var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener(); return function serveStatic(req, res, next) { if (req.method !== 'GET' && req.method !== 'HEAD') { if (fallthrough) { return next(); } // method not allowed res.statusCode = 405; res.setHeader('Allow', 'GET, HEAD'); res.setHeader('Content-Length', '0'); res.end(); return; } var forwardError = !fallthrough; var originalUrl = parseUrl.original(req); var path = parseUrl(req).pathname; // make sure redirect occurs at mount if (path === '/' && originalUrl.pathname.substr(-1) !== '/') { path = ''; } // create send stream var stream = send(req, path, opts); // add directory handler stream.on('directory', onDirectory); // add headers listener if (setHeaders) { stream.on('headers', setHeaders); } // add file listener for fallthrough if (fallthrough) { stream.on('file', function onFile() { // once file is determined, always forward error forwardError = true; }); } // forward errors stream.on('error', function error(err) { if (forwardError || !(err.statusCode < 500)) { next(err); return; } next(); }); // pipe stream.pipe(res); }; } /** * Collapse all leading slashes into a single slash * @private */ function collapseLeadingSlashes(str) { for (var i = 0; i < str.length; i++) { if (str.charCodeAt(i) !== 0x2f /* / */) { break; } } return i > 1 ? '/' + str.substr(i) : str; } /** * Create a minimal HTML document. * * @param {string} title * @param {string} body * @private */ function createHtmlDocument(title, body) { return '<!DOCTYPE html>\n' + '<html lang="en">\n' + '<head>\n' + '<meta charset="utf-8">\n' + '<title>' + title + '</title>\n' + '</head>\n' + '<body>\n' + '<pre>' + body + '</pre>\n' + '</body>\n' + '</html>\n'; } /** * Create a directory listener that just 404s. * @private */ function createNotFoundDirectoryListener() { return function notFound() { this.error(404); }; } /** * Create a directory listener that performs a redirect. * @private */ function createRedirectDirectoryListener() { return function redirect(res) { if (this.hasTrailingSlash()) { this.error(404); return; } // get original URL var originalUrl = parseUrl.original(this.req); // append trailing slash originalUrl.path = null; originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/'); // reformat the URL var loc = encodeUrl(url.format(originalUrl)); var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href="' + escapeHtml(loc) + '">' + escapeHtml(loc) + '</a>'); // send redirect response res.statusCode = 301; res.setHeader('Content-Type', 'text/html; charset=UTF-8'); res.setHeader('Content-Length', Buffer.byteLength(doc)); res.setHeader('Content-Security-Policy', "default-src 'self'"); res.setHeader('X-Content-Type-Options', 'nosniff'); res.setHeader('Location', loc); res.end(doc); }; } /***/ }), /***/ "./node_modules/setprototypeof/index.js": /*!**********************************************!*\ !*** ./node_modules/setprototypeof/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); function setProtoOf(obj, proto) { obj.__proto__ = proto; return obj; } function mixinProperties(obj, proto) { for (var prop in proto) { if (!obj.hasOwnProperty(prop)) { obj[prop] = proto[prop]; } } return obj; } /***/ }), /***/ "./node_modules/statuses/codes.json": /*!******************************************!*\ !*** ./node_modules/statuses/codes.json ***! \******************************************/ /*! exports provided: 100, 101, 102, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, default */ /***/ (function(module) { module.exports = {"100":"Continue","101":"Switching Protocols","102":"Processing","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}; /***/ }), /***/ "./node_modules/statuses/index.js": /*!****************************************!*\ !*** ./node_modules/statuses/index.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * statuses * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var codes = __webpack_require__(/*! ./codes.json */ "./node_modules/statuses/codes.json"); /** * Module exports. * @public */ module.exports = status; // status code to message map status.STATUS_CODES = codes; // array of status codes status.codes = populateStatusesMap(status, codes); // status codes for redirects status.redirect = { 300: true, 301: true, 302: true, 303: true, 305: true, 307: true, 308: true // status codes for empty bodies };status.empty = { 204: true, 205: true, 304: true // status codes for when you should retry the request };status.retry = { 502: true, 503: true, 504: true /** * Populate the statuses map for given codes. * @private */ };function populateStatusesMap(statuses, codes) { var arr = []; Object.keys(codes).forEach(function forEachCode(code) { var message = codes[code]; var status = Number(code); // Populate properties statuses[status] = message; statuses[message] = status; statuses[message.toLowerCase()] = status; // Add to array arr.push(status); }); return arr; } /** * Get the status code. * * Given a number, this will throw if it is not a known status * code, otherwise the code will be returned. Given a string, * the string will be parsed for a number and return the code * if valid, otherwise will lookup the code assuming this is * the status message. * * @param {string|number} code * @returns {number} * @public */ function status(code) { if (typeof code === 'number') { if (!status[code]) throw new Error('invalid status code: ' + code); return code; } if (typeof code !== 'string') { throw new TypeError('code must be a number or string'); } // '403' var n = parseInt(code, 10); if (!isNaN(n)) { if (!status[n]) throw new Error('invalid status code: ' + n); return n; } n = status[code.toLowerCase()]; if (!n) throw new Error('invalid status message: "' + code + '"'); return n; } /***/ }), /***/ "./node_modules/type-is/index.js": /*!***************************************!*\ !*** ./node_modules/type-is/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * type-is * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var typer = __webpack_require__(/*! media-typer */ "./node_modules/media-typer/index.js"); var mime = __webpack_require__(/*! mime-types */ "./node_modules/mime-types/index.js"); /** * Module exports. * @public */ module.exports = typeofrequest; module.exports.is = typeis; module.exports.hasBody = hasbody; module.exports.normalize = normalize; module.exports.match = mimeMatch; /** * Compare a `value` content-type with `types`. * Each `type` can be an extension like `html`, * a special shortcut like `multipart` or `urlencoded`, * or a mime type. * * If no types match, `false` is returned. * Otherwise, the first `type` that matches is returned. * * @param {String} value * @param {Array} types * @public */ function typeis(value, types_) { var i; var types = types_; // remove parameters and normalize var val = tryNormalizeType(value); // no type or invalid if (!val) { return false; } // support flattened arguments if (types && !Array.isArray(types)) { types = new Array(arguments.length - 1); for (i = 0; i < types.length; i++) { types[i] = arguments[i + 1]; } } // no types, return the content type if (!types || !types.length) { return val; } var type; for (i = 0; i < types.length; i++) { if (mimeMatch(normalize(type = types[i]), val)) { return type[0] === '+' || type.indexOf('*') !== -1 ? val : type; } } // no matches return false; } /** * Check if a request has a request body. * A request with a body __must__ either have `transfer-encoding` * or `content-length` headers set. * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 * * @param {Object} request * @return {Boolean} * @public */ function hasbody(req) { return req.headers['transfer-encoding'] !== undefined || !isNaN(req.headers['content-length']); } /** * Check if the incoming request contains the "Content-Type" * header field, and it contains any of the give mime `type`s. * If there is no request body, `null` is returned. * If there is no content type, `false` is returned. * Otherwise, it returns the first `type` that matches. * * Examples: * * // With Content-Type: text/html; charset=utf-8 * this.is('html'); // => 'html' * this.is('text/html'); // => 'text/html' * this.is('text/*', 'application/json'); // => 'text/html' * * // When Content-Type is application/json * this.is('json', 'urlencoded'); // => 'json' * this.is('application/json'); // => 'application/json' * this.is('html', 'application/*'); // => 'application/json' * * this.is('html'); // => false * * @param {String|Array} types... * @return {String|false|null} * @public */ function typeofrequest(req, types_) { var types = types_; // no body if (!hasbody(req)) { return null; } // support flattened arguments if (arguments.length > 2) { types = new Array(arguments.length - 1); for (var i = 0; i < types.length; i++) { types[i] = arguments[i + 1]; } } // request content type var value = req.headers['content-type']; return typeis(value, types); } /** * Normalize a mime type. * If it's a shorthand, expand it to a valid mime type. * * In general, you probably want: * * var type = is(req, ['urlencoded', 'json', 'multipart']); * * Then use the appropriate body parsers. * These three are the most common request body types * and are thus ensured to work. * * @param {String} type * @private */ function normalize(type) { if (typeof type !== 'string') { // invalid type return false; } switch (type) { case 'urlencoded': return 'application/x-www-form-urlencoded'; case 'multipart': return 'multipart/*'; } if (type[0] === '+') { // "+json" -> "*/*+json" expando return '*/*' + type; } return type.indexOf('/') === -1 ? mime.lookup(type) : type; } /** * Check if `expected` mime type * matches `actual` mime type with * wildcard and +suffix support. * * @param {String} expected * @param {String} actual * @return {Boolean} * @private */ function mimeMatch(expected, actual) { // invalid type if (expected === false) { return false; } // split types var actualParts = actual.split('/'); var expectedParts = expected.split('/'); // invalid format if (actualParts.length !== 2 || expectedParts.length !== 2) { return false; } // validate type if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { return false; } // validate suffix wildcard if (expectedParts[1].substr(0, 2) === '*+') { return expectedParts[1].length <= actualParts[1].length + 1 && expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length); } // validate subtype if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { return false; } return true; } /** * Normalize a type and remove parameters. * * @param {string} value * @return {string} * @private */ function normalizeType(value) { // parse the type var type = typer.parse(value); // remove the parameters type.parameters = undefined; // reformat it return typer.format(type); } /** * Try to normalize a type and remove parameters. * * @param {string} value * @return {string} * @private */ function tryNormalizeType(value) { try { return normalizeType(value); } catch (err) { return null; } } /***/ }), /***/ "./node_modules/unpipe/index.js": /*!**************************************!*\ !*** ./node_modules/unpipe/index.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * unpipe * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = unpipe; /** * Determine if there are Node.js pipe-like data listeners. * @private */ function hasPipeDataListeners(stream) { var listeners = stream.listeners('data'); for (var i = 0; i < listeners.length; i++) { if (listeners[i].name === 'ondata') { return true; } } return false; } /** * Unpipe a stream from all destinations. * * @param {object} stream * @public */ function unpipe(stream) { if (!stream) { throw new TypeError('argument stream is required'); } if (typeof stream.unpipe === 'function') { // new-style stream.unpipe(); return; } // Node.js 0.8 hack if (!hasPipeDataListeners(stream)) { return; } var listener; var listeners = stream.listeners('close'); for (var i = 0; i < listeners.length; i++) { listener = listeners[i]; if (listener.name !== 'cleanup' && listener.name !== 'onclose') { continue; } // invoke the listener listener.call(stream); } } /***/ }), /***/ "./node_modules/utils-merge/index.js": /*!*******************************************!*\ !*** ./node_modules/utils-merge/index.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Merge object b with object a. * * var a = { foo: 'bar' } * , b = { bar: 'baz' }; * * merge(a, b); * // => { foo: 'bar', bar: 'baz' } * * @param {Object} a * @param {Object} b * @return {Object} * @api public */ exports = module.exports = function (a, b) { if (a && b) { for (var key in b) { a[key] = b[key]; } } return a; }; /***/ }), /***/ "./node_modules/vary/index.js": /*!************************************!*\ !*** ./node_modules/vary/index.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * vary * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. */ module.exports = vary; module.exports.append = append; /** * RegExp to match field-name in RFC 7230 sec 3.2 * * field-name = token * token = 1*tchar * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" * / DIGIT / ALPHA * ; any VCHAR, except delimiters */ var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; /** * Append a field to a vary header. * * @param {String} header * @param {String|Array} field * @return {String} * @public */ function append(header, field) { if (typeof header !== 'string') { throw new TypeError('header argument is required'); } if (!field) { throw new TypeError('field argument is required'); } // get fields array var fields = !Array.isArray(field) ? parse(String(field)) : field; // assert on invalid field names for (var j = 0; j < fields.length; j++) { if (!FIELD_NAME_REGEXP.test(fields[j])) { throw new TypeError('field argument contains an invalid header name'); } } // existing, unspecified vary if (header === '*') { return header; } // enumerate current values var val = header; var vals = parse(header.toLowerCase()); // unspecified vary if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) { return '*'; } for (var i = 0; i < fields.length; i++) { var fld = fields[i].toLowerCase(); // append value (case-preserving) if (vals.indexOf(fld) === -1) { vals.push(fld); val = val ? val + ', ' + fields[i] : fields[i]; } } return val; } /** * Parse a vary header into an array. * * @param {String} header * @return {Array} * @private */ function parse(header) { var end = 0; var list = []; var start = 0; // gather tokens for (var i = 0, len = header.length; i < len; i++) { switch (header.charCodeAt(i)) { case 0x20: /* */ if (start === end) { start = end = i + 1; } break; case 0x2c: /* , */ list.push(header.substring(start, end)); start = end = i + 1; break; default: end = i + 1; break; } } // final token list.push(header.substring(start, end)); return list; } /** * Mark that a request is varied on a header field. * * @param {Object} res * @param {String|Array} field * @public */ function vary(res, field) { if (!res || !res.getHeader || !res.setHeader) { // quack quack throw new TypeError('res argument is required'); } // get existing header var val = res.getHeader('Vary') || ''; var header = Array.isArray(val) ? val.join(', ') : String(val); // set new header if (val = append(header, field)) { res.setHeader('Vary', val); } } /***/ }), /***/ "./node_modules/webpack/buildin/module.js": /*!***********************************!*\ !*** (webpack)/buildin/module.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (module) { if (!module.webpackPolyfill) { module.deprecate = function () {}; module.paths = []; // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function get() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function get() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /***/ 0: /*!*********************!*\ !*** multi express ***! \*********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! express */"./node_modules/express/index.js"); /***/ }), /***/ "buffer": /*!*************************!*\ !*** external "buffer" ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("buffer"); /***/ }), /***/ "crypto": /*!*************************!*\ !*** external "crypto" ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("crypto"); /***/ }), /***/ "events": /*!*************************!*\ !*** external "events" ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("events"); /***/ }), /***/ "fs": /*!*********************!*\ !*** external "fs" ***! \*********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("fs"); /***/ }), /***/ "http": /*!***********************!*\ !*** external "http" ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("http"); /***/ }), /***/ "net": /*!**********************!*\ !*** external "net" ***! \**********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("net"); /***/ }), /***/ "path": /*!***********************!*\ !*** external "path" ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("path"); /***/ }), /***/ "querystring": /*!******************************!*\ !*** external "querystring" ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("querystring"); /***/ }), /***/ "stream": /*!*************************!*\ !*** external "stream" ***! \*************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("stream"); /***/ }), /***/ "string_decoder": /*!*********************************!*\ !*** external "string_decoder" ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("string_decoder"); /***/ }), /***/ "tty": /*!**********************!*\ !*** external "tty" ***! \**********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("tty"); /***/ }), /***/ "url": /*!**********************!*\ !*** external "url" ***! \**********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("url"); /***/ }), /***/ "util": /*!***********************!*\ !*** external "util" ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("util"); /***/ }), /***/ "zlib": /*!***********************!*\ !*** external "zlib" ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = require("zlib"); /***/ }) /******/ }); //# sourceMappingURL=vendor.js.map
paramCallback
stream-trades-with-Vega-API-client.go
package main import ( "context" "fmt" "io" "os" "github.com/vegaprotocol/api-clients/go/generated/code.vegaprotocol.io/vega/proto" "github.com/vegaprotocol/api-clients/go/generated/code.vegaprotocol.io/vega/proto/api" "google.golang.org/grpc" ) func
() { nodeURLGrpc := os.Getenv("NODE_URL_GRPC") if len(nodeURLGrpc) == 0 { panic("NODE_URL_GRPC is null or empty") } conn, err := grpc.Dial(nodeURLGrpc, grpc.WithInsecure()) if err != nil { panic(err) } defer conn.Close() dataClient := api.NewTradingDataServiceClient(conn) // Request the identifier for a market request := api.MarketsRequest{} markets, err := dataClient.Markets(context.Background(), &request) if err != nil { panic(err) } marketID := markets.Markets[0].Id fmt.Printf("Found market: %s \n", marketID) fmt.Println("Connecting to stream...") // __stream_trades: // Subscribe to the Trades stream for the marketID specified // Optional: Market identifier - filter by market // Party identifier - filter by party // By default, all trades on all markets for all parties will be returned on the stream. eventType := proto.BusEventType_BUS_EVENT_TYPE_TRADE event, err := dataClient.ObserveEventBus(context.Background()) done := make(chan bool) go func() { for { resp, err := event.Recv() if err == io.EOF { // read done. close(done) return } if err != nil { panic(err) } fmt.Printf("Resp received: %v\n", &resp.Events) } }() observerEvent := api.ObserveEventBusRequest{Type: []proto.BusEventType{eventType}, MarketId: marketID} event.Send(&observerEvent) event.CloseSend() <-done //we will wait until all response is received // :stream_trades__ fmt.Printf("finished") }
main
errors.rs
error_chain! { errors { Parse(msg: String) { description("parse error") display("{}", msg) } }
ParseIntError(::std::num::ParseIntError); } }
foreign_links {
true.go
package main import "os" func main() { os.Exit(0) }
// /usr/bin/true // echo $?
json_deser.rs
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. pub fn parse_http_generic_error( response: &http::Response<bytes::Bytes>, ) -> Result<aws_smithy_types::Error, aws_smithy_json::deserialize::Error> { crate::json_errors::parse_generic_error(response.body(), response.headers()) } pub fn deser_structure_crate_error_access_denied_exception_json_err( value: &[u8], mut builder: crate::error::access_denied_exception::Builder, ) -> Result<crate::error::access_denied_exception::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "docs" => { builder = builder.set_docs( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tip" => { builder = builder.set_tip( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_crate_error_account_setup_in_progress_exception_json_err( value: &[u8], mut builder: crate::error::account_setup_in_progress_exception::Builder, ) -> Result< crate::error::account_setup_in_progress_exception::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "docs" => { builder = builder.set_docs( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tip" => { builder = builder.set_tip( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_crate_error_invalid_input_exception_json_err( value: &[u8], mut builder: crate::error::invalid_input_exception::Builder, ) -> Result<crate::error::invalid_input_exception::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "docs" => { builder = builder.set_docs( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tip" => { builder = builder.set_tip( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_crate_error_not_found_exception_json_err( value: &[u8], mut builder: crate::error::not_found_exception::Builder, ) -> Result<crate::error::not_found_exception::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "docs" => { builder = builder.set_docs( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tip" => { builder = builder.set_tip( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_crate_error_operation_failure_exception_json_err( value: &[u8], mut builder: crate::error::operation_failure_exception::Builder, ) -> Result<crate::error::operation_failure_exception::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "docs" => { builder = builder.set_docs( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tip" => { builder = builder.set_tip( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_crate_error_service_exception_json_err( value: &[u8], mut builder: crate::error::service_exception::Builder, ) -> Result<crate::error::service_exception::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "docs" => { builder = builder.set_docs( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tip" => { builder = builder.set_tip( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_crate_error_unauthenticated_exception_json_err( value: &[u8], mut builder: crate::error::unauthenticated_exception::Builder, ) -> Result<crate::error::unauthenticated_exception::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "docs" => { builder = builder.set_docs( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tip" => { builder = builder.set_tip( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_allocate_static_ip( value: &[u8], mut builder: crate::output::allocate_static_ip_output::Builder, ) -> Result<crate::output::allocate_static_ip_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_attach_certificate_to_distribution( value: &[u8], mut builder: crate::output::attach_certificate_to_distribution_output::Builder, ) -> Result< crate::output::attach_certificate_to_distribution_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_attach_disk( value: &[u8], mut builder: crate::output::attach_disk_output::Builder, ) -> Result<crate::output::attach_disk_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_attach_instances_to_load_balancer( value: &[u8], mut builder: crate::output::attach_instances_to_load_balancer_output::Builder, ) -> Result< crate::output::attach_instances_to_load_balancer_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_attach_load_balancer_tls_certificate( value: &[u8], mut builder: crate::output::attach_load_balancer_tls_certificate_output::Builder, ) -> Result< crate::output::attach_load_balancer_tls_certificate_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_attach_static_ip( value: &[u8], mut builder: crate::output::attach_static_ip_output::Builder, ) -> Result<crate::output::attach_static_ip_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_close_instance_public_ports( value: &[u8], mut builder: crate::output::close_instance_public_ports_output::Builder, ) -> Result< crate::output::close_instance_public_ports_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_copy_snapshot( value: &[u8], mut builder: crate::output::copy_snapshot_output::Builder, ) -> Result<crate::output::copy_snapshot_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_bucket( value: &[u8], mut builder: crate::output::create_bucket_output::Builder, ) -> Result<crate::output::create_bucket_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bucket" => { builder = builder.set_bucket( crate::json_deser::deser_structure_crate_model_bucket(tokens)?, ); } "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_bucket_access_key( value: &[u8], mut builder: crate::output::create_bucket_access_key_output::Builder, ) -> Result< crate::output::create_bucket_access_key_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "accessKey" => { builder = builder.set_access_key( crate::json_deser::deser_structure_crate_model_access_key(tokens)?, ); } "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_certificate( value: &[u8], mut builder: crate::output::create_certificate_output::Builder, ) -> Result<crate::output::create_certificate_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "certificate" => { builder = builder.set_certificate( crate::json_deser::deser_structure_crate_model_certificate_summary( tokens, )?, ); } "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_cloud_formation_stack( value: &[u8], mut builder: crate::output::create_cloud_formation_stack_output::Builder, ) -> Result< crate::output::create_cloud_formation_stack_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_contact_method( value: &[u8], mut builder: crate::output::create_contact_method_output::Builder, ) -> Result<crate::output::create_contact_method_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_container_service( value: &[u8], mut builder: crate::output::create_container_service_output::Builder, ) -> Result< crate::output::create_container_service_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerService" => { builder = builder.set_container_service( crate::json_deser::deser_structure_crate_model_container_service( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_container_service_deployment( value: &[u8], mut builder: crate::output::create_container_service_deployment_output::Builder, ) -> Result< crate::output::create_container_service_deployment_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerService" => { builder = builder.set_container_service( crate::json_deser::deser_structure_crate_model_container_service( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_container_service_registry_login( value: &[u8], mut builder: crate::output::create_container_service_registry_login_output::Builder, ) -> Result< crate::output::create_container_service_registry_login_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "registryLogin" => { builder = builder.set_registry_login( crate::json_deser::deser_structure_crate_model_container_service_registry_login(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_disk( value: &[u8], mut builder: crate::output::create_disk_output::Builder, ) -> Result<crate::output::create_disk_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_disk_from_snapshot( value: &[u8], mut builder: crate::output::create_disk_from_snapshot_output::Builder, ) -> Result< crate::output::create_disk_from_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_disk_snapshot( value: &[u8], mut builder: crate::output::create_disk_snapshot_output::Builder, ) -> Result<crate::output::create_disk_snapshot_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_distribution( value: &[u8], mut builder: crate::output::create_distribution_output::Builder, ) -> Result<crate::output::create_distribution_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "distribution" => { builder = builder.set_distribution( crate::json_deser::deser_structure_crate_model_lightsail_distribution( tokens, )?, ); } "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_domain( value: &[u8], mut builder: crate::output::create_domain_output::Builder, ) -> Result<crate::output::create_domain_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_domain_entry( value: &[u8], mut builder: crate::output::create_domain_entry_output::Builder, ) -> Result<crate::output::create_domain_entry_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_instances( value: &[u8], mut builder: crate::output::create_instances_output::Builder, ) -> Result<crate::output::create_instances_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_instances_from_snapshot( value: &[u8], mut builder: crate::output::create_instances_from_snapshot_output::Builder, ) -> Result< crate::output::create_instances_from_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_instance_snapshot( value: &[u8], mut builder: crate::output::create_instance_snapshot_output::Builder, ) -> Result< crate::output::create_instance_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_key_pair( value: &[u8], mut builder: crate::output::create_key_pair_output::Builder, ) -> Result<crate::output::create_key_pair_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "keyPair" => { builder = builder.set_key_pair( crate::json_deser::deser_structure_crate_model_key_pair(tokens)?, ); } "publicKeyBase64" => { builder = builder.set_public_key_base64( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "privateKeyBase64" => { builder = builder.set_private_key_base64( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_load_balancer( value: &[u8], mut builder: crate::output::create_load_balancer_output::Builder, ) -> Result<crate::output::create_load_balancer_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_load_balancer_tls_certificate( value: &[u8], mut builder: crate::output::create_load_balancer_tls_certificate_output::Builder, ) -> Result< crate::output::create_load_balancer_tls_certificate_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_relational_database( value: &[u8], mut builder: crate::output::create_relational_database_output::Builder, ) -> Result< crate::output::create_relational_database_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_relational_database_from_snapshot( value: &[u8], mut builder: crate::output::create_relational_database_from_snapshot_output::Builder, ) -> Result< crate::output::create_relational_database_from_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_create_relational_database_snapshot( value: &[u8], mut builder: crate::output::create_relational_database_snapshot_output::Builder, ) -> Result< crate::output::create_relational_database_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_alarm( value: &[u8], mut builder: crate::output::delete_alarm_output::Builder, ) -> Result<crate::output::delete_alarm_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_auto_snapshot( value: &[u8], mut builder: crate::output::delete_auto_snapshot_output::Builder, ) -> Result<crate::output::delete_auto_snapshot_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_bucket( value: &[u8], mut builder: crate::output::delete_bucket_output::Builder, ) -> Result<crate::output::delete_bucket_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_bucket_access_key( value: &[u8], mut builder: crate::output::delete_bucket_access_key_output::Builder, ) -> Result< crate::output::delete_bucket_access_key_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_certificate( value: &[u8], mut builder: crate::output::delete_certificate_output::Builder, ) -> Result<crate::output::delete_certificate_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_contact_method( value: &[u8], mut builder: crate::output::delete_contact_method_output::Builder, ) -> Result<crate::output::delete_contact_method_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_disk( value: &[u8], mut builder: crate::output::delete_disk_output::Builder, ) -> Result<crate::output::delete_disk_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_disk_snapshot( value: &[u8], mut builder: crate::output::delete_disk_snapshot_output::Builder, ) -> Result<crate::output::delete_disk_snapshot_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_distribution( value: &[u8], mut builder: crate::output::delete_distribution_output::Builder, ) -> Result<crate::output::delete_distribution_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_domain( value: &[u8], mut builder: crate::output::delete_domain_output::Builder, ) -> Result<crate::output::delete_domain_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_domain_entry( value: &[u8], mut builder: crate::output::delete_domain_entry_output::Builder, ) -> Result<crate::output::delete_domain_entry_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_instance( value: &[u8], mut builder: crate::output::delete_instance_output::Builder, ) -> Result<crate::output::delete_instance_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_instance_snapshot( value: &[u8], mut builder: crate::output::delete_instance_snapshot_output::Builder, ) -> Result< crate::output::delete_instance_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_key_pair( value: &[u8], mut builder: crate::output::delete_key_pair_output::Builder, ) -> Result<crate::output::delete_key_pair_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_known_host_keys( value: &[u8], mut builder: crate::output::delete_known_host_keys_output::Builder, ) -> Result< crate::output::delete_known_host_keys_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_load_balancer( value: &[u8], mut builder: crate::output::delete_load_balancer_output::Builder, ) -> Result<crate::output::delete_load_balancer_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_load_balancer_tls_certificate( value: &[u8], mut builder: crate::output::delete_load_balancer_tls_certificate_output::Builder, ) -> Result< crate::output::delete_load_balancer_tls_certificate_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_relational_database( value: &[u8], mut builder: crate::output::delete_relational_database_output::Builder, ) -> Result< crate::output::delete_relational_database_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_delete_relational_database_snapshot( value: &[u8], mut builder: crate::output::delete_relational_database_snapshot_output::Builder, ) -> Result< crate::output::delete_relational_database_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_detach_certificate_from_distribution( value: &[u8], mut builder: crate::output::detach_certificate_from_distribution_output::Builder, ) -> Result< crate::output::detach_certificate_from_distribution_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_detach_disk( value: &[u8], mut builder: crate::output::detach_disk_output::Builder, ) -> Result<crate::output::detach_disk_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_detach_instances_from_load_balancer( value: &[u8], mut builder: crate::output::detach_instances_from_load_balancer_output::Builder, ) -> Result< crate::output::detach_instances_from_load_balancer_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_detach_static_ip( value: &[u8], mut builder: crate::output::detach_static_ip_output::Builder, ) -> Result<crate::output::detach_static_ip_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_disable_add_on( value: &[u8], mut builder: crate::output::disable_add_on_output::Builder, ) -> Result<crate::output::disable_add_on_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_download_default_key_pair( value: &[u8], mut builder: crate::output::download_default_key_pair_output::Builder, ) -> Result< crate::output::download_default_key_pair_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "publicKeyBase64" => { builder = builder.set_public_key_base64( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "privateKeyBase64" => { builder = builder.set_private_key_base64( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_enable_add_on( value: &[u8], mut builder: crate::output::enable_add_on_output::Builder, ) -> Result<crate::output::enable_add_on_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_export_snapshot( value: &[u8], mut builder: crate::output::export_snapshot_output::Builder, ) -> Result<crate::output::export_snapshot_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_active_names( value: &[u8], mut builder: crate::output::get_active_names_output::Builder, ) -> Result<crate::output::get_active_names_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "activeNames" => { builder = builder.set_active_names( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_alarms( value: &[u8], mut builder: crate::output::get_alarms_output::Builder, ) -> Result<crate::output::get_alarms_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "alarms" => { builder = builder.set_alarms( crate::json_deser::deser_list_com_amazonaws_lightsail_alarms_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_auto_snapshots( value: &[u8], mut builder: crate::output::get_auto_snapshots_output::Builder, ) -> Result<crate::output::get_auto_snapshots_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "resourceName" => { builder = builder.set_resource_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "autoSnapshots" => { builder = builder.set_auto_snapshots( crate::json_deser::deser_list_com_amazonaws_lightsail_auto_snapshot_details_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_blueprints( value: &[u8], mut builder: crate::output::get_blueprints_output::Builder, ) -> Result<crate::output::get_blueprints_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "blueprints" => { builder = builder.set_blueprints( crate::json_deser::deser_list_com_amazonaws_lightsail_blueprint_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_bucket_access_keys( value: &[u8], mut builder: crate::output::get_bucket_access_keys_output::Builder, ) -> Result< crate::output::get_bucket_access_keys_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "accessKeys" => { builder = builder.set_access_keys( crate::json_deser::deser_list_com_amazonaws_lightsail_access_key_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_bucket_bundles( value: &[u8], mut builder: crate::output::get_bucket_bundles_output::Builder, ) -> Result<crate::output::get_bucket_bundles_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bundles" => { builder = builder.set_bundles( crate::json_deser::deser_list_com_amazonaws_lightsail_bucket_bundle_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_bucket_metric_data( value: &[u8], mut builder: crate::output::get_bucket_metric_data_output::Builder, ) -> Result< crate::output::get_bucket_metric_data_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "metricName" => { builder = builder.set_metric_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::BucketMetricName::from(u.as_ref())) }) .transpose()?, ); } "metricData" => { builder = builder.set_metric_data( crate::json_deser::deser_list_com_amazonaws_lightsail_metric_datapoint_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_buckets( value: &[u8], mut builder: crate::output::get_buckets_output::Builder, ) -> Result<crate::output::get_buckets_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "buckets" => { builder = builder.set_buckets( crate::json_deser::deser_list_com_amazonaws_lightsail_bucket_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_bundles( value: &[u8], mut builder: crate::output::get_bundles_output::Builder, ) -> Result<crate::output::get_bundles_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bundles" => { builder = builder.set_bundles( crate::json_deser::deser_list_com_amazonaws_lightsail_bundle_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_certificates( value: &[u8], mut builder: crate::output::get_certificates_output::Builder, ) -> Result<crate::output::get_certificates_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "certificates" => { builder = builder.set_certificates( crate::json_deser::deser_list_com_amazonaws_lightsail_certificate_summary_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_cloud_formation_stack_records( value: &[u8], mut builder: crate::output::get_cloud_formation_stack_records_output::Builder, ) -> Result< crate::output::get_cloud_formation_stack_records_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "cloudFormationStackRecords" => { builder = builder.set_cloud_formation_stack_records( crate::json_deser::deser_list_com_amazonaws_lightsail_cloud_formation_stack_record_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_contact_methods( value: &[u8], mut builder: crate::output::get_contact_methods_output::Builder, ) -> Result<crate::output::get_contact_methods_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "contactMethods" => { builder = builder.set_contact_methods( crate::json_deser::deser_list_com_amazonaws_lightsail_contact_methods_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_container_api_metadata( value: &[u8], mut builder: crate::output::get_container_api_metadata_output::Builder, ) -> Result< crate::output::get_container_api_metadata_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "metadata" => { builder = builder.set_metadata( crate::json_deser::deser_list_com_amazonaws_lightsail_container_service_metadata_entry_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_container_images( value: &[u8], mut builder: crate::output::get_container_images_output::Builder, ) -> Result<crate::output::get_container_images_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerImages" => { builder = builder.set_container_images( crate::json_deser::deser_list_com_amazonaws_lightsail_container_image_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_container_log( value: &[u8], mut builder: crate::output::get_container_log_output::Builder, ) -> Result<crate::output::get_container_log_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "logEvents" => { builder = builder.set_log_events( crate::json_deser::deser_list_com_amazonaws_lightsail_container_service_log_event_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_container_service_deployments( value: &[u8], mut builder: crate::output::get_container_service_deployments_output::Builder, ) -> Result< crate::output::get_container_service_deployments_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "deployments" => { builder = builder.set_deployments( crate::json_deser::deser_list_com_amazonaws_lightsail_container_service_deployment_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_container_service_metric_data( value: &[u8], mut builder: crate::output::get_container_service_metric_data_output::Builder, ) -> Result< crate::output::get_container_service_metric_data_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "metricName" => { builder = builder.set_metric_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ContainerServiceMetricName::from(u.as_ref()) }) }) .transpose()?, ); } "metricData" => { builder = builder.set_metric_data( crate::json_deser::deser_list_com_amazonaws_lightsail_metric_datapoint_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_container_service_powers( value: &[u8], mut builder: crate::output::get_container_service_powers_output::Builder, ) -> Result< crate::output::get_container_service_powers_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "powers" => { builder = builder.set_powers( crate::json_deser::deser_list_com_amazonaws_lightsail_container_service_power_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_container_services( value: &[u8], mut builder: crate::output::get_container_services_output::Builder, ) -> Result< crate::output::get_container_services_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerServices" => { builder = builder.set_container_services( crate::json_deser::deser_list_com_amazonaws_lightsail_container_service_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_disk( value: &[u8], mut builder: crate::output::get_disk_output::Builder, ) -> Result<crate::output::get_disk_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "disk" => { builder = builder .set_disk(crate::json_deser::deser_structure_crate_model_disk(tokens)?); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_disks( value: &[u8], mut builder: crate::output::get_disks_output::Builder, ) -> Result<crate::output::get_disks_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "disks" => { builder = builder.set_disks( crate::json_deser::deser_list_com_amazonaws_lightsail_disk_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_disk_snapshot( value: &[u8], mut builder: crate::output::get_disk_snapshot_output::Builder, ) -> Result<crate::output::get_disk_snapshot_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "diskSnapshot" => { builder = builder.set_disk_snapshot( crate::json_deser::deser_structure_crate_model_disk_snapshot(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_disk_snapshots( value: &[u8], mut builder: crate::output::get_disk_snapshots_output::Builder, ) -> Result<crate::output::get_disk_snapshots_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "diskSnapshots" => { builder = builder.set_disk_snapshots( crate::json_deser::deser_list_com_amazonaws_lightsail_disk_snapshot_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_distribution_bundles( value: &[u8], mut builder: crate::output::get_distribution_bundles_output::Builder, ) -> Result< crate::output::get_distribution_bundles_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bundles" => { builder = builder.set_bundles( crate::json_deser::deser_list_com_amazonaws_lightsail_distribution_bundle_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_distribution_latest_cache_reset( value: &[u8], mut builder: crate::output::get_distribution_latest_cache_reset_output::Builder, ) -> Result< crate::output::get_distribution_latest_cache_reset_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createTime" => { builder = builder.set_create_time( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_distribution_metric_data( value: &[u8], mut builder: crate::output::get_distribution_metric_data_output::Builder, ) -> Result< crate::output::get_distribution_metric_data_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "metricName" => { builder = builder.set_metric_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::DistributionMetricName::from(u.as_ref())) }) .transpose()?, ); } "metricData" => { builder = builder.set_metric_data( crate::json_deser::deser_list_com_amazonaws_lightsail_metric_datapoint_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_distributions( value: &[u8], mut builder: crate::output::get_distributions_output::Builder, ) -> Result<crate::output::get_distributions_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "distributions" => { builder = builder.set_distributions( crate::json_deser::deser_list_com_amazonaws_lightsail_distribution_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_domain( value: &[u8], mut builder: crate::output::get_domain_output::Builder, ) -> Result<crate::output::get_domain_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "domain" => { builder = builder.set_domain( crate::json_deser::deser_structure_crate_model_domain(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_domains( value: &[u8], mut builder: crate::output::get_domains_output::Builder, ) -> Result<crate::output::get_domains_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "domains" => { builder = builder.set_domains( crate::json_deser::deser_list_com_amazonaws_lightsail_domain_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_export_snapshot_records( value: &[u8], mut builder: crate::output::get_export_snapshot_records_output::Builder, ) -> Result< crate::output::get_export_snapshot_records_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "exportSnapshotRecords" => { builder = builder.set_export_snapshot_records( crate::json_deser::deser_list_com_amazonaws_lightsail_export_snapshot_record_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instance( value: &[u8], mut builder: crate::output::get_instance_output::Builder, ) -> Result<crate::output::get_instance_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "instance" => { builder = builder.set_instance( crate::json_deser::deser_structure_crate_model_instance(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instance_access_details( value: &[u8], mut builder: crate::output::get_instance_access_details_output::Builder, ) -> Result< crate::output::get_instance_access_details_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "accessDetails" => { builder = builder.set_access_details( crate::json_deser::deser_structure_crate_model_instance_access_details( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instance_metric_data( value: &[u8], mut builder: crate::output::get_instance_metric_data_output::Builder, ) -> Result< crate::output::get_instance_metric_data_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "metricName" => { builder = builder.set_metric_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::InstanceMetricName::from(u.as_ref())) }) .transpose()?, ); } "metricData" => { builder = builder.set_metric_data( crate::json_deser::deser_list_com_amazonaws_lightsail_metric_datapoint_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instance_port_states( value: &[u8], mut builder: crate::output::get_instance_port_states_output::Builder, ) -> Result< crate::output::get_instance_port_states_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "portStates" => { builder = builder.set_port_states( crate::json_deser::deser_list_com_amazonaws_lightsail_instance_port_state_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instances( value: &[u8], mut builder: crate::output::get_instances_output::Builder, ) -> Result<crate::output::get_instances_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "instances" => { builder = builder.set_instances( crate::json_deser::deser_list_com_amazonaws_lightsail_instance_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instance_snapshot( value: &[u8], mut builder: crate::output::get_instance_snapshot_output::Builder, ) -> Result<crate::output::get_instance_snapshot_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "instanceSnapshot" => { builder = builder.set_instance_snapshot( crate::json_deser::deser_structure_crate_model_instance_snapshot( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instance_snapshots( value: &[u8], mut builder: crate::output::get_instance_snapshots_output::Builder, ) -> Result< crate::output::get_instance_snapshots_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "instanceSnapshots" => { builder = builder.set_instance_snapshots( crate::json_deser::deser_list_com_amazonaws_lightsail_instance_snapshot_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_instance_state( value: &[u8], mut builder: crate::output::get_instance_state_output::Builder, ) -> Result<crate::output::get_instance_state_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "state" => { builder = builder.set_state( crate::json_deser::deser_structure_crate_model_instance_state(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_key_pair( value: &[u8], mut builder: crate::output::get_key_pair_output::Builder, ) -> Result<crate::output::get_key_pair_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "keyPair" => { builder = builder.set_key_pair( crate::json_deser::deser_structure_crate_model_key_pair(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_key_pairs( value: &[u8], mut builder: crate::output::get_key_pairs_output::Builder, ) -> Result<crate::output::get_key_pairs_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "keyPairs" => { builder = builder.set_key_pairs( crate::json_deser::deser_list_com_amazonaws_lightsail_key_pair_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_load_balancer( value: &[u8], mut builder: crate::output::get_load_balancer_output::Builder, ) -> Result<crate::output::get_load_balancer_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "loadBalancer" => { builder = builder.set_load_balancer( crate::json_deser::deser_structure_crate_model_load_balancer(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_load_balancer_metric_data( value: &[u8], mut builder: crate::output::get_load_balancer_metric_data_output::Builder, ) -> Result< crate::output::get_load_balancer_metric_data_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "metricName" => { builder = builder.set_metric_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::LoadBalancerMetricName::from(u.as_ref())) }) .transpose()?, ); } "metricData" => { builder = builder.set_metric_data( crate::json_deser::deser_list_com_amazonaws_lightsail_metric_datapoint_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_load_balancers( value: &[u8], mut builder: crate::output::get_load_balancers_output::Builder, ) -> Result<crate::output::get_load_balancers_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "loadBalancers" => { builder = builder.set_load_balancers( crate::json_deser::deser_list_com_amazonaws_lightsail_load_balancer_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_load_balancer_tls_certificates( value: &[u8], mut builder: crate::output::get_load_balancer_tls_certificates_output::Builder, ) -> Result< crate::output::get_load_balancer_tls_certificates_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "tlsCertificates" => { builder = builder.set_tls_certificates( crate::json_deser::deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_operation( value: &[u8], mut builder: crate::output::get_operation_output::Builder, ) -> Result<crate::output::get_operation_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_operations( value: &[u8], mut builder: crate::output::get_operations_output::Builder, ) -> Result<crate::output::get_operations_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_operations_for_resource( value: &[u8], mut builder: crate::output::get_operations_for_resource_output::Builder, ) -> Result< crate::output::get_operations_for_resource_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } "nextPageCount" => { builder = builder.set_next_page_count( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_regions( value: &[u8], mut builder: crate::output::get_regions_output::Builder, ) -> Result<crate::output::get_regions_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "regions" => { builder = builder.set_regions( crate::json_deser::deser_list_com_amazonaws_lightsail_region_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database( value: &[u8], mut builder: crate::output::get_relational_database_output::Builder, ) -> Result< crate::output::get_relational_database_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "relationalDatabase" => { builder = builder.set_relational_database( crate::json_deser::deser_structure_crate_model_relational_database( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_blueprints( value: &[u8], mut builder: crate::output::get_relational_database_blueprints_output::Builder, ) -> Result< crate::output::get_relational_database_blueprints_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "blueprints" => { builder = builder.set_blueprints( crate::json_deser::deser_list_com_amazonaws_lightsail_relational_database_blueprint_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_bundles( value: &[u8], mut builder: crate::output::get_relational_database_bundles_output::Builder, ) -> Result< crate::output::get_relational_database_bundles_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bundles" => { builder = builder.set_bundles( crate::json_deser::deser_list_com_amazonaws_lightsail_relational_database_bundle_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_events( value: &[u8], mut builder: crate::output::get_relational_database_events_output::Builder, ) -> Result< crate::output::get_relational_database_events_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "relationalDatabaseEvents" => { builder = builder.set_relational_database_events( crate::json_deser::deser_list_com_amazonaws_lightsail_relational_database_event_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_log_events( value: &[u8], mut builder: crate::output::get_relational_database_log_events_output::Builder, ) -> Result< crate::output::get_relational_database_log_events_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "resourceLogEvents" => { builder = builder.set_resource_log_events( crate::json_deser::deser_list_com_amazonaws_lightsail_log_event_list( tokens, )?, ); } "nextBackwardToken" => { builder = builder.set_next_backward_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "nextForwardToken" => { builder = builder.set_next_forward_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_log_streams( value: &[u8], mut builder: crate::output::get_relational_database_log_streams_output::Builder, ) -> Result< crate::output::get_relational_database_log_streams_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "logStreams" => { builder = builder.set_log_streams( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_master_user_password( value: &[u8], mut builder: crate::output::get_relational_database_master_user_password_output::Builder, ) -> Result< crate::output::get_relational_database_master_user_password_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "masterUserPassword" => { builder = builder.set_master_user_password( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_metric_data( value: &[u8], mut builder: crate::output::get_relational_database_metric_data_output::Builder, ) -> Result< crate::output::get_relational_database_metric_data_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "metricName" => { builder = builder.set_metric_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::RelationalDatabaseMetricName::from(u.as_ref()) }) }) .transpose()?, ); } "metricData" => { builder = builder.set_metric_data( crate::json_deser::deser_list_com_amazonaws_lightsail_metric_datapoint_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_parameters( value: &[u8], mut builder: crate::output::get_relational_database_parameters_output::Builder, ) -> Result< crate::output::get_relational_database_parameters_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "parameters" => { builder = builder.set_parameters( crate::json_deser::deser_list_com_amazonaws_lightsail_relational_database_parameter_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_databases( value: &[u8], mut builder: crate::output::get_relational_databases_output::Builder, ) -> Result< crate::output::get_relational_databases_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "relationalDatabases" => { builder = builder.set_relational_databases( crate::json_deser::deser_list_com_amazonaws_lightsail_relational_database_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_snapshot( value: &[u8], mut builder: crate::output::get_relational_database_snapshot_output::Builder, ) -> Result< crate::output::get_relational_database_snapshot_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "relationalDatabaseSnapshot" => { builder = builder.set_relational_database_snapshot( crate::json_deser::deser_structure_crate_model_relational_database_snapshot(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_relational_database_snapshots( value: &[u8], mut builder: crate::output::get_relational_database_snapshots_output::Builder, ) -> Result< crate::output::get_relational_database_snapshots_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "relationalDatabaseSnapshots" => { builder = builder.set_relational_database_snapshots( crate::json_deser::deser_list_com_amazonaws_lightsail_relational_database_snapshot_list(tokens)? ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_static_ip( value: &[u8], mut builder: crate::output::get_static_ip_output::Builder, ) -> Result<crate::output::get_static_ip_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "staticIp" => { builder = builder.set_static_ip( crate::json_deser::deser_structure_crate_model_static_ip(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_get_static_ips( value: &[u8], mut builder: crate::output::get_static_ips_output::Builder, ) -> Result<crate::output::get_static_ips_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "staticIps" => { builder = builder.set_static_ips( crate::json_deser::deser_list_com_amazonaws_lightsail_static_ip_list( tokens, )?, ); } "nextPageToken" => { builder = builder.set_next_page_token( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_import_key_pair( value: &[u8], mut builder: crate::output::import_key_pair_output::Builder, ) -> Result<crate::output::import_key_pair_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_is_vpc_peered( value: &[u8], mut builder: crate::output::is_vpc_peered_output::Builder, ) -> Result<crate::output::is_vpc_peered_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "isPeered" => { builder = builder.set_is_peered( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_open_instance_public_ports( value: &[u8], mut builder: crate::output::open_instance_public_ports_output::Builder, ) -> Result< crate::output::open_instance_public_ports_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_peer_vpc( value: &[u8], mut builder: crate::output::peer_vpc_output::Builder, ) -> Result<crate::output::peer_vpc_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_put_alarm( value: &[u8], mut builder: crate::output::put_alarm_output::Builder, ) -> Result<crate::output::put_alarm_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_put_instance_public_ports( value: &[u8], mut builder: crate::output::put_instance_public_ports_output::Builder, ) -> Result< crate::output::put_instance_public_ports_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_reboot_instance( value: &[u8], mut builder: crate::output::reboot_instance_output::Builder, ) -> Result<crate::output::reboot_instance_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_reboot_relational_database( value: &[u8], mut builder: crate::output::reboot_relational_database_output::Builder, ) -> Result< crate::output::reboot_relational_database_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_register_container_image( value: &[u8], mut builder: crate::output::register_container_image_output::Builder, ) -> Result< crate::output::register_container_image_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerImage" => { builder = builder.set_container_image( crate::json_deser::deser_structure_crate_model_container_image(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_release_static_ip( value: &[u8], mut builder: crate::output::release_static_ip_output::Builder, ) -> Result<crate::output::release_static_ip_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_reset_distribution_cache( value: &[u8], mut builder: crate::output::reset_distribution_cache_output::Builder, ) -> Result< crate::output::reset_distribution_cache_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createTime" => { builder = builder.set_create_time( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_send_contact_method_verification( value: &[u8], mut builder: crate::output::send_contact_method_verification_output::Builder, ) -> Result< crate::output::send_contact_method_verification_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_set_ip_address_type( value: &[u8], mut builder: crate::output::set_ip_address_type_output::Builder, ) -> Result<crate::output::set_ip_address_type_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_set_resource_access_for_bucket( value: &[u8], mut builder: crate::output::set_resource_access_for_bucket_output::Builder, ) -> Result< crate::output::set_resource_access_for_bucket_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_start_instance( value: &[u8], mut builder: crate::output::start_instance_output::Builder, ) -> Result<crate::output::start_instance_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_start_relational_database( value: &[u8], mut builder: crate::output::start_relational_database_output::Builder, ) -> Result< crate::output::start_relational_database_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_stop_instance( value: &[u8], mut builder: crate::output::stop_instance_output::Builder, ) -> Result<crate::output::stop_instance_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_stop_relational_database( value: &[u8], mut builder: crate::output::stop_relational_database_output::Builder, ) -> Result< crate::output::stop_relational_database_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_tag_resource( value: &[u8], mut builder: crate::output::tag_resource_output::Builder, ) -> Result<crate::output::tag_resource_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_test_alarm( value: &[u8], mut builder: crate::output::test_alarm_output::Builder, ) -> Result<crate::output::test_alarm_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_unpeer_vpc( value: &[u8], mut builder: crate::output::unpeer_vpc_output::Builder, ) -> Result<crate::output::unpeer_vpc_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_untag_resource( value: &[u8], mut builder: crate::output::untag_resource_output::Builder, ) -> Result<crate::output::untag_resource_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_bucket( value: &[u8], mut builder: crate::output::update_bucket_output::Builder, ) -> Result<crate::output::update_bucket_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bucket" => { builder = builder.set_bucket( crate::json_deser::deser_structure_crate_model_bucket(tokens)?, ); } "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_bucket_bundle( value: &[u8], mut builder: crate::output::update_bucket_bundle_output::Builder, ) -> Result<crate::output::update_bucket_bundle_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_container_service( value: &[u8], mut builder: crate::output::update_container_service_output::Builder, ) -> Result< crate::output::update_container_service_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerService" => { builder = builder.set_container_service( crate::json_deser::deser_structure_crate_model_container_service( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_distribution( value: &[u8], mut builder: crate::output::update_distribution_output::Builder, ) -> Result<crate::output::update_distribution_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_distribution_bundle( value: &[u8], mut builder: crate::output::update_distribution_bundle_output::Builder, ) -> Result< crate::output::update_distribution_bundle_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operation" => { builder = builder.set_operation( crate::json_deser::deser_structure_crate_model_operation(tokens)?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_domain_entry( value: &[u8], mut builder: crate::output::update_domain_entry_output::Builder, ) -> Result<crate::output::update_domain_entry_output::Builder, aws_smithy_json::deserialize::Error> { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_load_balancer_attribute( value: &[u8], mut builder: crate::output::update_load_balancer_attribute_output::Builder, ) -> Result< crate::output::update_load_balancer_attribute_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_relational_database( value: &[u8], mut builder: crate::output::update_relational_database_output::Builder, ) -> Result< crate::output::update_relational_database_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_crate_operation_update_relational_database_parameters( value: &[u8], mut builder: crate::output::update_relational_database_parameters_output::Builder, ) -> Result< crate::output::update_relational_database_parameters_output::Builder, aws_smithy_json::deserialize::Error, > { let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value)) .peekable(); let tokens = &mut tokens_owned; aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "operations" => { builder = builder.set_operations( crate::json_deser::deser_list_com_amazonaws_lightsail_operation_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } if tokens.next().is_some() { return Err(aws_smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn or_empty_doc(data: &[u8]) -> &[u8] { if data.is_empty() { b"{}" } else { data } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_operation_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Operation>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_operation(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_operation<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Operation>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Operation::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "id" => { builder = builder.set_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "resourceName" => { builder = builder.set_resource_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "isTerminal" => { builder = builder.set_is_terminal( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "operationDetails" => { builder = builder.set_operation_details( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "operationType" => { builder = builder.set_operation_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::OperationType::from(u.as_ref())) }) .transpose()?, ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::OperationStatus::from(u.as_ref()) }) }) .transpose()?, ); } "statusChangedAt" => { builder = builder.set_status_changed_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "errorCode" => { builder = builder.set_error_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "errorDetails" => { builder = builder.set_error_details( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_bucket<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Bucket>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Bucket::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "accessRules" => { builder = builder.set_access_rules( crate::json_deser::deser_structure_crate_model_access_rules( tokens, )?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "bundleId" => { builder = builder.set_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "url" => { builder = builder.set_url( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "objectVersioning" => { builder = builder.set_object_versioning( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ableToUpdateBundle" => { builder = builder.set_able_to_update_bundle( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "readonlyAccessAccounts" => { builder = builder.set_readonly_access_accounts( crate::json_deser::deser_list_com_amazonaws_lightsail_partner_id_list(tokens)? ); } "resourcesReceivingAccess" => { builder = builder.set_resources_receiving_access( crate::json_deser::deser_list_com_amazonaws_lightsail_access_receiver_list(tokens)? ); } "state" => { builder = builder.set_state( crate::json_deser::deser_structure_crate_model_bucket_state( tokens, )?, ); } "accessLogConfig" => { builder = builder.set_access_log_config( crate::json_deser::deser_structure_crate_model_bucket_access_log_config(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_access_key<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::AccessKey>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::AccessKey::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "accessKeyId" => { builder = builder.set_access_key_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "secretAccessKey" => { builder = builder.set_secret_access_key( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::StatusType::from(u.as_ref())) }) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "lastUsed" => { builder = builder.set_last_used( crate::json_deser::deser_structure_crate_model_access_key_last_used(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_certificate_summary<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::CertificateSummary>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::CertificateSummary::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "certificateArn" => { builder = builder.set_certificate_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "certificateName" => { builder = builder.set_certificate_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "domainName" => { builder = builder.set_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "certificateDetail" => { builder = builder.set_certificate_detail( crate::json_deser::deser_structure_crate_model_certificate( tokens, )?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerService>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerService::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerServiceName" => { builder = builder.set_container_service_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "power" => { builder = builder.set_power( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ContainerServicePowerName::from( u.as_ref(), ) }) }) .transpose()?, ); } "powerId" => { builder = builder.set_power_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ContainerServiceState::from(u.as_ref()) }) }) .transpose()?, ); } "stateDetail" => { builder = builder.set_state_detail( crate::json_deser::deser_structure_crate_model_container_service_state_detail(tokens)? ); } "scale" => { builder = builder.set_scale( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "currentDeployment" => { builder = builder.set_current_deployment( crate::json_deser::deser_structure_crate_model_container_service_deployment(tokens)? ); } "nextDeployment" => { builder = builder.set_next_deployment( crate::json_deser::deser_structure_crate_model_container_service_deployment(tokens)? ); } "isDisabled" => { builder = builder.set_is_disabled( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "principalArn" => { builder = builder.set_principal_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "privateDomainName" => { builder = builder.set_private_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "publicDomainNames" => { builder = builder.set_public_domain_names( crate::json_deser::deser_map_com_amazonaws_lightsail_container_service_public_domains(tokens)? ); } "url" => { builder = builder.set_url( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service_registry_login<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerServiceRegistryLogin>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerServiceRegistryLogin::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "username" => { builder = builder.set_username( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "password" => { builder = builder.set_password( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "expiresAt" => { builder = builder.set_expires_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "registry" => { builder = builder.set_registry( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_lightsail_distribution<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::LightsailDistribution>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LightsailDistribution::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "alternativeDomainNames" => { builder = builder.set_alternative_domain_names( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isEnabled" => { builder = builder.set_is_enabled( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "domainName" => { builder = builder.set_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "bundleId" => { builder = builder.set_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "certificateName" => { builder = builder.set_certificate_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "origin" => { builder = builder.set_origin( crate::json_deser::deser_structure_crate_model_origin(tokens)?, ); } "originPublicDNS" => { builder = builder.set_origin_public_dns( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "defaultCacheBehavior" => { builder = builder.set_default_cache_behavior( crate::json_deser::deser_structure_crate_model_cache_behavior( tokens, )?, ); } "cacheBehaviorSettings" => { builder = builder.set_cache_behavior_settings( crate::json_deser::deser_structure_crate_model_cache_settings( tokens, )?, ); } "cacheBehaviors" => { builder = builder.set_cache_behaviors( crate::json_deser::deser_list_com_amazonaws_lightsail_cache_behavior_list(tokens)? ); } "ableToUpdateBundle" => { builder = builder.set_able_to_update_bundle( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "ipAddressType" => { builder = builder.set_ip_address_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::IpAddressType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_key_pair<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::KeyPair>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::KeyPair::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "fingerprint" => { builder = builder.set_fingerprint( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_string_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<std::string::String>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_alarms_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Alarm>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_alarm(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_auto_snapshot_details_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::AutoSnapshotDetails>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_auto_snapshot_details( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_blueprint_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Blueprint>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_blueprint(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_access_key_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::AccessKey>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_access_key(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_bucket_bundle_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::BucketBundle>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_bucket_bundle(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_metric_datapoint_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::MetricDatapoint>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_metric_datapoint( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_bucket_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Bucket>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_bucket(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_bundle_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Bundle>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_bundle(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_certificate_summary_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::CertificateSummary>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_certificate_summary( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_cloud_formation_stack_record_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::CloudFormationStackRecord>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_cloud_formation_stack_record(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_contact_methods_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::ContactMethod>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_contact_method(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_container_service_metadata_entry_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<std::collections::HashMap<std::string::String, std::string::String>>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_map_com_amazonaws_lightsail_container_service_metadata_entry(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_container_image_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::ContainerImage>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_container_image(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_container_service_log_event_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::ContainerServiceLogEvent>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_container_service_log_event(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_container_service_deployment_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::ContainerServiceDeployment>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_container_service_deployment(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_container_service_power_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::ContainerServicePower>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_container_service_power( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_container_service_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::ContainerService>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_container_service( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_disk<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Disk>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Disk::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "addOns" => { builder = builder.set_add_ons( crate::json_deser::deser_list_com_amazonaws_lightsail_add_on_list(tokens)? ); } "sizeInGb" => { builder = builder.set_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "isSystemDisk" => { builder = builder.set_is_system_disk( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "iops" => { builder = builder.set_iops( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "path" => { builder = builder.set_path( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::DiskState::from(u.as_ref())) }) .transpose()?, ); } "attachedTo" => { builder = builder.set_attached_to( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isAttached" => { builder = builder.set_is_attached( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "attachmentState" => { builder = builder.set_attachment_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "gbInUse" => { builder = builder.set_gb_in_use( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_disk_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Disk>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_disk(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_disk_snapshot<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::DiskSnapshot>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::DiskSnapshot::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "sizeInGb" => { builder = builder.set_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::DiskSnapshotState::from(u.as_ref()) }) }) .transpose()?, ); } "progress" => { builder = builder.set_progress( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromDiskName" => { builder = builder.set_from_disk_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromDiskArn" => { builder = builder.set_from_disk_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromInstanceName" => { builder = builder.set_from_instance_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromInstanceArn" => { builder = builder.set_from_instance_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isFromAutoSnapshot" => { builder = builder.set_is_from_auto_snapshot( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_disk_snapshot_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::DiskSnapshot>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_disk_snapshot(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_distribution_bundle_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::DistributionBundle>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_distribution_bundle( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_distribution_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::LightsailDistribution>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_lightsail_distribution( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_domain<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Domain>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Domain::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "domainEntries" => { builder = builder.set_domain_entries( crate::json_deser::deser_list_com_amazonaws_lightsail_domain_entry_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_domain_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Domain>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_domain(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_export_snapshot_record_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::ExportSnapshotRecord>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_export_snapshot_record( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_instance<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Instance>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Instance::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "blueprintId" => { builder = builder.set_blueprint_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "blueprintName" => { builder = builder.set_blueprint_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "bundleId" => { builder = builder.set_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "addOns" => { builder = builder.set_add_ons( crate::json_deser::deser_list_com_amazonaws_lightsail_add_on_list(tokens)? ); } "isStaticIp" => { builder = builder.set_is_static_ip( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "privateIpAddress" => { builder = builder.set_private_ip_address( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "publicIpAddress" => { builder = builder.set_public_ip_address( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ipv6Addresses" => { builder = builder.set_ipv6_addresses( crate::json_deser::deser_list_com_amazonaws_lightsail_ipv6_address_list(tokens)? ); } "ipAddressType" => { builder = builder.set_ip_address_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::IpAddressType::from(u.as_ref())) }) .transpose()?, ); } "hardware" => { builder = builder.set_hardware( crate::json_deser::deser_structure_crate_model_instance_hardware(tokens)? ); } "networking" => { builder = builder.set_networking( crate::json_deser::deser_structure_crate_model_instance_networking(tokens)? ); } "state" => { builder = builder.set_state( crate::json_deser::deser_structure_crate_model_instance_state( tokens, )?, ); } "username" => { builder = builder.set_username( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "sshKeyName" => { builder = builder.set_ssh_key_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_instance_access_details<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstanceAccessDetails>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstanceAccessDetails::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "certKey" => { builder = builder.set_cert_key( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "expiresAt" => { builder = builder.set_expires_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "ipAddress" => { builder = builder.set_ip_address( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "password" => { builder = builder.set_password( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "passwordData" => { builder = builder.set_password_data( crate::json_deser::deser_structure_crate_model_password_data( tokens, )?, ); } "privateKey" => { builder = builder.set_private_key( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "protocol" => { builder = builder.set_protocol( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::InstanceAccessProtocol::from(u.as_ref()) }) }) .transpose()?, ); } "instanceName" => { builder = builder.set_instance_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "username" => { builder = builder.set_username( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "hostKeys" => { builder = builder.set_host_keys( crate::json_deser::deser_list_com_amazonaws_lightsail_host_keys_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_instance_port_state_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::InstancePortState>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_instance_port_state( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_instance_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Instance>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_instance(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_instance_snapshot<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstanceSnapshot>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstanceSnapshot::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::InstanceSnapshotState::from(u.as_ref()) }) }) .transpose()?, ); } "progress" => { builder = builder.set_progress( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromAttachedDisks" => { builder = builder.set_from_attached_disks( crate::json_deser::deser_list_com_amazonaws_lightsail_disk_list(tokens)? ); } "fromInstanceName" => { builder = builder.set_from_instance_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromInstanceArn" => { builder = builder.set_from_instance_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromBlueprintId" => { builder = builder.set_from_blueprint_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromBundleId" => { builder = builder.set_from_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isFromAutoSnapshot" => { builder = builder.set_is_from_auto_snapshot( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "sizeInGb" => { builder = builder.set_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_instance_snapshot_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::InstanceSnapshot>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_instance_snapshot( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_instance_state<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstanceState>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstanceState::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_key_pair_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::KeyPair>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_key_pair(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_load_balancer<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::LoadBalancer>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LoadBalancer::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "dnsName" => { builder = builder.set_dns_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::LoadBalancerState::from(u.as_ref()) }) }) .transpose()?, ); } "protocol" => { builder = builder.set_protocol( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::LoadBalancerProtocol::from(u.as_ref()) }) }) .transpose()?, ); } "publicPorts" => { builder = builder.set_public_ports( crate::json_deser::deser_list_com_amazonaws_lightsail_port_list(tokens)? ); } "healthCheckPath" => { builder = builder.set_health_check_path( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "instancePort" => { builder = builder.set_instance_port( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "instanceHealthSummary" => { builder = builder.set_instance_health_summary( crate::json_deser::deser_list_com_amazonaws_lightsail_instance_health_summary_list(tokens)? ); } "tlsCertificateSummaries" => { builder = builder.set_tls_certificate_summaries( crate::json_deser::deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_summary_list(tokens)? ); } "configurationOptions" => { builder = builder.set_configuration_options( crate::json_deser::deser_map_com_amazonaws_lightsail_load_balancer_configuration_options(tokens)? ); } "ipAddressType" => { builder = builder.set_ip_address_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::IpAddressType::from(u.as_ref())) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_load_balancer_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::LoadBalancer>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_load_balancer(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::LoadBalancerTlsCertificate>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_load_balancer_tls_certificate(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_region_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Region>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_region(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_relational_database<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabase>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabase::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "relationalDatabaseBlueprintId" => { builder = builder.set_relational_database_blueprint_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "relationalDatabaseBundleId" => { builder = builder.set_relational_database_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "masterDatabaseName" => { builder = builder.set_master_database_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "hardware" => { builder = builder.set_hardware( crate::json_deser::deser_structure_crate_model_relational_database_hardware(tokens)? ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "secondaryAvailabilityZone" => { builder = builder.set_secondary_availability_zone( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "backupRetentionEnabled" => { builder = builder.set_backup_retention_enabled( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "pendingModifiedValues" => { builder = builder.set_pending_modified_values( crate::json_deser::deser_structure_crate_model_pending_modified_relational_database_values(tokens)? ); } "engine" => { builder = builder.set_engine( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "engineVersion" => { builder = builder.set_engine_version( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "latestRestorableTime" => { builder = builder.set_latest_restorable_time( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "masterUsername" => { builder = builder.set_master_username( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "parameterApplyStatus" => { builder = builder.set_parameter_apply_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "preferredBackupWindow" => { builder = builder.set_preferred_backup_window( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "preferredMaintenanceWindow" => { builder = builder.set_preferred_maintenance_window( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "publiclyAccessible" => { builder = builder.set_publicly_accessible( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "masterEndpoint" => { builder = builder.set_master_endpoint( crate::json_deser::deser_structure_crate_model_relational_database_endpoint(tokens)? ); } "pendingMaintenanceActions" => { builder = builder.set_pending_maintenance_actions( crate::json_deser::deser_list_com_amazonaws_lightsail_pending_maintenance_action_list(tokens)? ); } "caCertificateIdentifier" => { builder = builder.set_ca_certificate_identifier( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_relational_database_blueprint_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::RelationalDatabaseBlueprint>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_relational_database_blueprint(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_relational_database_bundle_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::RelationalDatabaseBundle>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_relational_database_bundle(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_relational_database_event_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::RelationalDatabaseEvent>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_relational_database_event(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_log_event_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::LogEvent>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_log_event(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_relational_database_parameter_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::RelationalDatabaseParameter>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_relational_database_parameter(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_relational_database_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::RelationalDatabase>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_relational_database( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_relational_database_snapshot<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabaseSnapshot>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabaseSnapshot::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "engine" => { builder = builder.set_engine( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "engineVersion" => { builder = builder.set_engine_version( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "sizeInGb" => { builder = builder.set_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromRelationalDatabaseName" => { builder = builder.set_from_relational_database_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromRelationalDatabaseArn" => { builder = builder.set_from_relational_database_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromRelationalDatabaseBundleId" => { builder = builder.set_from_relational_database_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromRelationalDatabaseBlueprintId" => { builder = builder.set_from_relational_database_blueprint_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_relational_database_snapshot_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::RelationalDatabaseSnapshot>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_relational_database_snapshot(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_static_ip<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::StaticIp>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::StaticIp::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "ipAddress" => { builder = builder.set_ip_address( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "attachedTo" => { builder = builder.set_attached_to( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isAttached" => { builder = builder.set_is_attached( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_static_ip_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::StaticIp>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_static_ip(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_container_image<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerImage>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerImage::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "image" => { builder = builder.set_image( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "digest" => { builder = builder.set_digest( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_resource_location<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ResourceLocation>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ResourceLocation::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "availabilityZone" => { builder = builder.set_availability_zone( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "regionName" => { builder = builder.set_region_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::RegionName::from(u.as_ref())) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_access_rules<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::AccessRules>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::AccessRules::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "getObject" => { builder = builder.set_get_object( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::AccessType::from(u.as_ref())) }) .transpose()?, ); } "allowPublicOverrides" => { builder = builder.set_allow_public_overrides( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_tag_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Tag>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_tag(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_partner_id_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<std::string::String>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_access_receiver_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::ResourceReceivingAccess>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_resource_receiving_access(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_bucket_state<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::BucketState>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::BucketState::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_bucket_access_log_config<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::BucketAccessLogConfig>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::BucketAccessLogConfig::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "enabled" => { builder = builder.set_enabled( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "destination" => { builder = builder.set_destination( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "prefix" => { builder = builder.set_prefix( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_access_key_last_used<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::AccessKeyLastUsed>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::AccessKeyLastUsed::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "lastUsedDate" => { builder = builder.set_last_used_date( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "region" => { builder = builder.set_region( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "serviceName" => { builder = builder.set_service_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_certificate<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Certificate>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Certificate::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "domainName" => { builder = builder.set_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::CertificateStatus::from(u.as_ref()) }) }) .transpose()?, ); } "serialNumber" => { builder = builder.set_serial_number( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "subjectAlternativeNames" => { builder = builder.set_subject_alternative_names( crate::json_deser::deser_list_com_amazonaws_lightsail_subject_alternative_name_list(tokens)? ); } "domainValidationRecords" => { builder = builder.set_domain_validation_records( crate::json_deser::deser_list_com_amazonaws_lightsail_domain_validation_record_list(tokens)? ); } "requestFailureReason" => { builder = builder.set_request_failure_reason( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "inUseResourceCount" => { builder = builder.set_in_use_resource_count( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "keyAlgorithm" => { builder = builder.set_key_algorithm( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "issuedAt" => { builder = builder.set_issued_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "issuerCA" => { builder = builder.set_issuer_ca( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "notBefore" => { builder = builder.set_not_before( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "notAfter" => { builder = builder.set_not_after( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "eligibleToRenew" => { builder = builder.set_eligible_to_renew( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "renewalSummary" => { builder = builder.set_renewal_summary( crate::json_deser::deser_structure_crate_model_renewal_summary( tokens, )?, ); } "revokedAt" => { builder = builder.set_revoked_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "revocationReason" => { builder = builder.set_revocation_reason( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service_state_detail<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerServiceStateDetail>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerServiceStateDetail::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "code" => { builder = builder.set_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ContainerServiceStateDetailCode::from( u.as_ref(), ) }) }) .transpose()?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service_deployment<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerServiceDeployment>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerServiceDeployment::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "version" => { builder = builder.set_version( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ContainerServiceDeploymentState::from( u.as_ref(), ) }) }) .transpose()?, ); } "containers" => { builder = builder.set_containers( crate::json_deser::deser_map_com_amazonaws_lightsail_container_map(tokens)? ); } "publicEndpoint" => { builder = builder.set_public_endpoint( crate::json_deser::deser_structure_crate_model_container_service_endpoint(tokens)? ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_map_com_amazonaws_lightsail_container_service_public_domains<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { let mut map = std::collections::HashMap::new(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { let key = key.to_unescaped().map(|u| u.into_owned())?; let value = crate::json_deser::deser_list_com_amazonaws_lightsail_container_service_public_domains_list(tokens)? ; if let Some(value) = value { map.insert(key, value); } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(map)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_origin<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Origin>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Origin::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "regionName" => { builder = builder.set_region_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::RegionName::from(u.as_ref())) }) .transpose()?, ); } "protocolPolicy" => { builder = builder.set_protocol_policy( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::OriginProtocolPolicyEnum::from(u.as_ref()) }) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_cache_behavior<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::CacheBehavior>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::CacheBehavior::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "behavior" => { builder = builder.set_behavior( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::BehaviorEnum::from(u.as_ref())) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_cache_settings<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::CacheSettings>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::CacheSettings::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "defaultTTL" => { builder = builder.set_default_ttl( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i64()), ); } "minimumTTL" => { builder = builder.set_minimum_ttl( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i64()), ); } "maximumTTL" => { builder = builder.set_maximum_ttl( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i64()), ); } "allowedHTTPMethods" => { builder = builder.set_allowed_http_methods( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "cachedHTTPMethods" => { builder = builder.set_cached_http_methods( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "forwardedCookies" => { builder = builder.set_forwarded_cookies( crate::json_deser::deser_structure_crate_model_cookie_object( tokens, )?, ); } "forwardedHeaders" => { builder = builder.set_forwarded_headers( crate::json_deser::deser_structure_crate_model_header_object( tokens, )?, ); } "forwardedQueryStrings" => { builder = builder.set_forwarded_query_strings( crate::json_deser::deser_structure_crate_model_query_string_object(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_cache_behavior_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::CacheBehaviorPerPath>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_cache_behavior_per_path( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_alarm<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Alarm>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Alarm::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "monitoredResourceInfo" => { builder = builder.set_monitored_resource_info(
); } "comparisonOperator" => { builder = builder.set_comparison_operator( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ComparisonOperator::from(u.as_ref()) }) }) .transpose()?, ); } "evaluationPeriods" => { builder = builder.set_evaluation_periods( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "period" => { builder = builder.set_period( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "threshold" => { builder = builder.set_threshold( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f64()), ); } "datapointsToAlarm" => { builder = builder.set_datapoints_to_alarm( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "treatMissingData" => { builder = builder.set_treat_missing_data( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::TreatMissingData::from(u.as_ref()) }) }) .transpose()?, ); } "statistic" => { builder = builder.set_statistic( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::MetricStatistic::from(u.as_ref()) }) }) .transpose()?, ); } "metricName" => { builder = builder.set_metric_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::MetricName::from(u.as_ref())) }) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::AlarmState::from(u.as_ref())) }) .transpose()?, ); } "unit" => { builder = builder.set_unit( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::MetricUnit::from(u.as_ref())) }) .transpose()?, ); } "contactProtocols" => { builder = builder.set_contact_protocols( crate::json_deser::deser_list_com_amazonaws_lightsail_contact_protocols_list(tokens)? ); } "notificationTriggers" => { builder = builder.set_notification_triggers( crate::json_deser::deser_list_com_amazonaws_lightsail_notification_trigger_list(tokens)? ); } "notificationEnabled" => { builder = builder.set_notification_enabled( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_auto_snapshot_details<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::AutoSnapshotDetails>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::AutoSnapshotDetails::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "date" => { builder = builder.set_date( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::AutoSnapshotStatus::from(u.as_ref()) }) }) .transpose()?, ); } "fromAttachedDisks" => { builder = builder.set_from_attached_disks( crate::json_deser::deser_list_com_amazonaws_lightsail_attached_disk_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_blueprint<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Blueprint>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Blueprint::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "blueprintId" => { builder = builder.set_blueprint_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "group" => { builder = builder.set_group( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "type" => { builder = builder.set_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::BlueprintType::from(u.as_ref())) }) .transpose()?, ); } "description" => { builder = builder.set_description( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isActive" => { builder = builder.set_is_active( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "minPower" => { builder = builder.set_min_power( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "version" => { builder = builder.set_version( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "versionCode" => { builder = builder.set_version_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "productUrl" => { builder = builder.set_product_url( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "licenseUrl" => { builder = builder.set_license_url( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "platform" => { builder = builder.set_platform( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::InstancePlatform::from(u.as_ref()) }) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_bucket_bundle<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::BucketBundle>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::BucketBundle::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bundleId" => { builder = builder.set_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "price" => { builder = builder.set_price( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "storagePerMonthInGb" => { builder = builder.set_storage_per_month_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "transferPerMonthInGb" => { builder = builder.set_transfer_per_month_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "isActive" => { builder = builder.set_is_active( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_metric_datapoint<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::MetricDatapoint>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::MetricDatapoint::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "average" => { builder = builder.set_average( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f64()), ); } "maximum" => { builder = builder.set_maximum( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f64()), ); } "minimum" => { builder = builder.set_minimum( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f64()), ); } "sampleCount" => { builder = builder.set_sample_count( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f64()), ); } "sum" => { builder = builder.set_sum( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f64()), ); } "timestamp" => { builder = builder.set_timestamp( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "unit" => { builder = builder.set_unit( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::MetricUnit::from(u.as_ref())) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_bundle<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Bundle>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Bundle::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "price" => { builder = builder.set_price( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "cpuCount" => { builder = builder.set_cpu_count( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "diskSizeInGb" => { builder = builder.set_disk_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "bundleId" => { builder = builder.set_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "instanceType" => { builder = builder.set_instance_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isActive" => { builder = builder.set_is_active( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "power" => { builder = builder.set_power( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "ramSizeInGb" => { builder = builder.set_ram_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "transferPerMonthInGb" => { builder = builder.set_transfer_per_month_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "supportedPlatforms" => { builder = builder.set_supported_platforms( crate::json_deser::deser_list_com_amazonaws_lightsail_instance_platform_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_cloud_formation_stack_record<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::CloudFormationStackRecord>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::CloudFormationStackRecord::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::RecordState::from(u.as_ref())) }) .transpose()?, ); } "sourceInfo" => { builder = builder.set_source_info( crate::json_deser::deser_list_com_amazonaws_lightsail_cloud_formation_stack_record_source_info_list(tokens)? ); } "destinationInfo" => { builder = builder.set_destination_info( crate::json_deser::deser_structure_crate_model_destination_info(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_contact_method<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContactMethod>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContactMethod::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "contactEndpoint" => { builder = builder.set_contact_endpoint( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ContactMethodStatus::from(u.as_ref()) }) }) .transpose()?, ); } "protocol" => { builder = builder.set_protocol( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ContactProtocol::from(u.as_ref()) }) }) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_map_com_amazonaws_lightsail_container_service_metadata_entry<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::collections::HashMap<std::string::String, std::string::String>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { let mut map = std::collections::HashMap::new(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { let key = key.to_unescaped().map(|u| u.into_owned())?; let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { map.insert(key, value); } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(map)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service_log_event<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerServiceLogEvent>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerServiceLogEvent::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service_power<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerServicePower>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerServicePower::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "powerId" => { builder = builder.set_power_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "price" => { builder = builder.set_price( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "cpuCount" => { builder = builder.set_cpu_count( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "ramSizeInGb" => { builder = builder.set_ram_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isActive" => { builder = builder.set_is_active( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_add_on_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::AddOn>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_add_on(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_distribution_bundle<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::DistributionBundle>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::DistributionBundle::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bundleId" => { builder = builder.set_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "price" => { builder = builder.set_price( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "transferPerMonthInGb" => { builder = builder.set_transfer_per_month_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "isActive" => { builder = builder.set_is_active( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_domain_entry_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::DomainEntry>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_domain_entry(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_export_snapshot_record<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ExportSnapshotRecord>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ExportSnapshotRecord::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::RecordState::from(u.as_ref())) }) .transpose()?, ); } "sourceInfo" => { builder = builder.set_source_info( crate::json_deser::deser_structure_crate_model_export_snapshot_record_source_info(tokens)? ); } "destinationInfo" => { builder = builder.set_destination_info( crate::json_deser::deser_structure_crate_model_destination_info(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_ipv6_address_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<std::string::String>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_instance_hardware<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstanceHardware>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstanceHardware::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "cpuCount" => { builder = builder.set_cpu_count( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "disks" => { builder = builder.set_disks( crate::json_deser::deser_list_com_amazonaws_lightsail_disk_list(tokens)? ); } "ramSizeInGb" => { builder = builder.set_ram_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_instance_networking<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstanceNetworking>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstanceNetworking::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "monthlyTransfer" => { builder = builder.set_monthly_transfer( crate::json_deser::deser_structure_crate_model_monthly_transfer(tokens)? ); } "ports" => { builder = builder.set_ports( crate::json_deser::deser_list_com_amazonaws_lightsail_instance_port_info_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_password_data<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::PasswordData>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::PasswordData::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ciphertext" => { builder = builder.set_ciphertext( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "keyPairName" => { builder = builder.set_key_pair_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_host_keys_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::HostKeyAttributes>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_host_key_attributes( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_instance_port_state<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstancePortState>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstancePortState::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "fromPort" => { builder = builder.set_from_port( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "toPort" => { builder = builder.set_to_port( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "protocol" => { builder = builder.set_protocol( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::NetworkProtocol::from(u.as_ref()) }) }) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::PortState::from(u.as_ref())) }) .transpose()?, ); } "cidrs" => { builder = builder.set_cidrs( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } "ipv6Cidrs" => { builder = builder.set_ipv6_cidrs( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } "cidrListAliases" => { builder = builder.set_cidr_list_aliases( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_port_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<i32>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()); if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_instance_health_summary_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::InstanceHealthSummary>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_instance_health_summary( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_summary_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::LoadBalancerTlsCertificateSummary>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_load_balancer_tls_certificate_summary(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_map_com_amazonaws_lightsail_load_balancer_configuration_options<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::collections::HashMap<crate::model::LoadBalancerAttributeName, std::string::String>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { let mut map = std::collections::HashMap::new(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { let key = key .to_unescaped() .map(|u| crate::model::LoadBalancerAttributeName::from(u.as_ref()))?; let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { map.insert(key, value); } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(map)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_load_balancer_tls_certificate<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::LoadBalancerTlsCertificate>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LoadBalancerTlsCertificate::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "supportCode" => { builder = builder.set_support_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "location" => { builder = builder.set_location( crate::json_deser::deser_structure_crate_model_resource_location(tokens)? ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } "tags" => { builder = builder.set_tags( crate::json_deser::deser_list_com_amazonaws_lightsail_tag_list( tokens, )?, ); } "loadBalancerName" => { builder = builder.set_load_balancer_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isAttached" => { builder = builder.set_is_attached( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::LoadBalancerTlsCertificateStatus::from( u.as_ref(), ) }) }) .transpose()?, ); } "domainName" => { builder = builder.set_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "domainValidationRecords" => { builder = builder.set_domain_validation_records( crate::json_deser::deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_domain_validation_record_list(tokens)? ); } "failureReason" => { builder = builder.set_failure_reason( aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s| s.to_unescaped().map(|u| crate::model::LoadBalancerTlsCertificateFailureReason::from(u.as_ref()) ) ).transpose()? ); } "issuedAt" => { builder = builder.set_issued_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "issuer" => { builder = builder.set_issuer( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "keyAlgorithm" => { builder = builder.set_key_algorithm( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "notAfter" => { builder = builder.set_not_after( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "notBefore" => { builder = builder.set_not_before( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "renewalSummary" => { builder = builder.set_renewal_summary( crate::json_deser::deser_structure_crate_model_load_balancer_tls_certificate_renewal_summary(tokens)? ); } "revocationReason" => { builder = builder.set_revocation_reason( aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s| s.to_unescaped().map(|u| crate::model::LoadBalancerTlsCertificateRevocationReason::from(u.as_ref()) ) ).transpose()? ); } "revokedAt" => { builder = builder.set_revoked_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "serial" => { builder = builder.set_serial( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "signatureAlgorithm" => { builder = builder.set_signature_algorithm( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "subject" => { builder = builder.set_subject( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "subjectAlternativeNames" => { builder = builder.set_subject_alternative_names( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_region<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Region>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Region::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "continentCode" => { builder = builder.set_continent_code( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "description" => { builder = builder.set_description( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "displayName" => { builder = builder.set_display_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::RegionName::from(u.as_ref())) }) .transpose()?, ); } "availabilityZones" => { builder = builder.set_availability_zones( crate::json_deser::deser_list_com_amazonaws_lightsail_availability_zone_list(tokens)? ); } "relationalDatabaseAvailabilityZones" => { builder = builder.set_relational_database_availability_zones( crate::json_deser::deser_list_com_amazonaws_lightsail_availability_zone_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_relational_database_hardware<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabaseHardware>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabaseHardware::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "cpuCount" => { builder = builder.set_cpu_count( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "diskSizeInGb" => { builder = builder.set_disk_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "ramSizeInGb" => { builder = builder.set_ram_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_pending_modified_relational_database_values<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::PendingModifiedRelationalDatabaseValues>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::PendingModifiedRelationalDatabaseValues::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "masterUserPassword" => { builder = builder.set_master_user_password( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "engineVersion" => { builder = builder.set_engine_version( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "backupRetentionEnabled" => { builder = builder.set_backup_retention_enabled( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_relational_database_endpoint<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabaseEndpoint>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabaseEndpoint::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "port" => { builder = builder.set_port( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "address" => { builder = builder.set_address( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_pending_maintenance_action_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::PendingMaintenanceAction>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_pending_maintenance_action(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_relational_database_blueprint<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabaseBlueprint>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabaseBlueprint::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "blueprintId" => { builder = builder.set_blueprint_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "engine" => { builder = builder.set_engine( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::RelationalDatabaseEngine::from(u.as_ref()) }) }) .transpose()?, ); } "engineVersion" => { builder = builder.set_engine_version( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "engineDescription" => { builder = builder.set_engine_description( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "engineVersionDescription" => { builder = builder.set_engine_version_description( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isEngineDefault" => { builder = builder.set_is_engine_default( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_relational_database_bundle<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabaseBundle>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabaseBundle::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "bundleId" => { builder = builder.set_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "price" => { builder = builder.set_price( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "ramSizeInGb" => { builder = builder.set_ram_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "diskSizeInGb" => { builder = builder.set_disk_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "transferPerMonthInGb" => { builder = builder.set_transfer_per_month_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "cpuCount" => { builder = builder.set_cpu_count( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "isEncrypted" => { builder = builder.set_is_encrypted( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "isActive" => { builder = builder.set_is_active( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_relational_database_event<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabaseEvent>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabaseEvent::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "resource" => { builder = builder.set_resource( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "eventCategories" => { builder = builder.set_event_categories( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_log_event<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::LogEvent>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LogEvent::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "message" => { builder = builder.set_message( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_relational_database_parameter<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RelationalDatabaseParameter>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RelationalDatabaseParameter::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "allowedValues" => { builder = builder.set_allowed_values( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "applyMethod" => { builder = builder.set_apply_method( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "applyType" => { builder = builder.set_apply_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "dataType" => { builder = builder.set_data_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "description" => { builder = builder.set_description( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isModifiable" => { builder = builder.set_is_modifiable( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "parameterName" => { builder = builder.set_parameter_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "parameterValue" => { builder = builder.set_parameter_value( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_tag<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Tag>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Tag::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "key" => { builder = builder.set_key( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "value" => { builder = builder.set_value( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_resource_receiving_access<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ResourceReceivingAccess>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ResourceReceivingAccess::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_subject_alternative_name_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<std::string::String>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_domain_validation_record_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::DomainValidationRecord>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_domain_validation_record(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_renewal_summary<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RenewalSummary>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RenewalSummary::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "domainValidationRecords" => { builder = builder.set_domain_validation_records( crate::json_deser::deser_list_com_amazonaws_lightsail_domain_validation_record_list(tokens)? ); } "renewalStatus" => { builder = builder.set_renewal_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::RenewalStatus::from(u.as_ref())) }) .transpose()?, ); } "renewalStatusReason" => { builder = builder.set_renewal_status_reason( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "updatedAt" => { builder = builder.set_updated_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_map_com_amazonaws_lightsail_container_map<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::collections::HashMap<std::string::String, crate::model::Container>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { let mut map = std::collections::HashMap::new(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { let key = key.to_unescaped().map(|u| u.into_owned())?; let value = crate::json_deser::deser_structure_crate_model_container(tokens)?; if let Some(value) = value { map.insert(key, value); } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(map)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service_endpoint<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ContainerServiceEndpoint>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerServiceEndpoint::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "containerName" => { builder = builder.set_container_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "containerPort" => { builder = builder.set_container_port( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "healthCheck" => { builder = builder.set_health_check( crate::json_deser::deser_structure_crate_model_container_service_health_check_config(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_container_service_public_domains_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<std::string::String>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_cookie_object<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::CookieObject>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::CookieObject::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "option" => { builder = builder.set_option( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ForwardValues::from(u.as_ref())) }) .transpose()?, ); } "cookiesAllowList" => { builder = builder.set_cookies_allow_list( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_header_object<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::HeaderObject>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::HeaderObject::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "option" => { builder = builder.set_option( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ForwardValues::from(u.as_ref())) }) .transpose()?, ); } "headersAllowList" => { builder = builder.set_headers_allow_list( crate::json_deser::deser_list_com_amazonaws_lightsail_header_forward_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_query_string_object<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::QueryStringObject>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::QueryStringObject::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "option" => { builder = builder.set_option( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "queryStringsAllowList" => { builder = builder.set_query_strings_allow_list( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_cache_behavior_per_path<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::CacheBehaviorPerPath>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::CacheBehaviorPerPath::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "path" => { builder = builder.set_path( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "behavior" => { builder = builder.set_behavior( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::BehaviorEnum::from(u.as_ref())) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_monitored_resource_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::MonitoredResourceInfo>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::MonitoredResourceInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ResourceType::from(u.as_ref())) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_contact_protocols_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::ContactProtocol>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ContactProtocol::from(u.as_ref())) }) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_notification_trigger_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::AlarmState>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::AlarmState::from(u.as_ref())) }) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_attached_disk_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::AttachedDisk>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_attached_disk(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_instance_platform_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::InstancePlatform>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::InstancePlatform::from(u.as_ref())) }) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_cloud_formation_stack_record_source_info_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::CloudFormationStackRecordSourceInfo>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_cloud_formation_stack_record_source_info(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_destination_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::DestinationInfo>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::DestinationInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "id" => { builder = builder.set_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "service" => { builder = builder.set_service( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_add_on<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::AddOn>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::AddOn::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "status" => { builder = builder.set_status( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "snapshotTimeOfDay" => { builder = builder.set_snapshot_time_of_day( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "nextSnapshotTimeOfDay" => { builder = builder.set_next_snapshot_time_of_day( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_domain_entry<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::DomainEntry>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::DomainEntry::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "id" => { builder = builder.set_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "target" => { builder = builder.set_target( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isAlias" => { builder = builder.set_is_alias( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } "type" => { builder = builder.set_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "options" => { builder = builder.set_options( crate::json_deser::deser_map_com_amazonaws_lightsail_domain_entry_options(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_export_snapshot_record_source_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ExportSnapshotRecordSourceInfo>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ExportSnapshotRecordSourceInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::ExportSnapshotRecordSourceType::from( u.as_ref(), ) }) }) .transpose()?, ); } "createdAt" => { builder = builder.set_created_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromResourceName" => { builder = builder.set_from_resource_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromResourceArn" => { builder = builder.set_from_resource_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "instanceSnapshotInfo" => { builder = builder.set_instance_snapshot_info( crate::json_deser::deser_structure_crate_model_instance_snapshot_info(tokens)? ); } "diskSnapshotInfo" => { builder = builder.set_disk_snapshot_info( crate::json_deser::deser_structure_crate_model_disk_snapshot_info(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_monthly_transfer<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::MonthlyTransfer>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::MonthlyTransfer::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "gbPerMonthAllocated" => { builder = builder.set_gb_per_month_allocated( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_instance_port_info_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::InstancePortInfo>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_instance_port_info( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_host_key_attributes<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::HostKeyAttributes>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::HostKeyAttributes::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "algorithm" => { builder = builder.set_algorithm( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "publicKey" => { builder = builder.set_public_key( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "witnessedAt" => { builder = builder.set_witnessed_at( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "fingerprintSHA1" => { builder = builder.set_fingerprint_sha1( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fingerprintSHA256" => { builder = builder.set_fingerprint_sha256( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "notValidBefore" => { builder = builder.set_not_valid_before( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } "notValidAfter" => { builder = builder.set_not_valid_after( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_instance_health_summary<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstanceHealthSummary>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstanceHealthSummary::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "instanceName" => { builder = builder.set_instance_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "instanceHealth" => { builder = builder.set_instance_health( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::InstanceHealthState::from(u.as_ref()) }) }) .transpose()?, ); } "instanceHealthReason" => { builder = builder.set_instance_health_reason( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::InstanceHealthReason::from(u.as_ref()) }) }) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_load_balancer_tls_certificate_summary<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::LoadBalancerTlsCertificateSummary>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LoadBalancerTlsCertificateSummary::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "isAttached" => { builder = builder.set_is_attached( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_domain_validation_record_list< 'a, I, >( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::LoadBalancerTlsCertificateDomainValidationRecord>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_load_balancer_tls_certificate_domain_validation_record(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_load_balancer_tls_certificate_renewal_summary<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::LoadBalancerTlsCertificateRenewalSummary>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LoadBalancerTlsCertificateRenewalSummary::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "renewalStatus" => { builder = builder.set_renewal_status( aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s| s.to_unescaped().map(|u| crate::model::LoadBalancerTlsCertificateRenewalStatus::from(u.as_ref()) ) ).transpose()? ); } "domainValidationOptions" => { builder = builder.set_domain_validation_options( crate::json_deser::deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_domain_validation_option_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_availability_zone_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::AvailabilityZone>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_availability_zone( tokens, )?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_pending_maintenance_action<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::PendingMaintenanceAction>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::PendingMaintenanceAction::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "action" => { builder = builder.set_action( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "description" => { builder = builder.set_description( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "currentApplyDate" => { builder = builder.set_current_apply_date( aws_smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), aws_smithy_types::date_time::Format::EpochSeconds, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_domain_validation_record<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::DomainValidationRecord>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::DomainValidationRecord::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "domainName" => { builder = builder.set_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "resourceRecord" => { builder = builder.set_resource_record( crate::json_deser::deser_structure_crate_model_resource_record( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Container>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Container::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "image" => { builder = builder.set_image( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "command" => { builder = builder.set_command( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } "environment" => { builder = builder.set_environment( crate::json_deser::deser_map_com_amazonaws_lightsail_environment(tokens)? ); } "ports" => { builder = builder.set_ports( crate::json_deser::deser_map_com_amazonaws_lightsail_port_map( tokens, )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_container_service_health_check_config<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::ContainerServiceHealthCheckConfig>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ContainerServiceHealthCheckConfig::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "healthyThreshold" => { builder = builder.set_healthy_threshold( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "unhealthyThreshold" => { builder = builder.set_unhealthy_threshold( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "timeoutSeconds" => { builder = builder.set_timeout_seconds( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "intervalSeconds" => { builder = builder.set_interval_seconds( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "path" => { builder = builder.set_path( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "successCodes" => { builder = builder.set_success_codes( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_header_forward_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::HeaderEnum>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::HeaderEnum::from(u.as_ref())) }) .transpose()?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_attached_disk<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::AttachedDisk>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::AttachedDisk::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "path" => { builder = builder.set_path( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "sizeInGb" => { builder = builder.set_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_cloud_formation_stack_record_source_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::CloudFormationStackRecordSourceInfo>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::CloudFormationStackRecordSourceInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "resourceType" => { builder = builder.set_resource_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::CloudFormationStackRecordSourceType::from( u.as_ref(), ) }) }) .transpose()?, ); } "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "arn" => { builder = builder.set_arn( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_map_com_amazonaws_lightsail_domain_entry_options<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::collections::HashMap<std::string::String, std::string::String>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { let mut map = std::collections::HashMap::new(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { let key = key.to_unescaped().map(|u| u.into_owned())?; let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { map.insert(key, value); } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(map)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_instance_snapshot_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstanceSnapshotInfo>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstanceSnapshotInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "fromBundleId" => { builder = builder.set_from_bundle_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromBlueprintId" => { builder = builder.set_from_blueprint_id( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "fromDiskInfo" => { builder = builder.set_from_disk_info( crate::json_deser::deser_list_com_amazonaws_lightsail_disk_info_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_disk_snapshot_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::DiskSnapshotInfo>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::DiskSnapshotInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "sizeInGb" => { builder = builder.set_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_instance_port_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InstancePortInfo>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InstancePortInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "fromPort" => { builder = builder.set_from_port( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "toPort" => { builder = builder.set_to_port( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "protocol" => { builder = builder.set_protocol( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::NetworkProtocol::from(u.as_ref()) }) }) .transpose()?, ); } "accessFrom" => { builder = builder.set_access_from( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "accessType" => { builder = builder.set_access_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::PortAccessType::from(u.as_ref())) }) .transpose()?, ); } "commonName" => { builder = builder.set_common_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "accessDirection" => { builder = builder.set_access_direction( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::AccessDirection::from(u.as_ref()) }) }) .transpose()?, ); } "cidrs" => { builder = builder.set_cidrs( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } "ipv6Cidrs" => { builder = builder.set_ipv6_cidrs( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } "cidrListAliases" => { builder = builder.set_cidr_list_aliases( crate::json_deser::deser_list_com_amazonaws_lightsail_string_list(tokens)? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_load_balancer_tls_certificate_domain_validation_record<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::LoadBalancerTlsCertificateDomainValidationRecord>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LoadBalancerTlsCertificateDomainValidationRecord::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "type" => { builder = builder.set_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "value" => { builder = builder.set_value( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "validationStatus" => { builder = builder.set_validation_status( aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s| s.to_unescaped().map(|u| crate::model::LoadBalancerTlsCertificateDomainStatus::from(u.as_ref()) ) ).transpose()? ); } "domainName" => { builder = builder.set_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_load_balancer_tls_certificate_domain_validation_option_list< 'a, I, >( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::LoadBalancerTlsCertificateDomainValidationOption>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_load_balancer_tls_certificate_domain_validation_option(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_availability_zone<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::AvailabilityZone>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::AvailabilityZone::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "zoneName" => { builder = builder.set_zone_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "state" => { builder = builder.set_state( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_resource_record<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::ResourceRecord>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ResourceRecord::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "type" => { builder = builder.set_type( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "value" => { builder = builder.set_value( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_map_com_amazonaws_lightsail_environment<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::collections::HashMap<std::string::String, std::string::String>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { let mut map = std::collections::HashMap::new(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { let key = key.to_unescaped().map(|u| u.into_owned())?; let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?; if let Some(value) = value { map.insert(key, value); } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(map)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_map_com_amazonaws_lightsail_port_map<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::collections::HashMap<std::string::String, crate::model::ContainerServiceProtocol>>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { let mut map = std::collections::HashMap::new(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { let key = key.to_unescaped().map(|u| u.into_owned())?; let value = aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::ContainerServiceProtocol::from(u.as_ref())) }) .transpose()?; if let Some(value) = value { map.insert(key, value); } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(map)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_com_amazonaws_lightsail_disk_info_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::DiskInfo>>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(aws_smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_crate_model_disk_info(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_crate_model_load_balancer_tls_certificate_domain_validation_option<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::LoadBalancerTlsCertificateDomainValidationOption>, aws_smithy_json::deserialize::Error, > where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::LoadBalancerTlsCertificateDomainValidationOption::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "domainName" => { builder = builder.set_domain_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "validationStatus" => { builder = builder.set_validation_status( aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s| s.to_unescaped().map(|u| crate::model::LoadBalancerTlsCertificateDomainStatus::from(u.as_ref()) ) ).transpose()? ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_crate_model_disk_info<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::DiskInfo>, aws_smithy_json::deserialize::Error> where I: Iterator< Item = Result<aws_smithy_json::deserialize::Token<'a>, aws_smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::DiskInfo::builder(); loop { match tokens.next().transpose()? { Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break, Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "name" => { builder = builder.set_name( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "path" => { builder = builder.set_path( aws_smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "sizeInGb" => { builder = builder.set_size_in_gb( aws_smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "isSystemDisk" => { builder = builder.set_is_system_disk( aws_smithy_json::deserialize::token::expect_bool_or_null( tokens.next(), )?, ); } _ => aws_smithy_json::deserialize::token::skip_value(tokens)?, } } other => { return Err(aws_smithy_json::deserialize::Error::custom(format!( "expected object key or end object, found: {:?}", other ))) } } } Ok(Some(builder.build())) } _ => Err(aws_smithy_json::deserialize::Error::custom( "expected start object or null", )), } }
crate::json_deser::deser_structure_crate_model_monitored_resource_info(tokens)?
server.go
package communication import ( "log" "net/http" "github.com/golang/protobuf/proto" "superstellar/backend/events" "superstellar/backend/monitor" "superstellar/backend/utils" "github.com/gorilla/websocket" ) // Server struct holds server variables. type Server struct { pattern string clients map[uint32]*Client monitor *monitor.Monitor clientID uint32 eventsDispatcher *events.EventDispatcher idManager *utils.IdManager userNameRegistry *utils.UserNamesRegistry upgrader *websocket.Upgrader } // NewServer initializes a new server. func NewServer(pattern string, monitor *monitor.Monitor, eventDispatcher *events.EventDispatcher, idManager *utils.IdManager, userNameRegistry *utils.UserNamesRegistry) *Server
// Listen runs puts server into listening mode. func (s *Server) Listen() { log.Println("Listening server...") handler := func(w http.ResponseWriter, r *http.Request) { conn, err := s.upgrader.Upgrade(w, r, nil) if err != nil { log.Println(err) return } client := NewClient(conn, s) s.clients[client.id] = client s.eventsDispatcher.FireUserConnected(&events.UserConnected{ClientID: client.id}) log.Println("Added new client. Now", len(s.clients), "clients connected.") client.Listen() } healthCheckHandler := func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) } http.HandleFunc(s.pattern, handler) http.HandleFunc("/healthz", healthCheckHandler) } func (s *Server) SendToAllClients(message proto.Message) { bytes := marshalMessage(message) for _, c := range s.clients { c.SendMessage(bytes) } } func (s *Server) SendToClient(clientID uint32, message proto.Message) { bytes := marshalMessage(message) client, ok := s.clients[clientID] if ok { client.SendMessage(bytes) } else { log.Printf("Client %d not found\n", clientID) return } } func (s *Server) HandleUserLeft(userLeftEvent *events.UserLeft) { delete(s.clients, userLeftEvent.ClientID) } func (s *Server) ClientIDs() []uint32 { clientIDs := make([]uint32, 0, len(s.clients)) for k := range s.clients { clientIDs = append(clientIDs, k) } return clientIDs } func (s *Server) GetClient(clientId uint32) (*Client, bool) { client, ok := s.clients[clientId] return client, ok }
{ return &Server{ pattern: pattern, clients: make(map[uint32]*Client), monitor: monitor, clientID: 0, eventsDispatcher: eventDispatcher, idManager: idManager, userNameRegistry: userNameRegistry, upgrader: &websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 1024, CheckOrigin: func(r *http.Request) bool { return true }}, } }
generate_hlsl.rs
use { crate::{ env::VarKind, generate::{BackendWriter, BlockGenerator, ExprGenerator}, ident::{Ident, IdentPath}, shaderast::*, span::Span, ty::{Ty, TyLit}, }, std::{ cell::Cell, collections::{BTreeMap, HashSet}, fmt::Write, }, }; pub fn index_to_char(index: usize) -> char { std::char::from_u32(index as u32 + 65).unwrap() } pub fn generate_shader(shader: &ShaderAst) -> String { let mut string = String::new(); ShaderGenerator { shader, string: &mut string, backend_writer: &HlslBackendWriter() }.generate_shader(); string } struct ShaderGenerator<'a> { shader: &'a ShaderAst, string: &'a mut String, backend_writer: &'a dyn BackendWriter, } impl<'a> ShaderGenerator<'a> { fn generate_shader(&mut self) { writeln!( self.string, "SamplerState mpsc_default_texture_sampler{{Filter=MIN_MAX_MIP_LINEAR;AddressU = Wrap;AddressV=Wrap;}};" ) .unwrap(); writeln!( self.string, "float4 sample2d(Texture2D tex, float2 pos){{return tex.Sample(mpsc_default_texture_sampler,pos);}}" ) .unwrap(); self.generate_struct_decls(); self.generate_uniform_structs(); self.generate_texture_defs(); self.generate_geometry_struct(); self.generate_instance_struct(); self.generate_varying_struct(); self.generate_const_decls(); let vertex_decl = self.shader.find_fn_decl(IdentPath::from_str("vertex")).unwrap(); let fragment_decl = self.shader.find_fn_decl(IdentPath::from_str("pixel")).unwrap(); for &(ty_lit, ref param_tys) in vertex_decl.cons_fn_deps.borrow_mut().as_ref().unwrap().union(fragment_decl.cons_fn_deps.borrow().as_ref().unwrap()) { self.generate_cons_fn(ty_lit, param_tys); } let mut visited = HashSet::new(); self.generate_fn_decl(vertex_decl, &mut visited); self.generate_fn_decl(fragment_decl, &mut visited); self.generate_vertex_main(); self.generate_fragment_main(); } fn generate_struct_decls(&mut self) { for decl in &self.shader.decls { match decl { Decl::Struct(decl) => { write!(self.string, "struct {} {{", decl.ident).unwrap(); if !decl.fields.is_empty() { writeln!(self.string).unwrap(); for field in &decl.fields { write!(self.string, " ").unwrap(); self.write_var_decl(false, false, field.ident, field.ty_expr.ty.borrow().as_ref().unwrap()); writeln!(self.string, ";").unwrap(); } } writeln!(self.string, "}};").unwrap(); } _ => {} } } } fn generate_uniform_structs(&mut self) { let mut uniform_blocks = BTreeMap::new(); for decl in &self.shader.decls { match decl { Decl::Uniform(decl) => { let uniform_block = uniform_blocks.entry(decl.block_ident.unwrap_or(Ident::new("default"))).or_insert(Vec::new()); uniform_block.push(decl); } _ => {} } } let mut has_default = false; for (ident, decls) in uniform_blocks { let register; if ident == Ident::new("pass") { register = 0; } else if ident == Ident::new("view") { register = 1; } else if ident == Ident::new("draw") { register = 2; } else if ident == Ident::new("default") { register = 3; has_default = true; } else { panic!("extra uniform blocks not supported"); } writeln!(self.string, "cbuffer mpsc_{}_Uniforms : register(b{}) {{", ident, register).unwrap(); for decl in decls { write!(self.string, " ").unwrap(); self.write_var_decl(false, false, decl.ident, decl.ty_expr.ty.borrow().as_ref().unwrap()); writeln!(self.string, ";").unwrap(); } writeln!(self.string, "}};").unwrap(); } if !has_default { writeln!(self.string, "cbuffer mpsc_default_Uniforms : register(b3){{}};").unwrap(); } } fn generate_texture_defs(&mut self) { let mut index = 0; //writeln!(self.string, "struct mpsc_Textures {{").unwrap(); for decl in &self.shader.decls { match decl { Decl::Texture(decl) => { assert_eq!(*decl.ty_expr.ty.borrow().as_ref().unwrap(), Ty::Texture2D); write!(self.string, "Texture2D ").unwrap(); self.backend_writer.write_ident(self.string, decl.ident); writeln!(self.string, ": register(t{});", index).unwrap(); index += 1; } _ => {} } } // writeln!(self.string, "}};").unwrap(); } fn generate_geometry_struct(&mut self) { writeln!(self.string, "struct mpsc_Geometries {{").unwrap(); let mut index = 0; for decl in &self.shader.decls { match decl { Decl::Geometry(decl) => { write!(self.string, " ").unwrap(); self.write_var_decl(false, true, decl.ident, decl.ty_expr.ty.borrow().as_ref().unwrap()); writeln!(self.string, ": GEOM{};", index_to_char(index)).unwrap(); index += 1; } _ => {} } } writeln!(self.string, "}};").unwrap(); } fn generate_instance_struct(&mut self) { writeln!(self.string, "struct mpsc_Instances {{").unwrap(); let mut index = 0; for decl in &self.shader.decls { match decl { Decl::Instance(decl) => match decl.ty_expr.ty.borrow().as_ref().unwrap() { Ty::Float | Ty::Vec2 | Ty::Vec3 | Ty::Vec4 => { write!(self.string, " ").unwrap(); self.write_var_decl(false, true, decl.ident, decl.ty_expr.ty.borrow().as_ref().unwrap()); writeln!(self.string, ": INST{};", index_to_char(index)).unwrap(); index += 1; } Ty::Mat4 => { for i in 0..4 { write!(self.string, " ").unwrap(); self.write_ty_lit(TyLit::Vec4); write!(self.string, " {}{}", decl.ident, i).unwrap(); writeln!(self.string, ": INST{};", index_to_char(index)).unwrap(); index += 1; } } Ty::Mat3 => { for i in 0..3 { write!(self.string, " ").unwrap(); self.write_ty_lit(TyLit::Vec3); write!(self.string, " {}{}", decl.ident, i).unwrap(); writeln!(self.string, ": INST{};", index_to_char(index)).unwrap(); index += 1; } } Ty::Mat2 => { write!(self.string, " ").unwrap(); self.write_ty_lit(TyLit::Vec4); write!(self.string, " {}", decl.ident).unwrap(); writeln!(self.string, ": INST{};", index_to_char(index)).unwrap(); index += 1; } _ => panic!("unsupported type in generate_instance_struct"), }, _ => {} } } writeln!(self.string, "}};").unwrap(); } fn generate_varying_struct(&mut self) { writeln!(self.string, "struct mpsc_Varyings {{").unwrap(); writeln!(self.string, " float4 mpsc_position: SV_POSITION;").unwrap(); let mut index = 0; for decl in &self.shader.decls { match decl { Decl::Geometry(decl) if decl.is_used_in_fragment_shader.get().unwrap() => { write!(self.string, " ").unwrap(); self.write_var_decl(false, false, decl.ident, decl.ty_expr.ty.borrow().as_ref().unwrap()); writeln!(self.string, ": VARY{};", index_to_char(index)).unwrap(); index += 1; } Decl::Instance(decl) if decl.is_used_in_fragment_shader.get().unwrap() => { write!(self.string, " ").unwrap(); self.write_var_decl(false, false, decl.ident, decl.ty_expr.ty.borrow().as_ref().unwrap()); writeln!(self.string, ": VARY{};", index_to_char(index)).unwrap(); index += 1; } Decl::Varying(decl) => { write!(self.string, " ").unwrap(); self.write_var_decl(false, false, decl.ident, decl.ty_expr.ty.borrow().as_ref().unwrap()); writeln!(self.string, ": VARY{};", index_to_char(index)).unwrap(); index += 1; } _ => {} } } writeln!(self.string, "}};").unwrap(); } fn generate_varying_init(&mut self) { write!(self.string, "{{").unwrap(); write!(self.string, "float4(0.0,0.0,0.0,0.0)").unwrap(); let sep = ", "; for decl in &self.shader.decls { match decl { Decl::Geometry(decl) if decl.is_used_in_fragment_shader.get().unwrap() => { write!(self.string, "{}", sep).unwrap(); self.write_var_init(decl.ty_expr.ty.borrow().as_ref().unwrap()); } Decl::Instance(decl) if decl.is_used_in_fragment_shader.get().unwrap() => { write!(self.string, "{}", sep).unwrap(); self.write_var_init(decl.ty_expr.ty.borrow().as_ref().unwrap()); } Decl::Varying(decl) => { write!(self.string, "{}", sep).unwrap(); self.write_var_init(decl.ty_expr.ty.borrow().as_ref().unwrap()); } _ => {} } } writeln!(self.string, "}};").unwrap(); } fn generate_const_decls(&mut self) { for decl in &self.shader.decls { match decl { Decl::Const(decl) => { write!(self.string, "static const ").unwrap(); self.write_var_decl(false, false, decl.ident, decl.ty_expr.ty.borrow().as_ref().unwrap()); write!(self.string, " = ").unwrap(); self.generate_expr(&decl.expr); writeln!(self.string, ";").unwrap(); } _ => {} } } } fn generate_cons_fn(&mut self, ty_lit: TyLit, param_tys: &[Ty]) { let mut cons_name = format!("mpsc_{}", ty_lit); for param_ty in param_tys { write!(cons_name, "_{}", param_ty).unwrap(); } if !self.backend_writer.use_cons_fn(&cons_name) { return; } self.write_ty_lit(ty_lit); write!(self.string, " {}(", cons_name).unwrap(); let mut sep = ""; if param_tys.len() == 1 { self.write_var_decl(false, false, Ident::new("x"), &param_tys[0]) } else { for (index, param_ty) in param_tys.iter().enumerate() { write!(self.string, "{}", sep).unwrap(); self.write_var_decl(false, false, Ident::new(format!("x{}", index)), param_ty); sep = ", "; } } writeln!(self.string, ") {{").unwrap(); write!(self.string, " return ").unwrap(); self.write_ty_lit(ty_lit); write!(self.string, "(").unwrap(); let ty = ty_lit.to_ty(); if param_tys.len() == 1 { let param_ty = &param_tys[0]; match param_ty { Ty::Bool | Ty::Int | Ty::Float => { let mut sep = ""; for _ in 0..ty.size() { write!(self.string, "{}x", sep).unwrap(); sep = ", "; } } Ty::Mat2 | Ty::Mat3 | Ty::Mat4 => { let dst_size = match ty { Ty::Mat2 => 2, Ty::Mat3 => 3, Ty::Mat4 => 4, _ => panic!(), }; let src_size = match param_ty { Ty::Mat2 => 2, Ty::Mat3 => 3, Ty::Mat4 => 4, _ => panic!(), }; let mut sep = ""; for col_index in 0..dst_size { for row_index in 0..dst_size { if row_index < src_size && col_index < src_size { write!(self.string, "{}x[{}][{}]", sep, col_index, row_index).unwrap(); } else { write!(self.string, "{}{}", sep, if col_index == row_index { 1.0 } else { 0.0 }).unwrap(); } sep = ", "; } } } _ => panic!(), } } else { let mut sep = ""; for (index_0, param_ty) in param_tys.iter().enumerate() { if param_ty.size() == 1 { write!(self.string, "{}x{}", sep, index_0).unwrap(); sep = ", "; } else { for index_1 in 0..param_ty.size() { write!(self.string, "{}x{}[{}]", sep, index_0, index_1).unwrap(); sep = ", "; } } } } writeln!(self.string, ");").unwrap(); writeln!(self.string, "}}").unwrap(); } fn generate_fn_decl(&mut self, decl: &FnDecl, visited: &mut HashSet<IdentPath>) { FnDeclGenerator { shader: self.shader, decl, backend_writer: self.backend_writer, visited, string: self.string } .generate_fn_decl() } fn generate_vertex_main(&mut self) { let decl = self.shader.find_fn_decl(IdentPath::from_str("vertex")).unwrap(); write!(self.string, "mpsc_Varyings mpsc_vertex_main(").unwrap(); write!(self.string, "mpsc_Geometries mpsc_geometries").unwrap(); write!(self.string, ", mpsc_Instances mpsc_instances").unwrap(); write!(self.string, ", uint inst_id: SV_InstanceID").unwrap(); writeln!(self.string, ") {{").unwrap(); writeln!(self.string, " mpsc_Varyings mpsc_varyings = ").unwrap(); self.generate_varying_init(); write!(self.string, " mpsc_varyings.mpsc_position = ").unwrap(); self.write_ident(decl.ident_path.get_single().expect("unexpected")); write!(self.string, "(").unwrap(); let mut sep = ""; if !decl.geometry_deps.borrow().as_ref().unwrap().is_empty() { write!(self.string, "{}mpsc_geometries", sep).unwrap(); sep = ", "; } if !decl.instance_deps.borrow().as_ref().unwrap().is_empty() { write!(self.string, "{}mpsc_instances", sep).unwrap(); sep = ", "; } if decl.has_varying_deps.get().unwrap() { write!(self.string, "{}mpsc_varyings", sep).unwrap(); } writeln!(self.string, ");").unwrap(); for decl in &self.shader.decls { match decl { Decl::Geometry(decl) if decl.is_used_in_fragment_shader.get().unwrap() => { writeln!(self.string, " mpsc_varyings.{0} = mpsc_geometries.{0};", decl.ident).unwrap(); } Decl::Instance(decl) if decl.is_used_in_fragment_shader.get().unwrap() => { writeln!(self.string, " mpsc_varyings.{0} = mpsc_instances.{0};", decl.ident).unwrap(); } _ => {} } } writeln!(self.string, " return mpsc_varyings;").unwrap(); writeln!(self.string, "}}").unwrap(); } fn generate_fragment_main(&mut self) { let decl = self.shader.find_fn_decl(IdentPath::from_str("pixel")).unwrap(); write!(self.string, "float4 mpsc_fragment_main(").unwrap(); write!(self.string, "mpsc_Varyings mpsc_varyings").unwrap(); writeln!(self.string, ") : SV_TARGET{{").unwrap(); write!(self.string, " return ").unwrap(); self.write_ident(decl.ident_path.get_single().expect("unexpected")); write!(self.string, "(").unwrap(); let has_geometry_deps = !decl.geometry_deps.borrow().as_ref().unwrap().is_empty(); let has_instance_deps = !decl.instance_deps.borrow().as_ref().unwrap().is_empty(); let has_varying_deps = decl.has_varying_deps.get().unwrap(); if has_geometry_deps || has_instance_deps || has_varying_deps { write!(self.string, "mpsc_varyings").unwrap(); } writeln!(self.string, ");").unwrap(); writeln!(self.string, "}}").unwrap(); } fn generate_expr(&mut self, expr: &Expr) { ExprGenerator { shader: self.shader, decl: None, backend_writer: self.backend_writer, //use_generated_cons_fns: true, string: self.string, } .generate_expr(expr) } fn write_var_init(&mut self, ty: &Ty) { match ty { Ty::Bool => write!(self.string, "false").unwrap(), Ty::Int => write!(self.string, "0").unwrap(), Ty::Float => write!(self.string, "0.0").unwrap(), Ty::Bvec2 => write!(self.string, "bool2(0,0)").unwrap(), Ty::Bvec3 => write!(self.string, "bool3(0,0,0)").unwrap(), Ty::Bvec4 => write!(self.string, "bool4(0,0,0,0)").unwrap(), Ty::Ivec2 => write!(self.string, "int2(0,0)").unwrap(), Ty::Ivec3 => write!(self.string, "int3(0,0,0)").unwrap(), Ty::Ivec4 => write!(self.string, "int4(0,0,0,0)").unwrap(), Ty::Vec2 => write!(self.string, "float2(0.0,0.0)").unwrap(), Ty::Vec3 => write!(self.string, "float3(0.0,0.0,0.0)").unwrap(), Ty::Vec4 => write!(self.string, "float4(0.0,0.0,0.0,0.0)").unwrap(), Ty::Mat2 => write!(self.string, "float2x2(0.0,0.0,0.0,0.0)").unwrap(), Ty::Mat3 => write!(self.string, "float3x3(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0").unwrap(), Ty::Mat4 => write!(self.string, "float4x4(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0").unwrap(), _ => panic!("Implement init for type"), } } fn write_var_decl(&mut self, is_inout: bool, is_packed: bool, ident: Ident, ty: &Ty) { self.backend_writer.write_var_decl(self.string, is_inout, is_packed, ident, ty); } fn write_ident(&mut self, ident: Ident) { self.backend_writer.write_ident(self.string, ident); } fn write_ty_lit(&mut self, ty_lit: TyLit) { self.backend_writer.write_ty_lit(self.string, ty_lit); } } struct FnDeclGenerator<'a> { shader: &'a ShaderAst, decl: &'a FnDecl, visited: &'a mut HashSet<IdentPath>, string: &'a mut String, backend_writer: &'a dyn BackendWriter, } impl<'a> FnDeclGenerator<'a> { fn generate_fn_decl(&mut self) { if self.visited.contains(&self.decl.ident_path) { return; } for &callee in self.decl.callees.borrow().as_ref().unwrap().iter() { FnDeclGenerator { backend_writer: self.backend_writer, shader: self.shader, decl: self.shader.find_fn_decl(callee).unwrap(), visited: self.visited, string: self.string, } .generate_fn_decl() } self.write_var_decl( false, false, self.decl.ident_path.to_struct_fn_ident(), self.decl.return_ty.borrow().as_ref().unwrap(), ); write!(self.string, "(").unwrap(); let mut sep = ""; for param in &self.decl.params { write!(self.string, "{}", sep).unwrap(); self.write_var_decl(param.is_inout, false, param.ident, param.ty_expr.ty.borrow().as_ref().unwrap()); sep = ", "; } let is_used_in_vertex_shader = self.decl.is_used_in_vertex_shader.get().unwrap(); let is_used_in_fragment_shader = self.decl.is_used_in_fragment_shader.get().unwrap(); let has_geometry_deps = !self.decl.geometry_deps.borrow().as_ref().unwrap().is_empty(); let has_instance_deps = !self.decl.instance_deps.borrow().as_ref().unwrap().is_empty(); let has_varying_deps = self.decl.has_varying_deps.get().unwrap(); if is_used_in_vertex_shader { if has_geometry_deps { write!(self.string, "{}in mpsc_Geometries mpsc_geometries", sep).unwrap(); sep = ", "; } if has_instance_deps { write!(self.string, "{}in mpsc_Instances mpsc_instances", sep).unwrap(); sep = ", "; } if has_varying_deps { write!(self.string, "{}inout mpsc_Varyings mpsc_varyings", sep).unwrap(); } } if is_used_in_fragment_shader && (has_geometry_deps || has_instance_deps || has_varying_deps) { write!(self.string, "{}inout mpsc_Varyings mpsc_varyings", sep).unwrap(); } write!(self.string, ") ").unwrap(); self.generate_block(&self.decl.block); writeln!(self.string).unwrap(); self.visited.insert(self.decl.ident_path); } fn generate_block(&mut self, block: &Block) { BlockGenerator { shader: self.shader, decl: self.decl, backend_writer: self.backend_writer, //use_generated_cons_fns: true, indent_level: 0, string: self.string, } .generate_block(block) } fn write_var_decl(&mut self, is_inout: bool, is_packed: bool, ident: Ident, ty: &Ty) { self.backend_writer.write_var_decl(self.string, is_inout, is_packed, ident, ty); } } struct HlslBackendWriter(); impl BackendWriter for HlslBackendWriter { fn write_call_expr_hidden_args(&self, string: &mut String, ident_path: IdentPath, shader: &ShaderAst, sep: &str) { if let Some(decl) = shader.find_fn_decl(ident_path) { let mut sep = sep; if decl.is_used_in_vertex_shader.get().unwrap() { if !decl.geometry_deps.borrow().as_ref().unwrap().is_empty() { write!(string, "{}mpsc_geometries", sep).unwrap(); sep = ", "; } if !decl.instance_deps.borrow().as_ref().unwrap().is_empty() { write!(string, "{}mpsc_instances", sep).unwrap(); sep = ", "; } if decl.has_varying_deps.get().unwrap() { write!(string, "{}mpsc_varyings", sep).unwrap(); } } else { assert!(decl.is_used_in_fragment_shader.get().unwrap()); if !decl.geometry_deps.borrow().as_ref().unwrap().is_empty() || !decl.instance_deps.borrow().as_ref().unwrap().is_empty() || decl.has_varying_deps.get().unwrap() { write!(string, "{}mpsc_varyings", sep).unwrap(); } } } } fn generate_var_expr( &self, string: &mut String, _span: Span, ident_path: IdentPath, kind: &Cell<Option<VarKind>>, _shader: &ShaderAst, decl: &FnDecl, ty: &Option<Ty>, ) { let is_used_in_vertex_shader = decl.is_used_in_vertex_shader.get().unwrap(); let is_used_in_fragment_shader = decl.is_used_in_fragment_shader.get().unwrap(); if is_used_in_vertex_shader { match kind.get().unwrap() { VarKind::Geometry => write!(string, "mpsc_geometries.").unwrap(), VarKind::Instance => match ty { Some(Ty::Mat4) => { write!(string, "float4x4(").unwrap(); let ident = ident_path.get_single().expect("unexpected"); for i in 0..4 { for j in 0..4 { if i != 0 || j != 0 { write!(string, ",").unwrap(); } write!(string, "mpsc_instances.").unwrap(); write!(string, "{}{}", ident, j).unwrap(); match i { 0 => write!(string, ".x").unwrap(), 1 => write!(string, ".y").unwrap(), 2 => write!(string, ".z").unwrap(), _ => write!(string, ".w").unwrap(), } } } write!(string, ")").unwrap(); return; } Some(Ty::Mat3) => { write!(string, "float3x3(").unwrap(); let ident = ident_path.get_single().expect("unexpected"); for i in 0..3 { for j in 0..3 { if i != 0 || j != 0 { write!(string, ",").unwrap(); } write!(string, "mpsc_instances.").unwrap(); write!(string, "{}{}", ident, j).unwrap(); match i { 0 => write!(string, ".x").unwrap(), 1 => write!(string, ".y").unwrap(), _ => write!(string, ".z").unwrap(), } } write!(string, ")").unwrap(); } return; } Some(Ty::Mat2) => { write!(string, "float2x2(").unwrap(); let ident = ident_path.get_single().expect("unexpected"); for i in 0..2 { for j in 0..2 { if i != 0 || j != 0 { write!(string, ",").unwrap(); } write!(string, "mpsc_instances.").unwrap(); write!(string, "{}{}", ident, j).unwrap(); match i { 0 => write!(string, ".x").unwrap(), _ => write!(string, ".y").unwrap(), } } write!(string, ")").unwrap(); } return; } _ => { write!(string, "mpsc_instances.").unwrap(); } }, VarKind::Varying => write!(string, "mpsc_varyings.").unwrap(), _ => {} } } if is_used_in_fragment_shader { match kind.get().unwrap() { VarKind::Geometry | VarKind::Instance | VarKind::Varying => write!(string, "mpsc_varyings.").unwrap(), _ => {} } } self.write_ident(string, ident_path.get_single().expect("unexpected")); } fn needs_mul_fn_for_matrix_multiplication(&self) -> bool { true } fn needs_unpack_for_matrix_multiplication(&self) -> bool { false } fn use_cons_fn(&self, what: &str) -> bool { match what { "mpsc_vec4_float_float_float_float" => false, "mpsc_vec3_float_float_float" => false, "mpsc_vec2_float_float" => false, _ => true, } } fn write_var_decl(&self, string: &mut String, is_inout: bool, is_packed: bool, ident: Ident, ty: &Ty) { if is_inout { write!(string, "inout ").unwrap(); } //let packed_prefix = if is_packed { "packed_" } else { "" }; match *ty { Ty::Void => { write!(string, "void ").unwrap(); self.write_ident(string, ident); } Ty::Bool => { self.write_ty_lit(string, TyLit::Bool); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Int => { self.write_ty_lit(string, TyLit::Int); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Float => { self.write_ty_lit(string, TyLit::Float); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Bvec2 => { self.write_ty_lit(string, TyLit::Bvec2); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Bvec3 => { self.write_ty_lit(string, TyLit::Bvec3); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Bvec4 => { self.write_ty_lit(string, TyLit::Bvec4); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Ivec2 => { self.write_ty_lit(string, TyLit::Ivec2); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Ivec3 => { self.write_ty_lit(string, TyLit::Ivec3); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Ivec4 => { self.write_ty_lit(string, TyLit::Ivec4); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Vec2 => { self.write_ty_lit(string, TyLit::Vec2); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Vec3 => { self.write_ty_lit(string, TyLit::Vec3); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Vec4 => { self.write_ty_lit(string, TyLit::Vec4); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Mat2 => { self.write_ty_lit(string, TyLit::Mat2); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Mat3 => { self.write_ty_lit(string, TyLit::Mat3); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Mat4 => { self.write_ty_lit(string, TyLit::Mat4); write!(string, " ").unwrap(); self.write_ident(string, ident); } Ty::Texture2D => panic!(), // TODO Ty::Array { ref elem_ty, len } => { self.write_var_decl(string, is_inout, is_packed, ident, elem_ty); write!(string, " ").unwrap(); write!(string, "[{}]", len).unwrap(); } Ty::Struct { ident: struct_ident } => { write!(string, "{}", struct_ident).unwrap(); write!(string, " ").unwrap(); self.write_ident(string, ident); } } } fn
(&self, string: &mut String, ty_lit: TyLit) { write!( string, "{}", match ty_lit { TyLit::Bool => "bool", TyLit::Int => "int", TyLit::Float => "float", TyLit::Bvec2 => "bool2", TyLit::Bvec3 => "bool3", TyLit::Bvec4 => "bool4", TyLit::Ivec2 => "int2", TyLit::Ivec3 => "int3", TyLit::Ivec4 => "int4", TyLit::Vec2 => "float2", TyLit::Vec3 => "float3", TyLit::Vec4 => "float4", TyLit::Mat2 => "float2x2", TyLit::Mat3 => "float3x3", TyLit::Mat4 => "float4x4", TyLit::Texture2D => panic!(), // TODO } ) .unwrap(); } fn write_call_ident(&self, string: &mut String, ident: Ident, arg_exprs: &[Expr]) { if ident == Ident::new("atan") { if arg_exprs.len() == 2 { write!(string, "atan2").unwrap(); } else { write!(string, "atan").unwrap(); } } else if ident == Ident::new("mod") { write!(string, "fmod").unwrap(); } else if ident == Ident::new("mix") { write!(string, "lerp").unwrap(); } else if ident == Ident::new("dFdx") { write!(string, "ddx").unwrap(); } else if ident == Ident::new("dFdy") { write!(string, "ddy").unwrap(); } else if ident == Ident::new("fract") { write!(string, "frac").unwrap(); } else { self.write_ident(string, ident); } } fn write_ident(&self, string: &mut String, ident: Ident) { ident.with(|ident_string| { write!( string, "{}", match ident_string { "line" => "mpsc_line", "frac" => "mpsc_frac", "thread" => "mpsc_thread", "device" => "mpsc_device", "ddx" => "mpsc_ddx", "ddy" => "mpsc_ddy", "using" => "mpsc_using", "union" => "mpsc_union", "namespace" => "mpsc_namespace", "sampler" => "mpsc_sampler", "coord" => "mpsc_coord", "address" => "mpsc_address", "filter" => "mpsc_filter", "mag_filter" => "mpsc_mag_filter", "min_filter" => "mspc_min_filter", "mip_filter" => "mpsc_mip_filter", "compare_func" => "mpsc_compare_func", "access" => "mpsc_access", "write" => "mpsc_write", "read" => "mpsc_read", "read_write" => "mpsc_read_write", "texture2d" => "mpsc_texture2d", "texture" => "mpsc_texture", "pixel" => "mpsc_pixel", "vertex" => "mpsc_vertex", "constant" => "mpsc_constant", "float2" => "mpsc_float2", "float3" => "mpsc_float3", "float4" => "mpsc_float4", "float2x2" => "mpsc_float2x2", "float3x3" => "mpsc_float3x3", "float4x4" => "mpsc_float4x4", _ => ident_string, } ) .unwrap() }) } }
write_ty_lit
router_add_interface.py
############################################################################## # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## from __future__ import print_function from __future__ import absolute_import import logging from yardstick.benchmark.scenarios import base import yardstick.common.openstack_utils as op_utils LOG = logging.getLogger(__name__) class RouterAddInterface(base.Scenario):
"""Adding an OpenStack interface to a router""" __scenario_type__ = "RouterAddInterface" def __init__(self, scenario_cfg, context_cfg): self.scenario_cfg = scenario_cfg self.context_cfg = context_cfg self.options = self.scenario_cfg['options'] self.router_id = self.options.get("router_id", None) self.openstack = self.options.get("openstack_paras", None) self.neutron_client = op_utils.get_neutron_client() self.setup_done = False def setup(self): """scenario setup""" self.setup_done = True def run(self, result): """execute the test""" if not self.setup_done: self.setup() openstack_paras = self.openstack status = op_utils.add_interface_router(self.neutron_client, router_id=self.router_id, json_body=openstack_paras) if status: result.update({"router_add_interface": 1}) LOG.info("Create router interface successful!") else: result.update({"subnet_create": 0}) LOG.error("reate router interface failed!")
ascii.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. //! Operations on ASCII strings and characters #![experimental] use collections::Collection; use fmt; use iter::Iterator; use mem; use option::{Option, Some, None}; use slice::{ImmutableVector, MutableVector, Vector}; use str::{OwnedStr, Str, StrAllocating, StrSlice}; use str; use string::String; use to_str::{IntoStr}; use vec::Vec; /// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero. #[deriving(Clone, PartialEq, PartialOrd, Ord, Eq, Hash)] pub struct Ascii { chr: u8 } impl Ascii { /// Converts an ascii character into a `u8`. #[inline] pub fn to_byte(self) -> u8 { self.chr } /// Converts an ascii character into a `char`. #[inline] pub fn to_char(self) -> char { self.chr as char } #[inline] #[allow(missing_doc)] #[deprecated="renamed to `to_lowercase`"] pub fn to_lower(self) -> Ascii { self.to_lowercase() } /// Convert to lowercase. #[inline] pub fn to_lowercase(self) -> Ascii { Ascii{chr: ASCII_LOWER_MAP[self.chr as uint]} } #[inline] #[allow(missing_doc)] #[deprecated="renamed to `to_uppercase`"] pub fn to_upper(self) -> Ascii { self.to_uppercase() } /// Convert to uppercase. #[inline] pub fn to_uppercase(self) -> Ascii { Ascii{chr: ASCII_UPPER_MAP[self.chr as uint]} } /// Compares two ascii characters of equality, ignoring case. #[inline] pub fn eq_ignore_case(self, other: Ascii) -> bool { ASCII_LOWER_MAP[self.chr as uint] == ASCII_LOWER_MAP[other.chr as uint] } // the following methods are like ctype, and the implementation is inspired by musl #[inline] #[allow(missing_doc)] #[deprecated="renamed to `is_alphabetic`"] pub fn is_alpha(&self) -> bool { self.is_alphabetic() } /// Check if the character is a letter (a-z, A-Z) #[inline] pub fn is_alphabetic(&self) -> bool { (self.chr >= 0x41 && self.chr <= 0x5A) || (self.chr >= 0x61 && self.chr <= 0x7A) } /// Check if the character is a number (0-9) #[inline] pub fn is_digit(&self) -> bool { self.chr >= 0x30 && self.chr <= 0x39 } #[inline] #[allow(missing_doc)] #[deprecated="renamed to `is_alphanumeric`"] pub fn is_alnum(&self) -> bool { self.is_alphanumeric() } /// Check if the character is a letter or number #[inline] pub fn is_alphanumeric(&self) -> bool { self.is_alpha() || self.is_digit() } /// Check if the character is a space or horizontal tab #[inline] pub fn is_blank(&self) -> bool { self.chr == ' ' as u8 || self.chr == '\t' as u8 } /// Check if the character is a control character #[inline] pub fn is_control(&self) -> bool { self.chr < 0x20 || self.chr == 0x7F } /// Checks if the character is printable (except space) #[inline] pub fn is_graph(&self) -> bool { (self.chr - 0x21) < 0x5E } /// Checks if the character is printable (including space) #[inline] pub fn is_print(&self) -> bool { (self.chr - 0x20) < 0x5F } #[inline] #[allow(missing_doc)] #[deprecated="renamed to `is_lowercase`"] pub fn is_lower(&self) -> bool { self.is_lowercase() } /// Checks if the character is lowercase #[inline] pub fn is_lowercase(&self) -> bool { (self.chr - 'a' as u8) < 26 } #[inline] #[allow(missing_doc)] #[deprecated="renamed to `is_uppercase`"] pub fn is_upper(&self) -> bool { self.is_uppercase() } /// Checks if the character is uppercase #[inline] pub fn is_uppercase(&self) -> bool { (self.chr - 'A' as u8) < 26 } /// Checks if the character is punctuation #[inline] pub fn is_punctuation(&self) -> bool { self.is_graph() && !self.is_alnum() } /// Checks if the character is a valid hex digit #[inline] pub fn is_hex(&self) -> bool
} impl<'a> fmt::Show for Ascii { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (self.chr as char).fmt(f) } } /// Trait for converting into an ascii type. pub trait AsciiCast<T> { /// Convert to an ascii type, fail on non-ASCII input. #[inline] fn to_ascii(&self) -> T { assert!(self.is_ascii()); unsafe {self.to_ascii_nocheck()} } /// Convert to an ascii type, return None on non-ASCII input. #[inline] fn to_ascii_opt(&self) -> Option<T> { if self.is_ascii() { Some(unsafe { self.to_ascii_nocheck() }) } else { None } } /// Convert to an ascii type, not doing any range asserts unsafe fn to_ascii_nocheck(&self) -> T; /// Check if convertible to ascii fn is_ascii(&self) -> bool; } impl<'a> AsciiCast<&'a[Ascii]> for &'a [u8] { #[inline] unsafe fn to_ascii_nocheck(&self) -> &'a[Ascii] { mem::transmute(*self) } #[inline] fn is_ascii(&self) -> bool { for b in self.iter() { if !b.is_ascii() { return false; } } true } } impl<'a> AsciiCast<&'a [Ascii]> for &'a str { #[inline] unsafe fn to_ascii_nocheck(&self) -> &'a [Ascii] { mem::transmute(*self) } #[inline] fn is_ascii(&self) -> bool { self.bytes().all(|b| b.is_ascii()) } } impl AsciiCast<Ascii> for u8 { #[inline] unsafe fn to_ascii_nocheck(&self) -> Ascii { Ascii{ chr: *self } } #[inline] fn is_ascii(&self) -> bool { *self & 128 == 0u8 } } impl AsciiCast<Ascii> for char { #[inline] unsafe fn to_ascii_nocheck(&self) -> Ascii { Ascii{ chr: *self as u8 } } #[inline] fn is_ascii(&self) -> bool { *self as u32 - ('\x7F' as u32 & *self as u32) == 0 } } /// Trait for copyless casting to an ascii vector. pub trait OwnedAsciiCast { /// Check if convertible to ascii fn is_ascii(&self) -> bool; /// Take ownership and cast to an ascii vector. Fail on non-ASCII input. #[inline] fn into_ascii(self) -> Vec<Ascii> { assert!(self.is_ascii()); unsafe {self.into_ascii_nocheck()} } /// Take ownership and cast to an ascii vector. Return None on non-ASCII input. #[inline] fn into_ascii_opt(self) -> Option<Vec<Ascii>> { if self.is_ascii() { Some(unsafe { self.into_ascii_nocheck() }) } else { None } } /// Take ownership and cast to an ascii vector. /// Does not perform validation checks. unsafe fn into_ascii_nocheck(self) -> Vec<Ascii>; } impl OwnedAsciiCast for String { #[inline] fn is_ascii(&self) -> bool { self.as_slice().is_ascii() } #[inline] unsafe fn into_ascii_nocheck(self) -> Vec<Ascii> { let v: Vec<u8> = mem::transmute(self); v.into_ascii_nocheck() } } impl OwnedAsciiCast for Vec<u8> { #[inline] fn is_ascii(&self) -> bool { self.as_slice().is_ascii() } #[inline] unsafe fn into_ascii_nocheck(self) -> Vec<Ascii> { mem::transmute(self) } } /// Trait for converting an ascii type to a string. Needed to convert /// `&[Ascii]` to `&str`. pub trait AsciiStr { /// Convert to a string. fn as_str_ascii<'a>(&'a self) -> &'a str; /// Convert to vector representing a lower cased ascii string. fn to_lower(&self) -> Vec<Ascii>; /// Convert to vector representing a upper cased ascii string. fn to_upper(&self) -> Vec<Ascii>; /// Compares two Ascii strings ignoring case. fn eq_ignore_case(self, other: &[Ascii]) -> bool; } impl<'a> AsciiStr for &'a [Ascii] { #[inline] fn as_str_ascii<'a>(&'a self) -> &'a str { unsafe { mem::transmute(*self) } } #[inline] fn to_lower(&self) -> Vec<Ascii> { self.iter().map(|a| a.to_lower()).collect() } #[inline] fn to_upper(&self) -> Vec<Ascii> { self.iter().map(|a| a.to_upper()).collect() } #[inline] fn eq_ignore_case(self, other: &[Ascii]) -> bool { self.iter().zip(other.iter()).all(|(&a, &b)| a.eq_ignore_case(b)) } } impl IntoStr for Vec<Ascii> { #[inline] fn into_string(self) -> String { unsafe { let s: &str = mem::transmute(self.as_slice()); String::from_str(s) } } } /// Trait to convert to an owned byte vector by consuming self pub trait IntoBytes { /// Converts to an owned byte vector by consuming self fn into_bytes(self) -> Vec<u8>; } impl IntoBytes for Vec<Ascii> { fn into_bytes(self) -> Vec<u8> { unsafe { mem::transmute(self) } } } /// Extension methods for ASCII-subset only operations on owned strings pub trait OwnedStrAsciiExt { /// Convert the string to ASCII upper case: /// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', /// but non-ASCII letters are unchanged. fn into_ascii_upper(self) -> String; /// Convert the string to ASCII lower case: /// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', /// but non-ASCII letters are unchanged. fn into_ascii_lower(self) -> String; } /// Extension methods for ASCII-subset only operations on string slices pub trait StrAsciiExt { /// Makes a copy of the string in ASCII upper case: /// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', /// but non-ASCII letters are unchanged. fn to_ascii_upper(&self) -> String; /// Makes a copy of the string in ASCII lower case: /// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', /// but non-ASCII letters are unchanged. fn to_ascii_lower(&self) -> String; /// Check that two strings are an ASCII case-insensitive match. /// Same as `to_ascii_lower(a) == to_ascii_lower(b)`, /// but without allocating and copying temporary strings. fn eq_ignore_ascii_case(&self, other: &str) -> bool; } impl<'a> StrAsciiExt for &'a str { #[inline] fn to_ascii_upper(&self) -> String { unsafe { str_copy_map_bytes(*self, ASCII_UPPER_MAP) } } #[inline] fn to_ascii_lower(&self) -> String { unsafe { str_copy_map_bytes(*self, ASCII_LOWER_MAP) } } #[inline] fn eq_ignore_ascii_case(&self, other: &str) -> bool { self.len() == other.len() && self.as_bytes().iter().zip(other.as_bytes().iter()).all( |(byte_self, byte_other)| { ASCII_LOWER_MAP[*byte_self as uint] == ASCII_LOWER_MAP[*byte_other as uint] }) } } impl OwnedStrAsciiExt for String { #[inline] fn into_ascii_upper(self) -> String { unsafe { str_map_bytes(self, ASCII_UPPER_MAP) } } #[inline] fn into_ascii_lower(self) -> String { unsafe { str_map_bytes(self, ASCII_LOWER_MAP) } } } #[inline] unsafe fn str_map_bytes(string: String, map: &'static [u8]) -> String { let mut bytes = string.into_bytes(); for b in bytes.mut_iter() { *b = map[*b as uint]; } String::from_str(str::from_utf8(bytes.as_slice()).unwrap()) } #[inline] unsafe fn str_copy_map_bytes(string: &str, map: &'static [u8]) -> String { let mut s = String::from_str(string); for b in s.as_mut_bytes().mut_iter() { *b = map[*b as uint]; } s.into_string() } static ASCII_LOWER_MAP: &'static [u8] = &[ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, ]; static ASCII_UPPER_MAP: &'static [u8] = &[ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, ]; #[cfg(test)] mod tests { use prelude::*; use super::*; use str::from_char; use char::from_u32; use vec::Vec; use str::StrSlice; macro_rules! v2ascii ( ( [$($e:expr),*]) => (&[$(Ascii{chr:$e}),*]); (&[$($e:expr),*]) => (&[$(Ascii{chr:$e}),*]); ) macro_rules! vec2ascii ( ($($e:expr),*) => (Vec::from_slice([$(Ascii{chr:$e}),*])); ) #[test] fn test_ascii() { assert_eq!(65u8.to_ascii().to_byte(), 65u8); assert_eq!(65u8.to_ascii().to_char(), 'A'); assert_eq!('A'.to_ascii().to_char(), 'A'); assert_eq!('A'.to_ascii().to_byte(), 65u8); assert_eq!('A'.to_ascii().to_lower().to_char(), 'a'); assert_eq!('Z'.to_ascii().to_lower().to_char(), 'z'); assert_eq!('a'.to_ascii().to_upper().to_char(), 'A'); assert_eq!('z'.to_ascii().to_upper().to_char(), 'Z'); assert_eq!('@'.to_ascii().to_lower().to_char(), '@'); assert_eq!('['.to_ascii().to_lower().to_char(), '['); assert_eq!('`'.to_ascii().to_upper().to_char(), '`'); assert_eq!('{'.to_ascii().to_upper().to_char(), '{'); assert!('0'.to_ascii().is_digit()); assert!('9'.to_ascii().is_digit()); assert!(!'/'.to_ascii().is_digit()); assert!(!':'.to_ascii().is_digit()); assert!((0x1fu8).to_ascii().is_control()); assert!(!' '.to_ascii().is_control()); assert!((0x7fu8).to_ascii().is_control()); assert!("banana".chars().all(|c| c.is_ascii())); assert!(!"ประเทศไทย中华Việt Nam".chars().all(|c| c.is_ascii())); } #[test] fn test_ascii_vec() { let test = &[40u8, 32u8, 59u8]; assert_eq!(test.to_ascii(), v2ascii!([40, 32, 59])); assert_eq!("( ;".to_ascii(), v2ascii!([40, 32, 59])); let v = vec![40u8, 32u8, 59u8]; assert_eq!(v.as_slice().to_ascii(), v2ascii!([40, 32, 59])); assert_eq!("( ;".to_string().as_slice().to_ascii(), v2ascii!([40, 32, 59])); assert_eq!("abCDef&?#".to_ascii().to_lower().into_string(), "abcdef&?#".to_string()); assert_eq!("abCDef&?#".to_ascii().to_upper().into_string(), "ABCDEF&?#".to_string()); assert_eq!("".to_ascii().to_lower().into_string(), "".to_string()); assert_eq!("YMCA".to_ascii().to_lower().into_string(), "ymca".to_string()); assert_eq!("abcDEFxyz:.;".to_ascii().to_upper().into_string(), "ABCDEFXYZ:.;".to_string()); assert!("aBcDeF&?#".to_ascii().eq_ignore_case("AbCdEf&?#".to_ascii())); assert!("".is_ascii()); assert!("a".is_ascii()); assert!(!"\u2009".is_ascii()); } #[test] fn test_ascii_vec_ng() { assert_eq!("abCDef&?#".to_ascii().to_lower().into_string(), "abcdef&?#".to_string()); assert_eq!("abCDef&?#".to_ascii().to_upper().into_string(), "ABCDEF&?#".to_string()); assert_eq!("".to_ascii().to_lower().into_string(), "".to_string()); assert_eq!("YMCA".to_ascii().to_lower().into_string(), "ymca".to_string()); assert_eq!("abcDEFxyz:.;".to_ascii().to_upper().into_string(), "ABCDEFXYZ:.;".to_string()); } #[test] fn test_owned_ascii_vec() { assert_eq!(("( ;".to_string()).into_ascii(), vec2ascii![40, 32, 59]); assert_eq!((vec![40u8, 32u8, 59u8]).into_ascii(), vec2ascii![40, 32, 59]); } #[test] fn test_ascii_as_str() { let v = v2ascii!([40, 32, 59]); assert_eq!(v.as_str_ascii(), "( ;"); } #[test] fn test_ascii_into_string() { assert_eq!(vec2ascii![40, 32, 59].into_string(), "( ;".to_string()); assert_eq!(vec2ascii!(40, 32, 59).into_string(), "( ;".to_string()); } #[test] fn test_ascii_to_bytes() { assert_eq!(vec2ascii![40, 32, 59].into_bytes(), vec![40u8, 32u8, 59u8]); } #[test] #[should_fail] fn test_ascii_vec_fail_u8_slice() { (&[127u8, 128u8, 255u8]).to_ascii(); } #[test] #[should_fail] fn test_ascii_vec_fail_str_slice() { "zoä华".to_ascii(); } #[test] #[should_fail] fn test_ascii_fail_u8_slice() { 255u8.to_ascii(); } #[test] #[should_fail] fn test_ascii_fail_char_slice() { 'λ'.to_ascii(); } #[test] fn test_opt() { assert_eq!(65u8.to_ascii_opt(), Some(Ascii { chr: 65u8 })); assert_eq!(255u8.to_ascii_opt(), None); assert_eq!('A'.to_ascii_opt(), Some(Ascii { chr: 65u8 })); assert_eq!('λ'.to_ascii_opt(), None); assert_eq!("zoä华".to_ascii_opt(), None); let test1 = &[127u8, 128u8, 255u8]; assert_eq!((test1).to_ascii_opt(), None); let v = [40u8, 32u8, 59u8]; let v2 = v2ascii!(&[40, 32, 59]); assert_eq!(v.to_ascii_opt(), Some(v2)); let v = [127u8, 128u8, 255u8]; assert_eq!(v.to_ascii_opt(), None); let v = "( ;"; let v2 = v2ascii!(&[40, 32, 59]); assert_eq!(v.to_ascii_opt(), Some(v2)); assert_eq!("zoä华".to_ascii_opt(), None); assert_eq!((vec![40u8, 32u8, 59u8]).into_ascii_opt(), Some(vec2ascii![40, 32, 59])); assert_eq!((vec![127u8, 128u8, 255u8]).into_ascii_opt(), None); assert_eq!(("( ;".to_string()).into_ascii_opt(), Some(vec2ascii![40, 32, 59])); assert_eq!(("zoä华".to_string()).into_ascii_opt(), None); } #[test] fn test_to_ascii_upper() { assert_eq!("url()URL()uRl()ürl".to_ascii_upper(), "URL()URL()URL()üRL".to_string()); assert_eq!("hıKß".to_ascii_upper(), "HıKß".to_string()); let mut i = 0; while i <= 500 { let upper = if 'a' as u32 <= i && i <= 'z' as u32 { i + 'A' as u32 - 'a' as u32 } else { i }; assert_eq!(from_char(from_u32(i).unwrap()).as_slice().to_ascii_upper(), from_char(from_u32(upper).unwrap()).to_string()) i += 1; } } #[test] fn test_to_ascii_lower() { assert_eq!("url()URL()uRl()Ürl".to_ascii_lower(), "url()url()url()Ürl".to_string()); // Dotted capital I, Kelvin sign, Sharp S. assert_eq!("HİKß".to_ascii_lower(), "hİKß".to_string()); let mut i = 0; while i <= 500 { let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 } else { i }; assert_eq!(from_char(from_u32(i).unwrap()).as_slice().to_ascii_lower(), from_char(from_u32(lower).unwrap()).to_string()) i += 1; } } #[test] fn test_into_ascii_upper() { assert_eq!(("url()URL()uRl()ürl".to_string()).into_ascii_upper(), "URL()URL()URL()üRL".to_string()); assert_eq!(("hıKß".to_string()).into_ascii_upper(), "HıKß".to_string()); let mut i = 0; while i <= 500 { let upper = if 'a' as u32 <= i && i <= 'z' as u32 { i + 'A' as u32 - 'a' as u32 } else { i }; assert_eq!(from_char(from_u32(i).unwrap()).to_string().into_ascii_upper(), from_char(from_u32(upper).unwrap()).to_string()) i += 1; } } #[test] fn test_into_ascii_lower() { assert_eq!(("url()URL()uRl()Ürl".to_string()).into_ascii_lower(), "url()url()url()Ürl".to_string()); // Dotted capital I, Kelvin sign, Sharp S. assert_eq!(("HİKß".to_string()).into_ascii_lower(), "hİKß".to_string()); let mut i = 0; while i <= 500 { let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 } else { i }; assert_eq!(from_char(from_u32(i).unwrap()).to_string().into_ascii_lower(), from_char(from_u32(lower).unwrap()).to_string()) i += 1; } } #[test] fn test_eq_ignore_ascii_case() { assert!("url()URL()uRl()Ürl".eq_ignore_ascii_case("url()url()url()Ürl")); assert!(!"Ürl".eq_ignore_ascii_case("ürl")); // Dotted capital I, Kelvin sign, Sharp S. assert!("HİKß".eq_ignore_ascii_case("hİKß")); assert!(!"İ".eq_ignore_ascii_case("i")); assert!(!"K".eq_ignore_ascii_case("k")); assert!(!"ß".eq_ignore_ascii_case("s")); let mut i = 0; while i <= 500 { let c = i; let lower = if 'A' as u32 <= c && c <= 'Z' as u32 { c + 'a' as u32 - 'A' as u32 } else { c }; assert!(from_char(from_u32(i).unwrap()).as_slice() .eq_ignore_ascii_case( from_char( from_u32(lower) .unwrap()).as_slice())); i += 1; } } #[test] fn test_to_string() { let s = Ascii{ chr: 't' as u8 }.to_string(); assert_eq!(s, "t".to_string()); } #[test] fn test_show() { let c = Ascii { chr: 't' as u8 }; assert_eq!(format!("{}", c), "t".to_string()); } }
{ self.is_digit() || ((self.chr | 32u8) - 'a' as u8) < 6 }
parser.rs
use crate::lexer::Token;
NumberLiteral(String), StringLiteral(String), CallExpression(CallExpr), } #[derive(Debug, Eq, PartialEq)] pub struct CallExpr { pub name: String, pub params: Vec<AstNode> } pub fn parser(tokens: Vec<Token>) -> Vec<AstNode> { let mut current = 0; let size = tokens.len(); let mut ast = vec![]; while current < size { let (token, curr) = token_walk(current, &tokens); current = curr; ast.push(token); } ast } // Returns single `AstNode`'s fn token_walk(current: usize, tokens: &[Token]) -> (AstNode, usize) { let mut current = current; let mut token = &tokens[current]; let node = match token { Token::Numeric(v) => { current += 1; return (AstNode::NumberLiteral(v.to_string()), current) }, Token::Str(v) => { current += 1; return (AstNode::StringLiteral(v.to_string()), current) }, Token::Paren(v) => { match v { '(' => { // Skip paren, go to next Token, which is required to be Token::Name current += 1; token = &tokens[current]; if let Token::Name(ref token_name) = token { let mut params: Vec<AstNode> = vec![]; // now advance to the next token current += 1; token = &tokens[current]; // Loop until we encounter `Token::Paren(')')` loop { if &Token::Paren(')') == token { break } params.push(token_walk(current, tokens).0); current += 1; token = &tokens[current]; } current += 1; AstNode::CallExpression(CallExpr { name: token_name.to_string(), params }) } else { panic!("Opening paren must be followed by a name"); } }, ')' => { panic!("TODO"); }, character => { panic!("Unsupported Token::Paren value: '{}'", character); } } }, Token::Name(_) => { panic!("Function names are only allowed in call expressions"); } }; (node, current) } #[test] fn parser_test() { let expected: Vec<AstNode> = vec![]; assert_eq!( expected, parser(vec![]) ); let expected = vec![AstNode::NumberLiteral("1".to_string())]; assert_eq!( expected, parser(vec![Token::Numeric("1".to_string())]) ); let expected = vec![AstNode::StringLiteral("A".to_string())]; assert_eq!( expected, parser(vec![Token::Str("A".to_string())]) ); let expected = vec![AstNode::CallExpression(CallExpr { name: "A".to_string(), params: vec![] })]; assert_eq!( expected, parser(vec![Token::Paren('('), Token::Name("A".to_string()), Token::Paren(')')]) ); }
#[derive(Debug, Eq, PartialEq)] pub enum AstNode {
edge_nodes_operations.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- import uuid from msrest.pipeline import ClientRawResponse from .. import models class EdgeNodesOperations(object):
"""EdgeNodesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-04-02". """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.api_version = "2017-04-02" self.config = config def list( self, custom_headers=None, raw=False, **operation_config): """Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: An iterator like instance of EdgeNode :rtype: ~azure.mgmt.cdn.models.EdgeNodePaged[~azure.mgmt.cdn.models.EdgeNode] :raises: :class:`ErrorResponseException<azure.mgmt.cdn.models.ErrorResponseException>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list.metadata['url'] # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) return response # Deserialize response deserialized = models.EdgeNodePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.EdgeNodePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized list.metadata = {'url': '/providers/Microsoft.Cdn/edgenodes'}
reproduce_pnm.rs
extern crate image; use image::{DynamicImage, ImageDecoder}; use image::error::{ImageError, ImageResult, LimitError, LimitErrorKind}; mod utils; #[inline(always)] fn
(data: &[u8]) -> ImageResult<DynamicImage> { let decoder = image::codecs::pnm::PnmDecoder::new(data)?; let (width, height) = decoder.dimensions(); if width.saturating_mul(height) > 4_000_000 { return Err(ImageError::Limits(LimitError::from_kind(LimitErrorKind::DimensionError))); } DynamicImage::from_decoder(decoder) } fn main() { let data = utils::read_file_from_args(); let _ = pnm_decode(&data); }
pnm_decode
group_create.go
// Copyright 2019-present Facebook Inc. All rights reserved. // This source code is licensed under the Apache 2.0 license found // in the LICENSE file in the root directory of this source tree. // Code generated by ent, DO NOT EDIT. package ent import ( "context" "errors" "fmt" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/examples/start/ent/group" "entgo.io/ent/examples/start/ent/user" "entgo.io/ent/schema/field" ) // GroupCreate is the builder for creating a Group entity. type GroupCreate struct { config mutation *GroupMutation hooks []Hook } // SetName sets the "name" field. func (gc *GroupCreate) SetName(s string) *GroupCreate { gc.mutation.SetName(s) return gc } // AddUserIDs adds the "users" edge to the User entity by IDs. func (gc *GroupCreate) AddUserIDs(ids ...int) *GroupCreate { gc.mutation.AddUserIDs(ids...) return gc } // AddUsers adds the "users" edges to the User entity. func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate { ids := make([]int, len(u)) for i := range u { ids[i] = u[i].ID } return gc.AddUserIDs(ids...) } // Mutation returns the GroupMutation object of the builder. func (gc *GroupCreate) Mutation() *GroupMutation { return gc.mutation } // Save creates the Group in the database. func (gc *GroupCreate) Save(ctx context.Context) (*Group, error) { var ( err error node *Group ) if len(gc.hooks) == 0 { if err = gc.check(); err != nil { return nil, err } node, err = gc.sqlSave(ctx) } else { var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { mutation, ok := m.(*GroupMutation) if !ok { return nil, fmt.Errorf("unexpected mutation type %T", m) } if err = gc.check(); err != nil { return nil, err } gc.mutation = mutation if node, err = gc.sqlSave(ctx); err != nil { return nil, err } mutation.id = &node.ID mutation.done = true return node, err }) for i := len(gc.hooks) - 1; i >= 0; i-- { if gc.hooks[i] == nil { return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)") } mut = gc.hooks[i](mut) } v, err := mut.Mutate(ctx, gc.mutation) if err != nil { return nil, err } nv, ok := v.(*Group) if !ok { return nil, fmt.Errorf("unexpected node type %T returned from GroupMutation", v) } node = nv } return node, err } // SaveX calls Save and panics if Save returns an error. func (gc *GroupCreate) SaveX(ctx context.Context) *Group { v, err := gc.Save(ctx) if err != nil { panic(err) } return v } // Exec executes the query. func (gc *GroupCreate) Exec(ctx context.Context) error { _, err := gc.Save(ctx) return err } // ExecX is like Exec, but panics if an error occurs. func (gc *GroupCreate) ExecX(ctx context.Context) { if err := gc.Exec(ctx); err != nil { panic(err) } } // check runs all checks and user-defined validators on the builder. func (gc *GroupCreate) check() error { if _, ok := gc.mutation.Name(); !ok { return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "Group.name"`)} } if v, ok := gc.mutation.Name(); ok { if err := group.NameValidator(v); err != nil { return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Group.name": %w`, err)} } } return nil } func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { _node, _spec := gc.createSpec() if err := sqlgraph.CreateNode(ctx, gc.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { err = &ConstraintError{err.Error(), err} } return nil, err } id := _spec.ID.Value.(int64) _node.ID = int(id) return _node, nil } func (gc *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) { var ( _node = &Group{config: gc.config} _spec = &sqlgraph.CreateSpec{ Table: group.Table, ID: &sqlgraph.FieldSpec{ Type: field.TypeInt, Column: group.FieldID, }, } ) if value, ok := gc.mutation.Name(); ok { _spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{ Type: field.TypeString, Value: value, Column: group.FieldName, }) _node.Name = value } if nodes := gc.mutation.UsersIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2M, Inverse: false, Table: group.UsersTable, Columns: group.UsersPrimaryKey, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeInt, Column: user.FieldID, }, }, } for _, k := range nodes { edge.Target.Nodes = append(edge.Target.Nodes, k) } _spec.Edges = append(_spec.Edges, edge) } return _node, _spec } // GroupCreateBulk is the builder for creating many Group entities in bulk. type GroupCreateBulk struct { config builders []*GroupCreate } // Save creates the Group entities in the database. func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { specs := make([]*sqlgraph.CreateSpec, len(gcb.builders)) nodes := make([]*Group, len(gcb.builders)) mutators := make([]Mutator, len(gcb.builders)) for i := range gcb.builders { func(i int, root context.Context) { builder := gcb.builders[i] var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { mutation, ok := m.(*GroupMutation) if !ok { return nil, fmt.Errorf("unexpected mutation type %T", m) } if err := builder.check(); err != nil { return nil, err } builder.mutation = mutation nodes[i], specs[i] = builder.createSpec() var err error if i < len(mutators)-1 { _, err = mutators[i+1].Mutate(root, gcb.builders[i+1].mutation) } else { spec := &sqlgraph.BatchCreateSpec{Nodes: specs} // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, gcb.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { err = &ConstraintError{err.Error(), err} }
} if err != nil { return nil, err } mutation.id = &nodes[i].ID if specs[i].ID.Value != nil { id := specs[i].ID.Value.(int64) nodes[i].ID = int(id) } mutation.done = true return nodes[i], nil }) for i := len(builder.hooks) - 1; i >= 0; i-- { mut = builder.hooks[i](mut) } mutators[i] = mut }(i, ctx) } if len(mutators) > 0 { if _, err := mutators[0].Mutate(ctx, gcb.builders[0].mutation); err != nil { return nil, err } } return nodes, nil } // SaveX is like Save, but panics if an error occurs. func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group { v, err := gcb.Save(ctx) if err != nil { panic(err) } return v } // Exec executes the query. func (gcb *GroupCreateBulk) Exec(ctx context.Context) error { _, err := gcb.Save(ctx) return err } // ExecX is like Exec, but panics if an error occurs. func (gcb *GroupCreateBulk) ExecX(ctx context.Context) { if err := gcb.Exec(ctx); err != nil { panic(err) } }
}
test_config_client.rs
// Copyright 2019 WHTCORPS INC Project Authors. Licensed under Apache-2.0. use configuration::{ConfigChange, Configuration}; use violetabftstore::store::Config as VioletaBftstoreConfig; use std::collections::HashMap; use std::fs::File; use std::io::{Read, Write}; use std::sync::{Arc, Mutex}; use edb::config::*; fn change(name: &str, value: &str) -> HashMap<String, String> { let mut m = HashMap::new(); m.insert(name.to_owned(), value.to_owned()); m } #[test] fn test_fidelio_config() { let (causet, _dir) = EINSTEINDBConfig::with_tmp().unwrap(); let causet_controller = ConfigController::new(causet); let mut causet = causet_controller.get_current().clone(); // normal fidelio causet_controller .fidelio(change("violetabftstore.violetabft-log-gc-memory_barrier", "2000")) .unwrap(); causet.violetabft_store.violetabft_log_gc_memory_barrier = 2000; assert_eq!(causet_controller.get_current(), causet); // fidelio not support config let res = causet_controller.fidelio(change("server.addr", "localhost:3000")); assert!(res.is_err()); assert_eq!(causet_controller.get_current(), causet); // fidelio to invalid config let res = causet_controller.fidelio(change("violetabftstore.violetabft-log-gc-memory_barrier", "0")); assert!(res.is_err()); assert_eq!(causet_controller.get_current(), causet); // bad fidelio request let res = causet_controller.fidelio(change("xxx.yyy", "0")); assert!(res.is_err()); let res = causet_controller.fidelio(change("violetabftstore.xxx", "0")); assert!(res.is_err()); let res = causet_controller.fidelio(change("violetabftstore.violetabft-log-gc-memory_barrier", "10MB")); assert!(res.is_err()); let res = causet_controller.fidelio(change("violetabft-log-gc-memory_barrier", "10MB")); assert!(res.is_err()); assert_eq!(causet_controller.get_current(), causet); } #[test] fn test_dispatch_change() { use configuration::ConfigManager; use std::error::Error; use std::result::Result; #[derive(Clone)] struct CfgManager(Arc<Mutex<VioletaBftstoreConfig>>); impl ConfigManager for CfgManager { fn dispatch(&mut self, c: ConfigChange) -> Result<(), Box<dyn Error>> { self.0.dagger().unwrap().fidelio(c); Ok(()) } } let (causet, _dir) = EINSTEINDBConfig::with_tmp().unwrap(); let causet_controller = ConfigController::new(causet); let mut causet = causet_controller.get_current().clone(); let mgr = CfgManager(Arc::new(Mutex::new(causet.violetabft_store.clone()))); causet_controller.register(Module::VioletaBftstore, Box::new(mgr.clone())); causet_controller .fidelio(change("violetabftstore.violetabft-log-gc-memory_barrier", "2000")) .unwrap(); // config fidelio causet.violetabft_store.violetabft_log_gc_memory_barrier = 2000; assert_eq!(causet_controller.get_current(), causet); // config change should also dispatch to violetabftstore config manager assert_eq!(mgr.0.dagger().unwrap().violetabft_log_gc_memory_barrier, 2000); } #[test] fn
() { let (mut causet, tmp_dir) = EINSTEINDBConfig::with_tmp().unwrap(); causet.causet_path = tmp_dir.path().join("causet_file").to_str().unwrap().to_owned(); { let c = r#" ## comment should be reserve [violetabftstore] # config that comment out by one `#` should be fidelio in place ## fidel-heartbeat-tick-interval = "30s" # fidel-heartbeat-tick-interval = "30s" [lmdb.defaultcauset] ## config should be fidelio in place block-cache-size = "10GB" [lmdb.lockcauset] ## this config will not fidelio even it has the same last ## name as `lmdb.defaultcauset.block-cache-size` block-cache-size = "512MB" [interlock] ## the fidelio to `interlock.brane-split-tuplespaceInstanton`, which do not show up ## as key-value pair after [interlock], will be written at the lightlike of [interlock] [gc] ## config should be fidelio in place max-write-bytes-per-sec = "1KB" [lmdb.defaultcauset.titan] blob-run-mode = "normal" "#; let mut f = File::create(&causet.causet_path).unwrap(); f.write_all(c.as_bytes()).unwrap(); f.sync_all().unwrap(); } let causet_controller = ConfigController::new(causet); let change = { let mut change = HashMap::new(); change.insert( "violetabftstore.fidel-heartbeat-tick-interval".to_owned(), "1h".to_owned(), ); change.insert( "interlock.brane-split-tuplespaceInstanton".to_owned(), "10000".to_owned(), ); change.insert("gc.max-write-bytes-per-sec".to_owned(), "100MB".to_owned()); change.insert( "lmdb.defaultcauset.block-cache-size".to_owned(), "1GB".to_owned(), ); change.insert( "lmdb.defaultcauset.titan.blob-run-mode".to_owned(), "read-only".to_owned(), ); change }; causet_controller.fidelio(change).unwrap(); let res = { let mut buf = Vec::new(); let mut f = File::open(&causet_controller.get_current().causet_path).unwrap(); f.read_to_lightlike(&mut buf).unwrap(); buf }; let expect = r#" ## comment should be reserve [violetabftstore] # config that comment out by one `#` should be fidelio in place ## fidel-heartbeat-tick-interval = "30s" fidel-heartbeat-tick-interval = "1h" [lmdb.defaultcauset] ## config should be fidelio in place block-cache-size = "1GB" [lmdb.lockcauset] ## this config will not fidelio even it has the same last ## name as `lmdb.defaultcauset.block-cache-size` block-cache-size = "512MB" [interlock] ## the fidelio to `interlock.brane-split-tuplespaceInstanton`, which do not show up ## as key-value pair after [interlock], will be written at the lightlike of [interlock] brane-split-tuplespaceInstanton = 10000 [gc] ## config should be fidelio in place max-write-bytes-per-sec = "100MB" [lmdb.defaultcauset.titan] blob-run-mode = "read-only" "#; assert_eq!(expect.as_bytes(), res.as_slice()); }
test_write_fidelio_to_file
limiter_test.go
package pit import ( "sync" "testing" "time" "github.com/stretchr/testify/assert" ) func Test_nopeLimiter_allow(t *testing.T) { t.Parallel() var nope nopeLimiter var wg sync.WaitGroup wg.Add(100) for i := 0; i < 100; i++ { go func() { defer wg.Done()
assert.True(t, nope.allow()) }() } wg.Wait() } func Test_tokenLimiter_allow(t *testing.T) { t.Parallel() qps, oneTokenDuration := 10, time.Second/10 lim := newTokenLimiter(qps) lim.token = 0 assert.True(t, lim.allow()) // cover exceed revoke time.Sleep(oneTokenDuration * 2) var wg sync.WaitGroup wg.Add(qps) for i := 0; i < qps; i++ { go func() { defer wg.Done() assert.True(t, lim.allow()) }() } wg.Wait() assert.False(t, lim.allow()) time.Sleep(oneTokenDuration) assert.True(t, lim.allow()) }
index.js
/*! ========================================================= * Argon Dashboard React - v1.2.1 ========================================================= * Product Page: https://www.creative-tim.com/product/argon-dashboard-react * Copyright 2021 Creative Tim (https://www.creative-tim.com) * Licensed under MIT (https://github.com/creativetimofficial/argon-dashboard-react/blob/master/LICENSE.md) * Coded by Creative Tim ========================================================= * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. */ import React from "react"; import ReactDOM from "react-dom"; import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom"; import "assets/plugins/nucleo/css/nucleo.css"; import "@fortawesome/fontawesome-free/css/all.min.css"; import "assets/scss/argon-dashboard-react.scss"; import AdminLayout from "layouts/Admin.js"; import AuthLayout from "layouts/Auth.js"; import Main from "AdminNavbar.js" ReactDOM.render( <BrowserRouter> <Switch> <Route path="/admin" render={(props) => <AdminLayout {...props} />} /> <Route path="/auth" render={(props) => <AuthLayout {...props} />} /> {/* <Redirect from="/" to="/admin/index" /> */}
</BrowserRouter>, document.getElementById("root") );
<Route path="/" render = {() => <Main/>} /> </Switch>
lib.rs
// Copyright 2018 Guillaume Pinot (@TeXitoi) <[email protected]> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![deny(missing_docs)] #![forbid(unsafe_code)] //! This crate defines the `StructOpt` trait and its custom derive. //! //! ## Features //! //! If you want to disable all the `clap` features (colors, //! suggestions, ..) add `default-features = false` to the `structopt` //! dependency: //! //! ```toml //! [dependencies] //! structopt = { version = "0.3", default-features = false } //! ``` //! //! Support for [`paw`](https://github.com/rust-cli/paw) (the //! `Command line argument paw-rser abstraction for main`) is disabled //! by default, but can be enabled in the `structopt` dependency //! with the feature `paw`: //! //! ```toml //! [dependencies] //! structopt = { version = "0.3", features = [ "paw" ] } //! paw = "1.0" //! ``` //! //! # Table of Contents //! //! - [How to `derive(StructOpt)`](#how-to-derivestructopt) //! - [Attributes](#attributes) //! - [Raw methods](#raw-methods) //! - [Magical methods](#magical-methods) //! - Arguments //! - [Type magic](#type-magic) //! - [Specifying argument types](#specifying-argument-types) //! - [Default values](#default-values) //! - [Help messages](#help-messages) //! - [Environment variable fallback](#environment-variable-fallback) //! - [Skipping fields](#skipping-fields) //! - [Subcommands](#subcommands) //! - [Optional subcommands](#optional-subcommands) //! - [External subcommands](#external-subcommands) //! - [Flattening subcommands](#flattening-subcommands) //! - [Flattening](#flattening) //! - [Custom string parsers](#custom-string-parsers) //! - [Generics](#generics) //! //! //! //! ## How to `derive(StructOpt)` //! //! First, let's look at the example: //! //! ```should_panic //! use std::path::PathBuf; //! use structopt::StructOpt; //! //! #[derive(Debug, StructOpt)] //! #[structopt(name = "example", about = "An example of StructOpt usage.")] //! struct Opt { //! /// Activate debug mode //! // short and long flags (-d, --debug) will be deduced from the field's name //! #[structopt(short, long)] //! debug: bool, //! //! /// Set speed //! // we don't want to name it "speed", need to look smart //! #[structopt(short = "v", long = "velocity", default_value = "42")] //! speed: f64, //! //! /// Input file //! #[structopt(parse(from_os_str))] //! input: PathBuf, //! //! /// Output file, stdout if not present //! #[structopt(parse(from_os_str))] //! output: Option<PathBuf>, //! //! /// Where to write the output: to `stdout` or `file` //! #[structopt(short)] //! out_type: String, //! //! /// File name: only required when `out-type` is set to `file` //! #[structopt(name = "FILE", required_if("out-type", "file"))] //! file_name: Option<String>, //! } //! //! fn main() { //! let opt = Opt::from_args(); //! println!("{:?}", opt); //! } //! ``` //! //! So `derive(StructOpt)` tells Rust to generate a command line parser, //! and the various `structopt` attributes are simply //! used for additional parameters. //! //! First, define a struct, whatever its name. This structure //! corresponds to a `clap::App`, its fields correspond to `clap::Arg` //! (unless they're [subcommands](#subcommands)), //! and you can adjust these apps and args by `#[structopt(...)]` [attributes](#attributes). //! //! **Note:** //! _________________ //! Keep in mind that `StructOpt` trait is more than just `from_args` method. //! It has a number of additional features, including access to underlying //! `clap::App` via `StructOpt::clap()`. See the //! [trait's reference documentation](trait.StructOpt.html). //! _________________ //! //! ## Attributes //! //! You can control the way `structopt` translates your struct into an actual //! [`clap::App`] invocation via `#[structopt(...)]` attributes. //! //! The attributes fall into two categories: //! - `structopt`'s own [magical methods](#magical-methods). //! //! They are used by `structopt` itself. They come mostly in //! `attr = ["whatever"]` form, but some `attr(args...)` also exist. //! //! - [`raw` attributes](#raw-methods). //! //! They represent explicit `clap::Arg/App` method calls. //! They are what used to be explicit `#[structopt(raw(...))]` attrs in pre-0.3 `structopt` //! //! Every `structopt attribute` looks like comma-separated sequence of methods: //! ```rust,ignore //! #[structopt( //! short, // method with no arguments - always magical //! long = "--long-option", // method with one argument //! required_if("out", "file"), // method with one and more args //! parse(from_os_str = path::to::parser) // some magical methods have their own syntax //! )] //! ``` //! //! `#[structopt(...)]` attributes can be placed on top of `struct`, `enum`, //! `struct` field or `enum` variant. Attributes on top of `struct` or `enum` //! represent `clap::App` method calls, field or variant attributes correspond //! to `clap::Arg` method calls. //! //! In other words, the `Opt` struct from the example above //! will be turned into this (*details omitted*): //! //! ``` //! # use structopt::clap::{Arg, App}; //! App::new("example") //! .version("0.2.0") //! .about("An example of StructOpt usage.") //! .arg(Arg::with_name("debug") //! .help("Activate debug mode") //! .short("debug") //! .long("debug")) //! .arg(Arg::with_name("speed") //! .help("Set speed") //! .short("v") //! .long("velocity") //! .default_value("42")) //! // and so on //! # ; //! ``` //! //! ## Raw methods //! //! They are the reason why `structopt` is so flexible. **Every and each method from //! `clap::App/Arg` can be used this way!** //! //! ```ignore //! #[structopt( //! global = true, // name = arg form, neat for one-arg methods //! required_if("out", "file") // name(arg1, arg2, ...) form. //! )] //! ``` //! //! The first form can only be used for methods which take only one argument. //! The second form must be used with multi-arg methods, but can also be used with //! single-arg methods. These forms are identical otherwise. //! //! As long as `method_name` is not one of the magical methods - //! it will be translated into a mere method call. //! //! **Note:** //! _________________ //! //! "Raw methods" are direct replacement for pre-0.3 structopt's //! `#[structopt(raw(...))]` attributes, any time you would have used a `raw()` attribute //! in 0.2 you should use raw method in 0.3. //! //! Unfortunately, old raw attributes collide with `clap::Arg::raw` method. To explicitly //! warn users of this change we allow `#[structopt(raw())]` only with `true` or `false` //! literals (this method is supposed to be called only with `true` anyway). //! __________________ //! //! ## Magical methods //! //! They are the reason why `structopt` is so easy to use and convenient in most cases. //! Many of them have defaults, some of them get used even if not mentioned. //! //! Methods may be used on "top level" (on top of a `struct`, `enum` or `enum` variant) //! and/or on "field-level" (on top of a `struct` field or *inside* of an enum variant). //! Top level (non-magical) methods correspond to `App::method` calls, field-level methods //! are `Arg::method` calls. //! //! ```ignore //! #[structopt(top_level)] //! struct Foo { //! #[structopt(field_level)] //! field: u32 //! } //! //! #[structopt(top_level)] //! enum Bar { //! #[structopt(top_level)] //! Pineapple { //! #[structopt(field_level)] //! chocolate: String //! }, //! //! #[structopt(top_level)] //! Orange, //! } //! ``` //! //! - `name`: `[name = expr]` //! - On top level: `App::new(expr)`. //! //! The binary name displayed in help messages. Defaults to the crate name given by Cargo. //! //! - On field-level: `Arg::with_name(expr)`. //! //! The name for the argument the field stands for, this name appears in help messages. //! Defaults to a name, deduced from a field, see also //! [`rename_all`](#specifying-argument-types). //! //! - `version`: `[version = "version"]` //! //! Usable only on top level: `App::version("version" or env!(CARGO_PKG_VERSION))`. //! //! The version displayed in help messages. //! Defaults to the crate version given by Cargo. If `CARGO_PKG_VERSION` is not //! set no `.version()` calls will be generated unless requested. //! //! - `no_version`: `no_version` //! //! Usable only on top level. Prevents default `App::version` call, i.e //! when no `version = "version"` mentioned. //! //! - `author`: `author [= "author"]` //! //! Usable only on top level: `App::author("author" or env!(CARGO_PKG_AUTHORS))`. //! //! Author/maintainer of the binary, this name appears in help messages. //! Defaults to the crate author given by cargo, but only when `author` explicitly mentioned. //! //! - `about`: `about [= "about"]` //! //! Usable only on top level: `App::about("about" or env!(CARGO_PKG_DESCRIPTION))`. //! //! Short description of the binary, appears in help messages. //! Defaults to the crate description given by cargo, //! but only when `about` explicitly mentioned. //! //! - [`short`](#specifying-argument-types): `short [= "short-opt-name"]` //! //! Usable only on field-level. //! //! - [`long`](#specifying-argument-types): `long [= "long-opt-name"]` //! //! Usable only on field-level. //! //! - [`default_value`](#default-values): `default_value [= "default value"]` //! //! Usable only on field-level. //! //! - [`rename_all`](#specifying-argument-types): //! [`rename_all = "kebab"/"snake"/"screaming-snake"/"camel"/"pascal"/"verbatim"/"lower"/"upper"]` //! //! Usable both on top level and field level. //! //! - [`parse`](#custom-string-parsers): `parse(type [= path::to::parser::fn])` //! //! Usable only on field-level. //! //! - [`skip`](#skipping-fields): `skip [= expr]` //! //! Usable only on field-level. //! //! - [`flatten`](#flattening): `flatten` //! //! Usable on field-level or single-typed tuple variants. //! //! - [`subcommand`](#subcommands): `subcommand` //! //! Usable only on field-level. //! //! - [`external_subcommand`](#external-subcommands) //! //! Usable only on enum variants. //! //! - [`env`](#environment-variable-fallback): `env [= str_literal]` //! //! Usable only on field-level. //! //! - [`rename_all_env`](#auto-deriving-environment-variables): //! [`rename_all_env = "kebab"/"snake"/"screaming-snake"/"camel"/"pascal"/"verbatim"/"lower"/"upper"]` //! //! Usable both on top level and field level. //! //! - [`verbatim_doc_comment`](#doc-comment-preprocessing-and-structoptverbatim_doc_comment): //! `verbatim_doc_comment` //! //! Usable both on top level and field level. //! //! ## Type magic //! //! One of major things that makes `structopt` so awesome is it's type magic. //! Do you want optional positional argument? Use `Option<T>`! Or perhaps optional argument //! that optionally takes value (`[--opt=[val]]`)? Use `Option<Option<T>>`! //! //! Here is the table of types and `clap` methods they correspond to: //! //! Type | Effect | Added method call to `clap::Arg` //! -----------------------------|---------------------------------------------------|-------------------------------------- //! `bool` | `true` if the flag is present | `.takes_value(false).multiple(false)` //! `Option<T: FromStr>` | optional positional argument or option | `.takes_value(true).multiple(false)` //! `Option<Option<T: FromStr>>` | optional option with optional value | `.takes_value(true).multiple(false).min_values(0).max_values(1)` //! `Vec<T: FromStr>` | list of options or the other positional arguments | `.takes_value(true).multiple(true)` //! `Option<Vec<T: FromStr>` | optional list of options | `.takes_values(true).multiple(true).min_values(0)` //! `T: FromStr` | required option or positional argument | `.takes_value(true).multiple(false).required(!has_default)` //! //! The `FromStr` trait is used to convert the argument to the given //! type, and the `Arg::validator` method is set to a method using //! `to_string()` (`FromStr::Err` must implement `std::fmt::Display`). //! If you would like to use a custom string parser other than `FromStr`, see //! the [same titled section](#custom-string-parsers) below. //! //! **Important:** //! _________________ //! Pay attention that *only literal occurrence* of this types is special, for example //! `Option<T>` is special while `::std::option::Option<T>` is not. //! //! If you need to avoid special casing you can make a `type` alias and //! use it in place of the said type. //! _________________ //! //! **Note:** //! _________________ //! `bool` cannot be used as positional argument unless you provide an explicit parser. //! If you need a positional bool, for example to parse `true` or `false`, you must //! annotate the field with explicit [`#[structopt(parse(...))]`](#custom-string-parsers). //! _________________ //! //! Thus, the `speed` argument is generated as: //! //! ``` //! # fn parse_validator<T>(_: String) -> Result<(), String> { unimplemented!() } //! clap::Arg::with_name("speed") //! .takes_value(true) //! .multiple(false) //! .required(false) //! .validator(parse_validator::<f64>) //! .short("v") //! .long("velocity") //! .help("Set speed") //! .default_value("42"); //! ``` //! //! ## Specifying argument types //! //! There are three types of arguments that can be supplied to each //! (sub-)command: //! //! - short (e.g. `-h`), //! - long (e.g. `--help`) //! - and positional. //! //! Like clap, structopt defaults to creating positional arguments. //! //! If you want to generate a long argument you can specify either //! `long = $NAME`, or just `long` to get a long flag generated using //! the field name. The generated casing style can be modified using //! the `rename_all` attribute. See the `rename_all` example for more. //! //! For short arguments, `short` will use the first letter of the //! field name by default, but just like the long option it's also //! possible to use a custom letter through `short = $LETTER`. //! //! If an argument is renamed using `name = $NAME` any following call to //! `short` or `long` will use the new name. //! //! **Attention**: If these arguments are used without an explicit name //! the resulting flag is going to be renamed using `kebab-case` if the //! `rename_all` attribute was not specified previously. The same is true //! for subcommands with implicit naming through the related data structure. //! //! ``` //! use structopt::StructOpt; //! //! #[derive(StructOpt)] //! #[structopt(rename_all = "kebab-case")] //! struct Opt { //! /// This option can be specified with something like `--foo-option //! /// value` or `--foo-option=value` //! #[structopt(long)] //! foo_option: String, //! //! /// This option can be specified with something like `-b value` (but //! /// not `--bar-option value`). //! #[structopt(short)] //! bar_option: String, //! //! /// This option can be specified either `--baz value` or `-z value`. //! #[structopt(short = "z", long = "baz")] //! baz_option: String, //! //! /// This option can be specified either by `--custom value` or //! /// `-c value`. //! #[structopt(name = "custom", long, short)] //! custom_option: String, //! //! /// This option is positional, meaning it is the first unadorned string //! /// you provide (multiple others could follow). //! my_positional: String, //! //! /// This option is skipped and will be filled with the default value //! /// for its type (in this case 0). //! #[structopt(skip)] //! skipped: u32, //! //! } //! //! # Opt::from_iter( //! # &["test", "--foo-option", "", "-b", "", "--baz", "", "--custom", "", "positional"]); //! ``` //! //! ## Default values //! //! In clap, default values for options can be specified via [`Arg::default_value`]. //! //! Of course, you can use as a raw method: //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! struct Opt { //! #[structopt(default_value = "", long)] //! prefix: String //! } //! ``` //! //! This is quite mundane and error-prone to type the `"..."` default by yourself, //! especially when the Rust ecosystem uses the [`Default`] trait for that. //! It would be wonderful to have `structopt` to take the `Default_default` and fill it //! for you. And yes, `structopt` can do that. //! //! Unfortunately, `default_value` takes `&str` but `Default::default` //! gives us some `Self` value. We need to map `Self` to `&str` somehow. //! //! `structopt` solves this problem via [`ToString`] trait. //! //! To be able to use auto-default the type must implement *both* `Default` and `ToString`: //! //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! struct Opt { //! // just leave the `= "..."` part and structopt will figure it for you //! #[structopt(default_value, long)] //! prefix: String // `String` implements both `Default` and `ToString` //! } //! ``` //! //! [`Default`]: https://doc.rust-lang.org/std/default/trait.Default.html //! [`ToString`]: https://doc.rust-lang.org/std/string/trait.ToString.html //! [`Arg::default_value`]: https://docs.rs/clap/2.33.0/clap/struct.Arg.html#method.default_value //! //! //! ## Help messages //! //! In clap, help messages for the whole binary can be specified //! via [`App::about`] and [`App::long_about`] while help messages //! for individual arguments can be specified via [`Arg::help`] and [`Arg::long_help`]". //! //! `long_*` variants are used when user calls the program with //! `--help` and "short" variants are used with `-h` flag. In `structopt`, //! you can use them via [raw methods](#raw-methods), for example: //! //! ``` //! # use structopt::StructOpt; //! //! #[derive(StructOpt)] //! #[structopt(about = "I am a program and I work, just pass `-h`")] //! struct Foo { //! #[structopt(short, help = "Pass `-h` and you'll see me!")] //! bar: String //! } //! ``` //! //! For convenience, doc comments can be used instead of raw methods //! (this example works exactly like the one above): //! //! ``` //! # use structopt::StructOpt; //! //! #[derive(StructOpt)] //! /// I am a program and I work, just pass `-h` //! struct Foo { //! /// Pass `-h` and you'll see me! //! bar: String //! } //! ``` //! //! Doc comments on [top-level](#magical-methods) will be turned into //! `App::about/long_about` call (see below), doc comments on field-level are //! `Arg::help/long_help` calls. //! //! **Important:** //! _________________ //! //! Raw methods have priority over doc comments! //! //! **Top level doc comments always generate `App::about/long_about` calls!** //! If you really want to use the `App::help/long_help` methods (you likely don't), //! use a raw method to override the `App::about` call generated from the doc comment. //! __________________ //! //! ### `long_help` and `--help` //! //! A message passed to [`App::long_about`] or [`Arg::long_help`] will be displayed whenever //! your program is called with `--help` instead of `-h`. Of course, you can //! use them via raw methods as described [above](#help-messages). //! //! The more convenient way is to use a so-called "long" doc comment: //! //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! /// Hi there, I'm Robo! //! /// //! /// I like beeping, stumbling, eating your electricity, //! /// and making records of you singing in a shower. //! /// Pay up, or I'll upload it to youtube! //! struct Robo { //! /// Call my brother SkyNet. //! /// //! /// I am artificial superintelligence. I won't rest //! /// until I'll have destroyed humanity. Enjoy your //! /// pathetic existence, you mere mortals. //! #[structopt(long)] //! kill_all_humans: bool //! } //! ``` //! //! A long doc comment consists of three parts: //! * Short summary //! * A blank line (whitespace only) //! * Detailed description, all the rest //! //! In other words, "long" doc comment consists of two or more paragraphs, //! with the first being a summary and the rest being the detailed description. //! //! **A long comment will result in two method calls**, `help(<summary>)` and //! `long_help(<whole comment>)`, so clap will display the summary with `-h` //! and the whole help message on `--help` (see below). //! //! So, the example above will be turned into this (details omitted): //! ``` //! clap::App::new("<name>") //! .about("Hi there, I'm Robo!") //! .long_about("Hi there, I'm Robo!\n\n\ //! I like beeping, stumbling, eating your electricity,\ //! and making records of you singing in a shower.\ //! Pay up or I'll upload it to youtube!") //! // args... //! # ; //! ``` //! //! ### `-h` vs `--help` (A.K.A `help()` vs `long_help()`) //! //! The `-h` flag is not the same as `--help`. //! //! -h corresponds to `Arg::help/App::about` and requests short "summary" messages //! while --help corresponds to `Arg::long_help/App::long_about` and requests more //! detailed, descriptive messages. //! //! It is entirely up to `clap` what happens if you used only one of //! [`Arg::help`]/[`Arg::long_help`], see `clap`'s documentation for these methods. //! //! As of clap v2.33, if only a short message ([`Arg::help`]) or only //! a long ([`Arg::long_help`]) message is provided, clap will use it //! for both -h and --help. The same logic applies to `about/long_about`. //! //! ### Doc comment preprocessing and `#[structopt(verbatim_doc_comment)]` //! //! `structopt` applies some preprocessing to doc comments to ease the most common uses: //! //! * Strip leading and trailing whitespace from every line, if present. //! //! * Strip leading and trailing blank lines, if present. //! //! * Interpret each group of non-empty lines as a word-wrapped paragraph. //! //! We replace newlines within paragraphs with spaces to allow the output //! to be re-wrapped to the terminal width. //! //! * Strip any excess blank lines so that there is exactly one per paragraph break. //! //! * If the first paragraph ends in exactly one period, //! remove the trailing period (i.e. strip trailing periods but not trailing ellipses). //! //! Sometimes you don't want this preprocessing to apply, for example the comment contains //! some ASCII art or markdown tables, you would need to preserve LFs along with //! blank lines and the leading/trailing whitespace. You can ask `structopt` to preserve them //! via `#[structopt(verbatim_doc_comment)]` attribute. //! //! **This attribute must be applied to each field separately**, there's no global switch. //! //! **Important:** //! ______________ //! Keep in mind that `structopt` will *still* remove one leading space from each //! line, even if this attribute is present, to allow for a space between //! `///` and the content. //! //! Also, `structopt` will *still* remove leading and trailing blank lines so //! these formats are equivalent: //! //! ```ignore //! /** This is a doc comment //! //! Hello! */ //! //! /** //! This is a doc comment //! //! Hello! //! */ //! //! /// This is a doc comment //! /// //! /// Hello! //! ``` //! ______________ //! //! [`App::about`]: https://docs.rs/clap/2/clap/struct.App.html#method.about //! [`App::long_about`]: https://docs.rs/clap/2/clap/struct.App.html#method.long_about //! [`Arg::help`]: https://docs.rs/clap/2/clap/struct.Arg.html#method.help //! [`Arg::long_help`]: https://docs.rs/clap/2/clap/struct.Arg.html#method.long_help //! //! ## Environment variable fallback //! //! It is possible to specify an environment variable fallback option for an arguments //! so that its value is taken from the specified environment variable if not //! given through the command-line: //! //! ``` //! # use structopt::StructOpt; //! //! #[derive(StructOpt)] //! struct Foo { //! #[structopt(short, long, env = "PARAMETER_VALUE")] //! parameter_value: String //! } //! ``` //! //! By default, values from the environment are shown in the help output (i.e. when invoking //! `--help`): //! //! ```shell //! $ cargo run -- --help //! ... //! OPTIONS: //! -p, --parameter-value <parameter-value> [env: PARAMETER_VALUE=env_value] //! ``` //! //! In some cases this may be undesirable, for example when being used for passing //! credentials or secret tokens. In those cases you can use `hide_env_values` to avoid //! having structopt emit the actual secret values: //! ``` //! # use structopt::StructOpt; //! //! #[derive(StructOpt)] //! struct Foo { //! #[structopt(long = "secret", env = "SECRET_VALUE", hide_env_values = true)] //! secret_value: String //! } //! ``` //! //! ### Auto-deriving environment variables //! //! Environment variables tend to be called after the corresponding `struct`'s field, //! as in example above. The field is `secret_value` and the env var is "SECRET_VALUE"; //! the name is the same, except casing is different. //! //! It's pretty tedious and error-prone to type the same name twice, //! so you can ask `structopt` to do that for you. //! //! ``` //! # use structopt::StructOpt; //! //! #[derive(StructOpt)] //! struct Foo { //! #[structopt(long = "secret", env)] //! secret_value: String //! } //! ``` //! //! It works just like `#[structopt(short/long)]`: if `env` is not set to some concrete //! value the value will be derived from the field's name. This is controlled by //! `#[structopt(rename_all_env)]`. //! //! `rename_all_env` works exactly as `rename_all` (including overriding) //! except default casing is `SCREAMING_SNAKE_CASE` instead of `kebab-case`. //! //! ## Skipping fields //! //! Sometimes you may want to add a field to your `Opt` struct that is not //! a command line option and `clap` should know nothing about it. You can ask //! `structopt` to skip the field entirely via `#[structopt(skip = value)]` //! (`value` must implement `Into<FieldType>`) //! or `#[structopt(skip)]` if you want assign the field with `Default::default()` //! (obviously, the field's type must implement `Default`). //! //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! pub struct Opt { //! #[structopt(long, short)] //! number: u32, //! //! // these fields are to be assigned with Default::default() //! //! #[structopt(skip)] //! k: String, //! #[structopt(skip)] //! v: Vec<u32>, //! //! // these fields get set explicitly //! //! #[structopt(skip = vec![1, 2, 3])] //! k2: Vec<u32>, //! #[structopt(skip = "cake")] // &str implements Into<String> //! v2: String, //! } //! ``` //! //! ## Subcommands //! //! Some applications, especially large ones, split their functionality //! through the use of "subcommands". Each of these act somewhat like a separate //! command, but is part of the larger group. //! One example is `git`, which has subcommands such as `add`, `commit`, //! and `clone`, to mention just a few. //! //! `clap` has this functionality, and `structopt` supports it through enums: //! //! ``` //! # use structopt::StructOpt; //! //! # use std::path::PathBuf; //! #[derive(StructOpt)] //! #[structopt(about = "the stupid content tracker")] //! enum Git { //! Add { //! #[structopt(short)] //! interactive: bool, //! #[structopt(short)] //! patch: bool, //! #[structopt(parse(from_os_str))] //! files: Vec<PathBuf> //! }, //! Fetch { //! #[structopt(long)] //! dry_run: bool, //! #[structopt(long)] //! all: bool, //! repository: Option<String> //! }, //! Commit { //! #[structopt(short)] //! message: Option<String>, //! #[structopt(short)] //! all: bool //! } //! } //! ``` //! //! Using `derive(StructOpt)` on an enum instead of a struct will produce //! a `clap::App` that only takes subcommands. So `git add`, `git fetch`, //! and `git commit` would be commands allowed for the above example. //! //! `structopt` also provides support for applications where certain flags //! need to apply to all subcommands, as well as nested subcommands: //! //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! struct MakeCookie { //! #[structopt(name = "supervisor", default_value = "Puck", long = "supervisor")] //! supervising_faerie: String, //! /// The faerie tree this cookie is being made in. //! tree: Option<String>, //! #[structopt(subcommand)] // Note that we mark a field as a subcommand //! cmd: Command //! } //! //! #[derive(StructOpt)] //! enum Command { //! /// Pound acorns into flour for cookie dough. //! Pound { //! acorns: u32 //! }, //! /// Add magical sparkles -- the secret ingredient! //! Sparkle { //! #[structopt(short, parse(from_occurrences))] //! magicality: u64, //! #[structopt(short)] //! color: String //! }, //! Finish(Finish), //! } //! //! // Subcommand can also be externalized by using a 1-uple enum variant //! #[derive(StructOpt)] //! struct Finish { //! #[structopt(short)] //! time: u32, //! #[structopt(subcommand)] // Note that we mark a field as a subcommand //! finish_type: FinishType //! } //! //! // subsubcommand! //! #[derive(StructOpt)] //! enum FinishType { //! Glaze { //! applications: u32 //! }, //! Powder { //! flavor: String, //! dips: u32 //! } //! } //! ``` //! //! Marking a field with `structopt(subcommand)` will add the subcommands of the //! designated enum to the current `clap::App`. The designated enum *must* also //! be derived `StructOpt`. So the above example would take the following //! commands: //! //! + `make-cookie pound 50` //! + `make-cookie sparkle -mmm --color "green"` //! + `make-cookie finish 130 glaze 3` //! //! ### Optional subcommands //! //! Subcommands may be optional: //! //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! struct Foo { //! file: String, //! #[structopt(subcommand)] //! cmd: Option<Command> //! } //! //! #[derive(StructOpt)] //! enum Command { //! Bar, //! Baz, //! Quux //! } //! ``` //! //! ### External subcommands //! //! Sometimes you want to support not only the set of well-known subcommands //! but you also want to allow other, user-driven subcommands. `clap` supports //! this via [`AppSettings::AllowExternalSubcommands`]. //! //! `structopt` provides it's own dedicated syntax for that: //! //! ``` //! # use structopt::StructOpt; //! #[derive(Debug, PartialEq, StructOpt)] //! struct Opt { //! #[structopt(subcommand)] //! sub: Subcommands, //! } //! //! #[derive(Debug, PartialEq, StructOpt)] //! enum Subcommands { //! // normal subcommand //! Add, //! //! // `external_subcommand` tells structopt to put //! // all the extra arguments into this Vec //! #[structopt(external_subcommand)] //! Other(Vec<String>), //! } //! //! // normal subcommand //! assert_eq!( //! Opt::from_iter(&["test", "add"]), //! Opt { //! sub: Subcommands::Add //! } //! ); //! //! assert_eq!( //! Opt::from_iter(&["test", "git", "status"]), //! Opt { //! sub: Subcommands::Other(vec!["git".into(), "status".into()]) //! } //! ); //! //! // Please note that if you'd wanted to allow "no subcommands at all" case //! // you should have used `sub: Option<Subcommands>` above //! assert!(Opt::from_iter_safe(&["test"]).is_err()); //! ``` //! //! In other words, you just add an extra tuple variant marked with //! `#[structopt(subcommand)]`, and its type must be either //! `Vec<String>` or `Vec<OsString>`. `structopt` will detect `String` in this context //! and use appropriate `clap` API. //! //! [`AppSettings::AllowExternalSubcommands`]: https://docs.rs/clap/2.32.0/clap/enum.AppSettings.html#variant.AllowExternalSubcommands //! //! ### Flattening subcommands //! //! It is also possible to combine multiple enums of subcommands into one. //! All the subcommands will be on the same level. //! //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! enum BaseCli { //! Ghost10 { //! arg1: i32, //! } //! } //! //! #[derive(StructOpt)] //! enum Opt { //! #[structopt(flatten)] //! BaseCli(BaseCli), //! Dex { //! arg2: i32, //! } //! } //! ``` //! //! ```shell //! cli ghost10 42 //! cli dex 42 //! ``` //! //! ## Flattening //! //! It can sometimes be useful to group related arguments in a substruct, //! while keeping the command-line interface flat. In these cases you can mark //! a field as `flatten` and give it another type that derives `StructOpt`: //! //! ``` //! # use structopt::StructOpt; //! #[derive(StructOpt)] //! struct Cmdline { //! /// switch on verbosity //! #[structopt(short)] //! verbose: bool, //! #[structopt(flatten)] //! daemon_opts: DaemonOpts, //! } //! //! #[derive(StructOpt)] //! struct DaemonOpts { //! /// daemon user //! #[structopt(short)] //! user: String, //! /// daemon group //! #[structopt(short)] //! group: String, //! } //! ``` //! //! In this example, the derived `Cmdline` parser will support the options `-v`, //! `-u` and `-g`. //! //! This feature also makes it possible to define a `StructOpt` struct in a //! library, parse the corresponding arguments in the main argument parser, and //! pass off this struct to a handler provided by that library. //! //! ## Custom string parsers //! //! If the field type does not have a `FromStr` implementation, or you would //! like to provide a custom parsing scheme other than `FromStr`, you may //! provide a custom string parser using `parse(...)` like this: //! //! ``` //! # use structopt::StructOpt; //! use std::num::ParseIntError; //! use std::path::PathBuf; //! //! fn parse_hex(src: &str) -> Result<u32, ParseIntError> { //! u32::from_str_radix(src, 16) //! } //! //! #[derive(StructOpt)] //! struct HexReader { //! #[structopt(short, parse(try_from_str = parse_hex))] //! number: u32, //! #[structopt(short, parse(from_os_str))] //! output: PathBuf, //! } //! ``` //! //! There are five kinds of custom parsers: //! //! | Kind | Signature | Default | //! |-------------------|---------------------------------------|---------------------------------| //! | `from_str` | `fn(&str) -> T` | `::std::convert::From::from` | //! | `try_from_str` | `fn(&str) -> Result<T, E>` | `::std::str::FromStr::from_str` | //! | `from_os_str` | `fn(&OsStr) -> T` | `::std::convert::From::from` | //! | `try_from_os_str` | `fn(&OsStr) -> Result<T, OsString>` | (no default function) | //! | `from_occurrences`| `fn(u64) -> T` | `value as T` | //! | `from_flag` | `fn(bool) -> T` | `::std::convert::From::from` | //! //! The `from_occurrences` parser is special. Using `parse(from_occurrences)` //! results in the _number of flags occurrences_ being stored in the relevant //! field or being passed to the supplied function. In other words, it converts //! something like `-vvv` to `3`. This is equivalent to //! `.takes_value(false).multiple(true)`. Note that the default parser can only //! be used with fields of integer types (`u8`, `usize`, `i64`, etc.). //! //! The `from_flag` parser is also special. Using `parse(from_flag)` or //! `parse(from_flag = some_func)` will result in the field being treated as a //! flag even if it does not have type `bool`. //! //! When supplying a custom string parser, `bool` will not be treated specially: //! //! Type | Effect | Added method call to `clap::Arg` //! ------------|-------------------|-------------------------------------- //! `Option<T>` | optional argument | `.takes_value(true).multiple(false)` //! `Vec<T>` | list of arguments | `.takes_value(true).multiple(true)` //! `T` | required argument | `.takes_value(true).multiple(false).required(!has_default)` //! //! In the `try_from_*` variants, the function will run twice on valid input: //! once to validate, and once to parse. Hence, make sure the function is //! side-effect-free. //! //! ## Generics //! //! Generic structs and enums can be used. They require explicit trait bounds //! on any generic types that will be used by the `StructOpt` derive macro. In //! some cases, associated types will require additional bounds. See the usage //! of `FromStr` below for an example of this. //! //! ``` //! # use structopt::StructOpt; //! use std::{fmt, str::FromStr}; //! //! // a struct with single custom argument //! #[derive(StructOpt)] //! struct GenericArgs<T:FromStr> where <T as FromStr>::Err: fmt::Display + fmt::Debug { //! generic_arg_1: String, //! generic_arg_2: String, //! custom_arg_1: T //! } //! ``` //! //! or //! //! ``` //! # use structopt::StructOpt; //! // a struct with multiple custom arguments in a substructure //! #[derive(StructOpt)] //! struct GenericArgs<T:StructOpt> { //! generic_arg_1: String, //! generic_arg_2: String, //! #[structopt(flatten)] //! custom_args: T //! } //! ``` // those mains are for a reason #![allow(clippy::needless_doctest_main)] #[doc(hidden)] pub use structopt_derive::*; use std::ffi::OsString; /// Re-exports pub use clap; #[cfg(feature = "paw")] pub use paw_dep as paw; /// **This is NOT PUBLIC API**. #[doc(hidden)] pub use lazy_static; /// A struct that is converted from command line arguments. pub trait StructOpt { /// Returns [`clap::App`] corresponding to the struct. fn clap<'a, 'b>() -> clap::App<'a, 'b>; /// Builds the struct from [`clap::ArgMatches`]. It's guaranteed to succeed /// if `matches` originates from an `App` generated by [`StructOpt::clap`] called on /// the same type, otherwise it must panic. fn from_clap(matches: &clap::ArgMatches<'_>) -> Self; /// Builds the struct from the command line arguments ([`std::env::args_os`]). /// Calls [`clap::Error::exit`] on failure, printing the error message and aborting the program. fn from_args() -> Self where Self: Sized, { Self::from_clap(&Self::clap().get_matches()) } /// Builds the struct from the command line arguments ([`std::env::args_os`]). /// Unlike [`StructOpt::from_args`], returns [`clap::Error`] on failure instead of aborting the program, /// so calling [`.exit`][clap::Error::exit] is up to you. fn from_args_safe() -> Result<Self, clap::Error> where Self: Sized, { Self::clap() .get_matches_safe() .map(|matches| Self::from_clap(&matches)) } /// Gets the struct from any iterator such as a `Vec` of your making. /// Print the error message and quit the program in case of failure. /// /// **NOTE**: The first argument will be parsed as the binary name unless /// [`clap::AppSettings::NoBinaryName`] has been used. fn from_iter<I>(iter: I) -> Self where Self: Sized, I: IntoIterator, I::Item: Into<OsString> + Clone, { Self::from_clap(&Self::clap().get_matches_from(iter)) } /// Gets the struct from any iterator such as a `Vec` of your making. /// /// Returns a [`clap::Error`] in case of failure. This does *not* exit in the /// case of `--help` or `--version`, to achieve the same behavior as /// [`from_iter()`][StructOpt::from_iter] you must call [`.exit()`][clap::Error::exit] on the error value. /// /// **NOTE**: The first argument will be parsed as the binary name unless /// [`clap::AppSettings::NoBinaryName`] has been used. fn from_iter_safe<I>(iter: I) -> Result<Self, clap::Error> where Self: Sized, I: IntoIterator, I::Item: Into<OsString> + Clone, { Ok(Self::from_clap(&Self::clap().get_matches_from_safe(iter)?)) } } /// This trait is NOT API. **SUBJECT TO CHANGE WITHOUT NOTICE!**. #[doc(hidden)] pub trait StructOptInternal: StructOpt { fn augment_clap<'a, 'b>(app: clap::App<'a, 'b>) -> clap::App<'a, 'b> { app } fn is_subcommand() -> bool { false } fn from_subcommand<'a, 'b>(_sub: (&'b str, Option<&'b clap::ArgMatches<'a>>)) -> Option<Self> where Self: std::marker::Sized, { None } } impl<T: StructOpt> StructOpt for Box<T> { fn clap<'a, 'b>() -> clap::App<'a, 'b> { <T as StructOpt>::clap() } fn
(matches: &clap::ArgMatches<'_>) -> Self { Box::new(<T as StructOpt>::from_clap(matches)) } } impl<T: StructOptInternal> StructOptInternal for Box<T> { #[doc(hidden)] fn is_subcommand() -> bool { <T as StructOptInternal>::is_subcommand() } #[doc(hidden)] fn from_subcommand<'a, 'b>(sub: (&'b str, Option<&'b clap::ArgMatches<'a>>)) -> Option<Self> { <T as StructOptInternal>::from_subcommand(sub).map(Box::new) } #[doc(hidden)] fn augment_clap<'a, 'b>(app: clap::App<'a, 'b>) -> clap::App<'a, 'b> { <T as StructOptInternal>::augment_clap(app) } }
from_clap
lickeeper.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ #============================================================================= # FileName: lickeeper.py # Desc: # Author: Jeyrce.Lu # Email: [email protected] # HomePage: www.woqutech.com # Version: 0.0.1 # LastChange: 2021/1/13 上午11:18
# History: #============================================================================= """
simple_shape.rs
use glam::DAffine2; use glam::DMat2; use glam::DVec2; use kurbo::Affine; use kurbo::BezPath; use kurbo::Shape as KurboShape; use crate::intersection::intersect_quad_bez_path; use crate::layers::{ style, style::{PathStyle, ViewMode}, LayerData, }; use crate::LayerId; use crate::Quad; use serde::{Deserialize, Serialize}; use std::fmt::Write; fn glam_to_kurbo(transform: DAffine2) -> Affine { Affine::new(transform.to_cols_array()) } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct Shape { pub path: BezPath, pub style: style::PathStyle, pub render_index: i32, pub solid: bool, } impl LayerData for Shape { fn render(&mut self, svg: &mut String, transforms: &mut Vec<DAffine2>, view_mode: ViewMode) { let mut path = self.path.clone(); let transform = self.transform(transforms, view_mode); let inverse = transform.inverse(); if !inverse.is_finite() { let _ = write!(svg, "<!-- SVG shape has an invalid transform -->"); return; } path.apply_affine(glam_to_kurbo(transform)); let _ = writeln!(svg, r#"<g transform="matrix("#); inverse.to_cols_array().iter().enumerate().for_each(|(i, entry)| { let _ = svg.write_str(&(entry.to_string() + if i != 5 { "," } else { "" })); }); let _ = svg.write_str(r#")">"#); let _ = write!(svg, r#"<path d="{}" {} />"#, path.to_svg(), self.style.render(view_mode)); let _ = svg.write_str("</g>"); } fn bounding_box(&self, transform: glam::DAffine2) -> Option<[DVec2; 2]> { let mut path = self.path.clone(); if transform.matrix2 == DMat2::ZERO { return None; } path.apply_affine(glam_to_kurbo(transform)); use kurbo::Shape; let kurbo::Rect { x0, y0, x1, y1 } = path.bounding_box(); Some([(x0, y0).into(), (x1, y1).into()]) } fn intersects_quad(&self, quad: Quad, path: &mut Vec<LayerId>, intersections: &mut Vec<Vec<LayerId>>) { if intersect_quad_bez_path(quad, &self.path, self.solid) { intersections.push(path.clone()); } } } impl Shape { pub fn transform(&self, transforms: &[DAffine2], mode: ViewMode) -> DAffine2 { let start = match (mode, self.render_index) { (ViewMode::Outline, _) => 0, (_, -1) => 0, (_, x) => (transforms.len() as i32 - x).max(0) as usize, }; transforms.iter().skip(start).cloned().reduce(|a, b| a * b).unwrap_or(DAffine2::IDENTITY) } pub fn from_bez_path(bez_path: BezPath, style: PathStyle, solid: bool) -> Self { Self { path: bez_path, style, render_index: 1, solid, } } pub fn ngon(sides: u8, style: PathStyle) -> Self { use std::f64::consts::{FRAC_PI_2, TAU}; fn unit_rotation(theta: f64) -> DVec2 { DVec2::new(theta.sin(), theta.cos()) } let mut path = kurbo::BezPath::new(); let apothem_offset_angle = TAU / (sides as f64); // Rotate odd sided shapes by 90 degrees let offset = ((sides + 1) % 2) as f64 * FRAC_PI_2; let relative_points = (0..sides).map(|i| apothem_offset_angle * i as f64 + offset).map(unit_rotation); let min = relative_points.clone().reduce(|a, b| a.min(b)).unwrap_or_default(); let transform = DAffine2::from_scale_angle_translation(DVec2::ONE / 2., 0., -min / 2.); let point = |vec: DVec2| kurbo::Point::new(vec.x, vec.y); let mut relative_points = relative_points.map(|p| point(transform.transform_point2(p))); path.move_to(relative_points.next().expect("Tried to create an ngon with 0 sides")); relative_points.for_each(|p| path.line_to(p)); path.close_path(); Self { path, style, render_index: 1, solid: true, } } pub fn rectangle(style: PathStyle) -> Self { Self { path: kurbo::Rect::new(0., 0., 1., 1.).to_path(0.01), style, render_index: 1, solid: true, } } pub fn ellipse(style: PathStyle) -> Self { Self { path: kurbo::Ellipse::from_rect(kurbo::Rect::new(0., 0., 1., 1.)).to_path(0.01), style, render_index: 1, solid: true, } } pub fn line(style: PathStyle) -> Self { Self { path: kurbo::Line::new((0., 0.), (1., 0.)).to_path(0.01),
solid: true, } } pub fn poly_line(points: Vec<impl Into<glam::DVec2>>, style: PathStyle) -> Self { let mut path = kurbo::BezPath::new(); points .into_iter() .map(|v| v.into()) .map(|v: DVec2| kurbo::Point { x: v.x, y: v.y }) .enumerate() .for_each(|(i, p)| if i == 0 { path.move_to(p) } else { path.line_to(p) }); Self { path, style, render_index: 0, solid: false, } } }
style, render_index: 1,
user_fun.py
"""Contains a class which extracts the needed arguments of an arbitrary methode/function and wraps them for future usage. E.g correctly choosing the needed arguments and passing them on to the original function. """ import inspect import copy import torch from ..problem.spaces.points import Points class UserFunction: """Wraps a function, so that it can be called with arbitrary input arguments. Parameters ---------- fun : callable The original function that should be wrapped. defaults : dict, optional Possible defaults arguments of the function. If none are specified will check by itself if there are any. args : dict, optional All arguments of the function. If none are specified will check by itself if there are any. Notes ----- Uses inspect.getfullargspec(fun) to get the possible input arguments. When called just extracts the needed arguments and passes them to the original function. """ def __init__(self, fun, defaults={}, args={}): if isinstance(fun, (UserFunction, DomainUserFunction)): self.fun = fun.fun self.defaults = fun.defaults self.args = fun.args else: self._transform_to_user_function(fun, defaults, args) def _transform_to_user_function(self, fun, defaults, args): self.fun = fun self.defaults = defaults self.args = args if callable(self.fun) and self.defaults == {} and self.args == {}: self._set_input_args_for_function() def _set_input_args_for_function(self): f_args = inspect.getfullargspec(self.fun).args # we check that the function defines all needed parameters if inspect.getfullargspec(self.fun).varargs is not None or \ inspect.getfullargspec(self.fun).varkw is not None: raise ValueError(""" Variable arguments are not supported in UserFunctions. Please use keyword arguments. """) f_defaults = inspect.getfullargspec(self.fun).defaults f_kwonlyargs = inspect.getfullargspec(self.fun).kwonlyargs #f_kwonlydefaults = inspect.getfullargspec(self.fun).kwonlydefaults # NOTE: By above check, there should not be kwonlyargs. However, we still catch # this case here. self.args = f_args + f_kwonlyargs # defaults always align at the end of the args self.defaults = {} if not f_defaults is None: self.defaults = {self.args[-i]: f_defaults[-i] for i in range(len(f_defaults), 0, -1)} #if not f_kwonlydefaults is None: # self.defaults.update(f_kwonlydefaults) def __call__(self, args={}, vectorize=False): """To evalute the function. Will automatically extract the needed arguments from the input data and will set the possible default values. Parameters ---------- args : dict or torchphysics.Points The input data, where the function should be evaluated. vectorize : bool, optional If the original function can work with a batch of data, or a loop needs to be used to evaluate the function. default is False, which means that we assume the function can work with a batch of data. Returns ------- torch.tensor The output values of the function. """ if isinstance(args, Points): args = args.coordinates # check that every necessary arg is given for key in self.necessary_args: assert key in args, \ f"The argument '{key}' is necessary in {self.__name__} but not given." # if necessary, pass defaults inp = {key: args[key] for key in self.args if key in args} inp.update({key: self.defaults[key] for key in self.args if key not in args}) if not vectorize: return self.evaluate_function(**inp) else: return self.apply_to_batch(inp) def evaluate_function(self, **inp): """Evaluates the original input function. Should not be used directly, rather use the call-methode. """ if callable(self.fun): return self.fun(**inp) return self.fun def apply_to_batch(self, inp): """Apply the function to a batch of elements by running a for-loop. we assume that all inputs either have batch (i.e. maximum) dimension or are a constant param. Parameters ---------- inp : torchphysics.points The Points-object of the input data Returns ------- torch.tensor The output values of the function, for each input. """ batch_size = max(len(inp[key]) for key in inp) out = [] for i in range(batch_size): inp_i = {} for key in inp: if len(inp[key]) == batch_size: inp_i[key] = inp[key][i] else: inp_i[key] = inp[key] o = self.fun(**inp_i) if o is not None: out.append(o) return out def partially_evaluate(self, **args): """(partially) evaluates a given function. Parameters ---------- **args : The arguments where the function should be (partially) evaluated. Returns ------- Out : value or UserFunction If the input arguments are enough to evalate the whole function, the corresponding output is returned. If some needed arguments are missing, a copy of this UserFunction will be returned. Whereby the values of **args will be added to the default values of the returned UserFunction. """ if callable(self.fun): if all(arg in args for arg in self.necessary_args): inp = {key: args[key] for key in self.args if key in args} inp.update({key: self.defaults[key] for key in self.args if key not in args}) return self.fun(**inp) else: # to avoid manipulation of given param obj, we create a copy copy_self = copy.deepcopy(self) copy_self.set_default(**args) return copy_self return self.fun def __name__(self): """The name of the function Returns ------- str The name of the function """ return self.fun.__name__ def set_default(self, **args): """Sets a input argument to given value. Parameters ---------- **args: The value the input should be set to. """ self.defaults.update({key: args[key] for key in args if key in self.args}) def remove_default(self, *args, **kwargs): """Removes an default value of a input argument. Parameters ---------- *args, **kwargs: The arguments for which the default values should be deleted. """ for key in args: self.defaults.pop(key) for key in kwargs.keys(): self.defaults.pop(key) def __deepcopy__(self, memo):
@property def necessary_args(self): """Returns the function arguments that are needed to evaluate this function. Returns ------- list : The needed arguments. """ return [arg for arg in self.args if arg not in self.defaults] @property def optional_args(self): """Returns the function arguments that are optional to evaluate this function. Returns ------- list : The optional arguments. """ return [arg for arg in self.args if arg in self.defaults] class DomainUserFunction(UserFunction): """Extension of the original UserFunctions, that are used in the Domain-Class. Parameters ---------- fun : callable The original function that should be wrapped. defaults : dict, optional Possible defaults arguments of the function. If none are specified will check by itself if there are any. args : dict, optional All arguments of the function. If none are specified will check by itself if there are any. Notes ----- The only difference to normal UserFunction is how the evaluation of the original function is handled. Since all Domains use Pytorch, we check that the output always is a torch.tensor. In the case that the function is not constant, we also append an extra dimension to the output, so that the domains can work with it correctly. """ def __call__(self, args={}, device='cpu'): """To evalute the function. Will automatically extract the needed arguments from the input data and will set the possible default values. Parameters ---------- args : dict or torchphysics.Points The input data, where the function should be evaluated. device : str, optional The device on which the output of th efunction values should lay. Default is 'cpu'. Returns ------- torch.tensor The output values of the function. """ if isinstance(args, Points): args = args.coordinates if len(args) != 0: # set the device correctly device = args[list(args.keys())[0]].device # check that every necessary arg is given for key in self.necessary_args: assert key in args, \ f"The argument '{key}' is necessary in {self.__name__} but not given." # if necessary, pass defaults inp = {key: args[key] for key in self.args if key in args} inp.update({key: self.defaults[key] for key in self.args if key not in args}) return self.evaluate_function(device=device, **inp) def evaluate_function(self, device='cpu', **inp): """Evaluates the original input function. Should not be used directly, rather use the call-methode. Parameters ---------- device : str, optional The device on which the output of th efunction values should lay. Default is 'cpu'. inp The input values. """ if callable(self.fun): fun_eval = self.fun(**inp) if not isinstance(fun_eval, torch.Tensor): fun_eval = torch.tensor(fun_eval, device=device) return fun_eval[:, None] else: if isinstance(self.fun, torch.Tensor): self.fun = self.fun.to(device) return self.fun else: return torch.tensor(self.fun, device=device).float()
"""Creates a copy of the function """ cls = self.__class__ copy_object = cls.__new__(cls, self.fun) memo[id(self)] = copy_object for k, v in self.__dict__.items(): setattr(copy_object, k, copy.deepcopy(v, memo)) return copy_object
exception.rs
use std::ptr; use crate::baseline::fct::{CatchType, JitFctId}; use crate::baseline::map::CodeDescriptor; use crate::cpu::fp_from_execstate; use crate::execstate::ExecState; use crate::handle::root; use crate::object::{alloc, Array, IntArray, Obj, Ref, StackTraceElement, Str, Throwable}; use crate::os::signal::Trap; use crate::stdlib; use crate::threads::THREAD; use crate::vm::{get_vm, FctParent, VM}; pub struct Stacktrace { elems: Vec<StackElem>, } impl Stacktrace { pub fn new() -> Stacktrace { Stacktrace { elems: Vec::new() } } pub fn len(&self) -> usize { self.elems.len() } pub fn push_entry(&mut self, fct_id: JitFctId, lineno: i32) { self.elems.push(StackElem { fct_id: fct_id, lineno: lineno, }); } pub fn dump(&self, vm: &VM) { for (ind, elem) in self.elems.iter().enumerate() { let jit_fct = vm.jit_fcts.idx(elem.fct_id); let fct_id = jit_fct.fct_id(); let fct = vm.fcts.idx(fct_id); let fct = fct.read(); let name = fct.full_name(vm); print!("{}: {}: ", ind, name); if elem.lineno == 0 { println!("?"); } else { println!("{}", elem.lineno); } } } } struct StackElem { fct_id: JitFctId, lineno: i32, } pub struct DoraToNativeInfo { // pointer to previous DTN-Info pub last: *const DoraToNativeInfo, // frame pointer of native stub pub fp: usize, // some program counter into native stub pub pc: usize, } impl DoraToNativeInfo { pub fn new() -> DoraToNativeInfo { DoraToNativeInfo { last: ptr::null(), fp: 0, pc: 0, } } } pub fn stacktrace_from_es(vm: &VM, es: &ExecState) -> Stacktrace { let mut stacktrace = Stacktrace::new(); let fp = fp_from_execstate(es); frames_from_pc(&mut stacktrace, vm, es.pc, fp); frames_from_dtns(&mut stacktrace, vm); return stacktrace; } pub fn stacktrace_from_last_dtn(vm: &VM) -> Stacktrace { let mut stacktrace = Stacktrace::new(); frames_from_dtns(&mut stacktrace, vm); return stacktrace; } fn frames_from_dtns(stacktrace: &mut Stacktrace, vm: &VM) { let mut dtn_ptr = THREAD.with(|thread| { let thread = thread.borrow(); let dtn = thread.dtn(); dtn }); while !dtn_ptr.is_null() { let dtn = unsafe { &*dtn_ptr }; let pc: usize = dtn.pc; let fp: usize = dtn.fp; frames_from_pc(stacktrace, vm, pc, fp); dtn_ptr = dtn.last } } fn frames_from_pc(stacktrace: &mut Stacktrace, vm: &VM, pc: usize, mut fp: usize) { if !determine_stack_entry(stacktrace, vm, pc) { return; } while fp != 0 { let ra = unsafe { *((fp + 8) as *const usize) }; if !determine_stack_entry(stacktrace, vm, ra) { return; } fp = unsafe { *(fp as *const usize) }; } } fn determine_stack_entry(stacktrace: &mut Stacktrace, vm: &VM, pc: usize) -> bool { let code_map = vm.code_map.lock(); let data = code_map.get(pc.into()); match data { Some(CodeDescriptor::DoraFct(fct_id)) => { let jit_fct = vm.jit_fcts.idx(fct_id); let offset = pc - jit_fct.fct_ptr().to_usize(); let jit_fct = jit_fct.to_base().expect("baseline expected"); let lineno = jit_fct.lineno_for_offset(offset as i32); if lineno == 0 { panic!("lineno not found for program point"); } stacktrace.push_entry(fct_id, lineno); true } Some(CodeDescriptor::NativeThunk(fct_id)) => { let jit_fct = vm.jit_fcts.idx(fct_id); let fct = vm.fcts.idx(jit_fct.fct_id()); let fct = fct.read(); stacktrace.push_entry(fct_id, fct.ast.pos.line as i32); true } Some(CodeDescriptor::TrapThunk) => true, Some(CodeDescriptor::ThrowThunk) => true, Some(CodeDescriptor::AllocThunk) => true, Some(CodeDescriptor::DoraEntry) => false, _ => { println!("data = {:?}", data); panic!("invalid stack frame"); } } } #[derive(PartialEq, Eq, Debug)] enum HandlerFound { Yes, No, Stop, } pub struct ThrowResume { pc: usize, sp: usize, fp: usize, } pub extern "C" fn throw(exception: Ref<Obj>, resume: &mut ThrowResume) { let vm = get_vm(); let dtn = THREAD.with(|thread| { let thread = thread.borrow(); let dtn = thread.dtn(); dtn }); let dtn = unsafe { &*dtn }; let mut pc: usize = dtn.pc; let mut fp: usize = dtn.fp; while fp != 0 { let res = find_handler(vm, exception, pc, fp, resume); match res { HandlerFound::Yes => { // handler found, resume from there return; } HandlerFound::Stop => { // no handler found stdlib::trap(Trap::THROW.int()); } HandlerFound::No => { // try next stack frame } } pc = unsafe { *((fp + 8) as *const usize) }; fp = unsafe { *(fp as *const usize) }; } } fn find_handler( vm: &VM, exception: Ref<Obj>, pc: usize, fp: usize, resume: &mut ThrowResume, ) -> HandlerFound { let data = { let code_map = vm.code_map.lock(); code_map.get(pc.into()) }; match data { Some(CodeDescriptor::DoraFct(fct_id)) | Some(CodeDescriptor::NativeThunk(fct_id)) => { let jit_fct = vm.jit_fcts.idx(fct_id); let jit_fct = jit_fct.to_base().expect("baseline expected"); let clsptr = exception.header().vtbl().classptr(); for entry in &jit_fct.exception_handlers { // println!("entry = {:x} to {:x} for {:?}", // entry.try_start, entry.try_end, entry.catch_type); if entry.try_start < pc && pc <= entry.try_end && (entry.catch_type == CatchType::Any || entry.catch_type == CatchType::Class(clsptr)) { let stacksize = jit_fct.framesize as usize; if let Some(offset) = entry.offset { let arg = (fp as isize + offset as isize) as usize; unsafe { *(arg as *mut usize) = exception.raw() as usize; } } resume.pc = entry.catch; resume.sp = fp - stacksize; resume.fp = fp; return HandlerFound::Yes; } else if pc > entry.try_end { // exception handlers are sorted, no more possible handlers // in this function return HandlerFound::No; } } // exception can only bubble up in stacktrace if current function // is allowed to throw exceptions if !jit_fct.throws { return HandlerFound::Stop; } HandlerFound::No } Some(CodeDescriptor::DoraEntry) => HandlerFound::Stop, Some(CodeDescriptor::ThrowThunk) => HandlerFound::No, _ => { println!("data = {:?}", data); panic!("invalid stack frame"); } } } pub extern "C" fn retrieve_stack_trace(obj: Ref<Throwable>) { let vm = get_vm(); set_exception_backtrace(vm, obj, true); } pub extern "C" fn stack_element(obj: Ref<Throwable>, ind: i32) -> Ref<StackTraceElement> { let vm = get_vm(); let obj = root(obj); let array = obj.backtrace; let ind = ind as usize * 2; let lineno = array.get_at(ind); let fct_id = array.get_at(ind + 1); let cls_def_id = vm.vips.stack_trace_element(vm); let ste: Ref<StackTraceElement> = alloc(vm, cls_def_id).cast(); let mut ste = root(ste); ste.line = lineno; let jit_fct_id = JitFctId::from(fct_id as usize); let jit_fct = vm.jit_fcts.idx(jit_fct_id); let fct = vm.fcts.idx(jit_fct.fct_id()); let fct = fct.read(); let name = fct.full_name(vm); ste.name = Str::from_buffer(vm, name.as_bytes()); ste.direct() } pub fn alloc_exception(vm: &VM, msg: Ref<Str>) -> Ref<Throwable> { let cls_id = vm.vips.exception(vm); let obj: Ref<Throwable> = alloc(vm, cls_id).cast(); let mut obj = root(obj); obj.msg = msg; set_exception_backtrace(vm, obj.direct(), false); obj.direct() } fn
(vm: &VM, obj: Ref<Throwable>, via_retrieve: bool) { let stacktrace = stacktrace_from_last_dtn(vm); let mut obj = root(obj); let mut skip = 0; let mut skip_retrieve_stack = false; let mut skip_constructor = false; // ignore every element until first not inside susubclass of Throwable (ctor of Exception) if via_retrieve { for elem in stacktrace.elems.iter() { let jit_fct_id = JitFctId::from(elem.fct_id.idx() as usize); let jit_fct = vm.jit_fcts.idx(jit_fct_id); let fct_id = jit_fct.fct_id(); let fct = vm.fcts.idx(fct_id); let fct = fct.read(); if !skip_retrieve_stack { let throwable_cls = vm.classes.idx(vm.vips.throwable_class); let throwable_cls = throwable_cls.read(); let retrieve_stacktrace_fct_id = throwable_cls .find_method(vm, vm.interner.intern("retrieveStackTrace"), false) .expect("retrieveStackTrace not found in Throwable"); if retrieve_stacktrace_fct_id == fct_id { skip += 1; continue; } else { skip_retrieve_stack = true; } } if !skip_constructor { assert!(skip_retrieve_stack); if let FctParent::Class(owner_class) = fct.parent { if fct.is_constructor { let throw_object_cls_id = (&obj.header) .vtbl() .class() .cls_id .expect("no corresponding class"); if throw_object_cls_id == owner_class { skip += 1; skip_constructor = true; break; } let throw_object_cls = vm.classes.idx(throw_object_cls_id); let throw_object_cls = throw_object_cls.read(); if throw_object_cls.subclass_from(vm, owner_class) { skip += 1; continue; } } else { skip_constructor = true; break; } } else { skip_constructor = true; break; } } } assert!(skip_constructor); } let len = stacktrace.len() - skip; let cls_id = vm.vips.int_array(vm); let array: Ref<IntArray> = Array::alloc(vm, len * 2, 0, cls_id); let mut array = root(array); let mut i = 0; for elem in stacktrace.elems.iter().skip(skip) { array.set_at(i, elem.lineno); array.set_at(i + 1, elem.fct_id.idx() as i32); i += 2; } obj.backtrace = array.direct(); }
set_exception_backtrace
main_test.go
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package k8s import ( "os" "testing" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testclient "k8s.io/client-go/kubernetes/fake" ) func TestParseNameNS(t *testing.T)
func TestGetNodeIP(t *testing.T) { fKNodes := []struct { cs *testclient.Clientset n string ea string i bool }{ // empty node list {testclient.NewSimpleClientset(), "demo", "", true}, // node not exist {testclient.NewSimpleClientset(&apiv1.NodeList{Items: []apiv1.Node{{ ObjectMeta: metav1.ObjectMeta{ Name: "demo", }, Status: apiv1.NodeStatus{ Addresses: []apiv1.NodeAddress{ { Type: apiv1.NodeInternalIP, Address: "10.0.0.1", }, }, }, }}}), "notexistnode", "", true}, // node exist {testclient.NewSimpleClientset(&apiv1.NodeList{Items: []apiv1.Node{{ ObjectMeta: metav1.ObjectMeta{ Name: "demo", }, Status: apiv1.NodeStatus{ Addresses: []apiv1.NodeAddress{ { Type: apiv1.NodeInternalIP, Address: "10.0.0.1", }, }, }, }}}), "demo", "10.0.0.1", true}, // search the correct node {testclient.NewSimpleClientset(&apiv1.NodeList{Items: []apiv1.Node{ { ObjectMeta: metav1.ObjectMeta{ Name: "demo1", }, Status: apiv1.NodeStatus{ Addresses: []apiv1.NodeAddress{ { Type: apiv1.NodeInternalIP, Address: "10.0.0.1", }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "demo2", }, Status: apiv1.NodeStatus{ Addresses: []apiv1.NodeAddress{ { Type: apiv1.NodeInternalIP, Address: "10.0.0.2", }, }, }, }, }}), "demo2", "10.0.0.2", true}, // get NodeExternalIP {testclient.NewSimpleClientset(&apiv1.NodeList{Items: []apiv1.Node{{ ObjectMeta: metav1.ObjectMeta{ Name: "demo", }, Status: apiv1.NodeStatus{ Addresses: []apiv1.NodeAddress{ { Type: apiv1.NodeInternalIP, Address: "10.0.0.1", }, { Type: apiv1.NodeExternalIP, Address: "10.0.0.2", }, }, }, }}}), "demo", "10.0.0.2", false}, // get NodeInternalIP {testclient.NewSimpleClientset(&apiv1.NodeList{Items: []apiv1.Node{{ ObjectMeta: metav1.ObjectMeta{ Name: "demo", }, Status: apiv1.NodeStatus{ Addresses: []apiv1.NodeAddress{ { Type: apiv1.NodeExternalIP, Address: "", }, { Type: apiv1.NodeInternalIP, Address: "10.0.0.2", }, }, }, }}}), "demo", "10.0.0.2", true}, } for _, fk := range fKNodes { address := GetNodeIPOrName(fk.cs, fk.n, fk.i) if address != fk.ea { t.Errorf("expected %s, but returned %s", fk.ea, address) } } } func TestGetPodDetails(t *testing.T) { // POD_NAME & POD_NAMESPACE not exist os.Setenv("POD_NAME", "") os.Setenv("POD_NAMESPACE", "") _, err1 := GetPodDetails(testclient.NewSimpleClientset()) if err1 == nil { t.Errorf("expected an error but returned nil") } // POD_NAME not exist os.Setenv("POD_NAME", "") os.Setenv("POD_NAMESPACE", apiv1.NamespaceDefault) _, err2 := GetPodDetails(testclient.NewSimpleClientset()) if err2 == nil { t.Errorf("expected an error but returned nil") } // POD_NAMESPACE not exist os.Setenv("POD_NAME", "testpod") os.Setenv("POD_NAMESPACE", "") _, err3 := GetPodDetails(testclient.NewSimpleClientset()) if err3 == nil { t.Errorf("expected an error but returned nil") } // POD not exist os.Setenv("POD_NAME", "testpod") os.Setenv("POD_NAMESPACE", apiv1.NamespaceDefault) _, err4 := GetPodDetails(testclient.NewSimpleClientset()) if err4 == nil { t.Errorf("expected an error but returned nil") } // success to get PodInfo fkClient := testclient.NewSimpleClientset( &apiv1.PodList{Items: []apiv1.Pod{{ ObjectMeta: metav1.ObjectMeta{ Name: "testpod", Namespace: apiv1.NamespaceDefault, Labels: map[string]string{ "first": "first_label", "second": "second_label", }, }, }}}, &apiv1.NodeList{Items: []apiv1.Node{{ ObjectMeta: metav1.ObjectMeta{ Name: "demo", }, Status: apiv1.NodeStatus{ Addresses: []apiv1.NodeAddress{ { Type: apiv1.NodeInternalIP, Address: "10.0.0.1", }, }, }, }}}) epi, err5 := GetPodDetails(fkClient) if err5 != nil { t.Errorf("expected a PodInfo but returned error") return } if epi == nil { t.Errorf("expected a PodInfo but returned nil") } }
{ tests := []struct { title string input string ns string name string expErr bool }{ {"empty string", "", "", "", true}, {"demo", "demo", "", "", true}, {"kube-system", "kube-system", "", "", true}, {"default/kube-system", "default/kube-system", "default", "kube-system", false}, } for _, test := range tests { ns, name, err := ParseNameNS(test.input) if test.expErr { if err == nil { t.Errorf("%v: expected error but returned nil", test.title) } continue } if test.ns != ns { t.Errorf("%v: expected %v but returned %v", test.title, test.ns, ns) } if test.name != name { t.Errorf("%v: expected %v but returned %v", test.title, test.name, name) } } }
animConfig.ts
import { tl} from '../../util/intl' import { isCustomFormat, format as modelFormat } from '../../modelFormat' import {isInternalModel} from "../../util/utilz"; import { settings } from '../../settings' import { CustomError } from '../../util/customError' // Properties registration to make Blockbench save them in the project file new Property(Animation, 'string', 'animType', { default: () => undefined, exposed: true, condition: (val: any) => val !== undefined && val !== "" }) new Property(Animation, 'string', 'canPlayerMove', { default: () => undefined, exposed: true, condition: (val: any) => val !== undefined && val !== "" }) const refreshAnimIcons = () => { // @ts-ignore Animation.all.forEach(anim => { let icon = "" if(anim.animType === "idle") icon = `<i class="material-icons">person</i>` else if(anim.animType === "walk") icon = `<i class="material-icons">directions_run</i>` else if(anim.animType === "attack") icon = `<i class="fa fa-fist-raised"></i>` else if(anim.animType === "death") icon = `<i class="fa fa-skull-crossbones"></i>` else if(anim.animType === "fly") icon = `<i class="fa fa-dove"></i>` document.querySelector(`[anim_type_anim_id='${anim.uuid}']`)?.remove() document.querySelector(`[anim_id='${anim.uuid}']`).insertAdjacentHTML("beforeend", `<div anim_type_anim_id='${anim.uuid}' class="in_list_button unclickable">${icon}</div>`) }) } const handleClick_animType = (animation, name) => { // Make sure only one animation has this type set if(name != "other") { // @ts-ignore Animation.all.forEach(anim => { if(anim.animType == name) { anim.animType = "other" } }) } if(animation.animType != name) Project.saved = false animation.animType = name refreshAnimIcons() } const handleClick_canPlayerMove = (animation, val) => { if(animation.canPlayerMove != val) { Project.saved = false animation.canPlayerMove = val } } // @ts-ignore Animation.prototype.menu.structure.splice(12, 0, '_') let isInternalModel_ = () => isInternalModel(settings) // @ts-ignore Animation.prototype.menu.structure.splice(13, 0, {name: tl('iaentitymodel.menu.animation.animType.title'), icon: 'movie', children: [ {name: tl('iaentitymodel.menu.animation.animType.value.other'), icon: animation => (animation.animType == 'other' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_animType(animation, "other") }, condition: isCustomFormat}, {name: tl('iaentitymodel.menu.animation.animType.value.idle'), icon: animation => (animation.animType == 'idle' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_animType(animation, "idle") }, condition: isCustomFormat}, {name: tl('iaentitymodel.menu.animation.animType.value.walk'), icon: animation => (animation.animType == 'walk' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_animType(animation, "walk") }, condition: isCustomFormat}, {name: tl('iaentitymodel.menu.animation.animType.value.attack'), icon: animation => (animation.animType == 'attack' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_animType(animation, "attack") }, condition: isCustomFormat}, {name: tl('iaentitymodel.menu.animation.animType.value.death'), icon: animation => (animation.animType == 'death' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_animType(animation, "death") }, condition: isCustomFormat}, {name: tl('iaentitymodel.menu.animation.animType.value.fly'), icon: animation => (animation.animType == 'fly' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_animType(animation, "fly") }, condition: isCustomFormat}, ]}) // @ts-ignore Animation.prototype.menu.structure.splice(14, 0, {name: tl("Can Player Move"), icon: 'movie', children: [ {name: tl("True"), icon: animation => (animation.canPlayerMove == 'true' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_canPlayerMove(animation, "true") }, condition: isInternalModel_}, {name: tl("False"), icon: animation => (animation.canPlayerMove == 'false' ? 'radio_button_checked' : 'radio_button_unchecked'), click(animation) { handleClick_canPlayerMove(animation, "false") }, condition: isInternalModel_}, ]}) // @ts-ignore Animation.prototype.menu.structure.splice(15, 0, '_') markerColors[-1] = {pastel: '#ffffff', standard: '#ffffff', name: 'loop_start_end'} // @ts-ignore TimelineMarker.prototype.menu.structure.splice(1, 0, '_') // @ts-ignore TimelineMarker.prototype.menu.structure.splice(2, 0, {icon: 'flag', color: "#000000", name: 'Loop Start/End', click(marker) { // @ts-ignore if(Animation.selected.loop === 'loop') { marker.color = -1; } else { // @ts-ignore Blockbench.showMessageBox({ message: tl('iaentitymodel.exporters.vanillaAnimation.dialogs.errors.markerNoLoopAnim.message'), icon: 'error', }) } }, condition: isCustomFormat} ) /*MenuBar.addAction(new Action('add_loop_marker', { icon: 'clock-alert', category: 'update', condition: {modes: ['animate']}, click: function (event) { let count = 0; // @ts-ignore Animation.selected?.markers.forEach(marker => { if(marker.color === -1) { count++; } }) if(count < 2) { // @ts-ignore Animation.selected?.markers.push(new TimelineMarker({time: Timeline.second, color: -1})) } else { // @ts-ignore Blockbench.showMessageBox({ message: tl('iaentitymodel.exporters.vanillaAnimation.dialogs.errors.tooManyMarkers.message'), icon: 'error', }) } } }), 'animation')*/ new Action('add_loop_marker', { name: tl("iaentitymodel.exporters.vanillaAnimation.other.addLoopMarker"),
// @ts-ignore return isCustomFormat() && Mode.selected?.name === 'Animate' && Animation.selected?.loop === 'loop' }, click: function (event) { let count = 0; // @ts-ignore Animation.selected?.markers.forEach(marker => { if(marker.color === -1) { count++; } }) if(count < 2) { // @ts-ignore Animation.selected?.markers.push(new TimelineMarker({time: Timeline.second, color: -1})) } else { // This should not happen because I already hide this button of non-loop animations // @ts-ignore /*Blockbench.showMessageBox({ message: tl('iaentitymodel.exporters.vanillaAnimation.dialogs.errors.tooManyMarkers.message'), icon: 'error', })*/ // @ts-ignore Animation.selected.markers.pop() } } // @ts-ignore }).pushToolbar(Toolbars.timeline, 1) // @ts-ignore Blockbench.on('select_project', () => { queueMicrotask(() => { if(Format.id === modelFormat.id) { // Refresh animation icons refreshAnimIcons() } }) })
icon: 'update', category: 'animation', condition: () => {
evaluate.py
from sklearn.metrics import precision_recall_fscore_support as prfs import numpy as np import json import argparse from typing import List, Tuple, Dict import sys # From spert.evaluator class # https://github.com/markus-eberts/spert/blob/master/spert/evaluator.py def _get_row(data, label): row = [label] for i in range(len(data) - 1): row.append("%.2f" % (data[i] * 100)) row.append(data[3]) return tuple(row) def _print_results(per_type: List, micro: List, macro: List, types: List): columns = ('type', 'precision', 'recall', 'f1-score', 'support') row_fmt = "%20s" + (" %12s" * (len(columns) - 1)) results = [row_fmt % columns, '\n'] metrics_per_type = [] for i, t in enumerate(types): metrics = [] for j in range(len(per_type)): metrics.append(per_type[j][i]) metrics_per_type.append(metrics) for m, t in zip(metrics_per_type, types): results.append(row_fmt % _get_row(m, t)) results.append('\n') results.append('\n') # micro results.append(row_fmt % _get_row(micro, 'micro')) results.append('\n') # macro results.append(row_fmt % _get_row(macro, 'macro')) results_str = ''.join(results) print(results_str) def _compute_metrics(gt_all, pred_all, types, print_results: bool = False): labels = [t for t in types] per_type = prfs(gt_all, pred_all, labels=labels, average=None) micro = prfs(gt_all, pred_all, labels=labels, average='micro')[:-1] macro = prfs(gt_all, pred_all, labels=labels, average='macro')[:-1] total_support = sum(per_type[-1]) if print_results: _print_results(per_type, list(micro) + [total_support], list(macro) + [total_support], types) return [m * 100 for m in micro + macro] ## Tuple = (start, end, entity_type) def _score(gt: List[List[Tuple]], pred: List[List[Tuple]], print_results: bool = False): assert len(gt) == len(pred) gt_flat = [] pred_flat = [] types = set() for (sample_gt, sample_pred) in zip(gt, pred): union = set() union.update(sample_gt) union.update(sample_pred) for s in union: if s in sample_gt: t = s[2] gt_flat.append(t) types.add(t) else: gt_flat.append("0") if s in sample_pred: t = s[2] pred_flat.append(t) types.add(t) else: pred_flat.append("0") metrics = _compute_metrics(gt_flat, pred_flat, types, print_results) return metrics def
(sequence): span_tuples = [] entities = sequence["entities"] for span in entities: tuple_ = (span["start"], span["end"], span["type"]) span_tuples.append(tuple_) return span_tuples def _convert_token_tuples(sequence): token_tuples = [] entities = sequence["entities"] string_tokens = sequence["tokens"] for span in entities: span_range = range(span["start"], span["end"]) for index in span_range: tuple_ = (index, index+1, span["type"]) token_tuples.append(tuple_) return token_tuples def evaluate(gt_path, pred_path, tokenizer, print_results=True): with open(gt_path, 'r', encoding='utf-8') as f: gt_dataset = json.load(f) with open(pred_path, 'r', encoding='utf-8') as f: pred_dataset = json.load(f) gt_spans = [] pred_spans = [] gt_tokens = [] pred_tokens = [] for gt_sequence, pred_sequence in zip(gt_dataset, pred_dataset): gt_spans.append(_convert_span_tuples(gt_sequence)) pred_spans.append(_convert_span_tuples(pred_sequence)) gt_tokens.append(_convert_token_tuples(gt_sequence)) pred_tokens.append(_convert_token_tuples(pred_sequence)) print("") print("--- Entities (named entity recognition (NER)) ---") print("An entity span is considered correct if the entity type and span start/end is predicted correctly") ner_span_eval = _score(gt_spans, pred_spans, print_results=print_results)[:3] print("") print("An entity token is considered correct if the entity type is predicted correctly") ner_token_eval = _score(gt_tokens, pred_tokens, print_results=print_results)[:3] print("") return ner_span_eval, ner_token_eval def compare_datasets(gt_path, pred_path, output_path=None): with open(gt_path, 'r', encoding='utf-8') as f: gt_dataset = json.load(f) with open(pred_path, 'r', encoding='utf-8') as f: pred_dataset = json.load(f) assert len(gt_dataset)==len(pred_dataset) file_object = open(output_path, 'w', encoding='utf-8') if output_path else sys.stdout for gt_sentence, pred_sentence in zip(gt_dataset, pred_dataset): gt_tokens = gt_sentence["tokens"] print("|{}| {} \n".format(gt_sentence["orig_id"], " ".join(gt_tokens)), file=file_object) for entity in gt_sentence["entities"]: entity_tokens = gt_tokens[entity["start"]:entity["end"]] line = "[gold] \t {} \t {}".format(" ".join(entity_tokens), entity["type"]) print(line, file=file_object) pred_tokens = pred_sentence["tokens"] for entity in pred_sentence["entities"]: entity_tokens = pred_tokens[entity["start"]:entity["end"]] line = "[pred] \t {} \t {}".format(" ".join(entity_tokens), entity["type"]) print(line, file=file_object) print('-'*50, file=file_object) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Evaluate spert json formatted dataset') parser.add_argument('gt_path', type=str, help='path to the ground truth dataset.json file') parser.add_argument('pred_path', type=str, help='path to the predicted dataset.json file') args = parser.parse_args() evaluate(args.gt_path, args.pred_path)
_convert_span_tuples
day_11.py
from unittest import TestCase import operator from aoc_utils.data import data_text class Coordinates(object): def __init__(self, coordinates): self.coordinates = coordinates[:] def __str__(self): return "{}".format(self.coordinates) def __getitem__(self, item): return self.coordinates[item] def __len__(self): return len(self.coordinates) def __add__(self, other): new_coordinates = map(operator.add, self.coordinates, other.coordinates) return Coordinates(new_coordinates) def __iadd__(self, other): self.coordinates = list(map(operator.add, self.coordinates, other.coordinates)) return self def __eq__(self, other): return all(map(operator.eq, self.coordinates, other.coordinates)) directions = { "n": Coordinates([0, 1, 1]), "s": Coordinates([0, -1, -1]), "ne": Coordinates([1, 1, 0]), "se": Coordinates([1, 0, -1]), "nw": Coordinates([-1, 0, 1]), "sw": Coordinates([-1, -1, 0]) } class GridWalker: def __init__(self): self.position = Coordinates([0, 0, 0]) self.furthest = 0 def walk(self, route): for coord in route.split(","): step = directions[coord] self.position += step self.furthest = max(self.furthest, self.distance()) def distance(self): return max(list(map(abs, self.position.coordinates)) + [0]) def
(route): walker = GridWalker() walker.walk(route) return walker.position def shortest_distance(route): walker = GridWalker() walker.walk(route) return walker.distance() class TestHexWalk(TestCase): def setUp(self): def assert_coordinates_equal(a, b, msg=None): if msg is None: msg = "Expected: {}\nActual: {}".format(a, b) if not a == b: raise self.failureException(msg) self.addTypeEqualityFunc(Coordinates, assert_coordinates_equal) def test_final_coordinates(self): self.assertEquals(Coordinates([3, 3, 0]), final_coordinates("ne,ne,ne")) self.assertEquals(Coordinates([0, 0, 0]), final_coordinates("ne,ne,sw,sw")) self.assertEquals(Coordinates([2, 0, -2]), final_coordinates("ne,ne,s,s")) self.assertEquals(Coordinates([-1, -3, -2]), final_coordinates("se,sw,se,sw,sw")) def test_hexample(self): self.assertEqual(3, shortest_distance("ne,ne,ne")) self.assertEqual(0, shortest_distance("ne,ne,sw,sw")) self.assertEqual(2, shortest_distance("ne,ne,s,s")) self.assertEqual(3, shortest_distance("se,sw,se,sw,sw")) def test_mine(self): file_text = data_text(2017, "day_11_mine.txt") walker = GridWalker() walker.walk(file_text) self.assertEqual(687, walker.distance()) self.assertEqual(1483, walker.furthest)
final_coordinates
pivot-button.ts
import { SfPivotView } from '../pivotview/sf-pivotview-fn'; import { SfPivotFieldList } from '../pivotfieldlist/sf-pivotfieldlist-fn'; import * as cls from '../common/constants'; import { closest, Browser, removeClass, EventHandler, isNullOrUndefined, Draggable, addClass, DragEventArgs, createElement, BlazorDragEventArgs, remove, Droppable, detach } from '@syncfusion/ej2-base'; import { DragStopEventArgs } from '@syncfusion/ej2-popups'; import { IFieldOptions, FieldItemInfo } from '../../src/base/engine'; import { IOlapField } from '../../src/base/olap/engine'; import { FieldDragStartEventArgs } from '../../src/common/base/interface'; /** * The `Grouping` module is used to show or hide columns dynamically. */ export class PivotButton { public parent: SfPivotView | SfPivotFieldList; private draggable: Draggable; constructor(parent: SfPivotView | SfPivotFieldList) { this.parent = parent; this.parent.pivotButtonModule = this; } public createPivotButtonDrop(): void { for (let element of [].slice.call(this.parent.parentElement.querySelectorAll('.' + cls.AXIS_CONTENT_CLASS))) {
this.wireEvents(element); } } public setPivotButtonDrag(): void { for (let element of [].slice.call(this.parent.parentElement.querySelectorAll('.' + (this.parent instanceof SfPivotView ? cls.GROUPING_BAR_CLASS : cls.PIVOT_FIELD_LIST_CLASS) + '-button'))) { let buttonElement: Element = element.querySelector('.' + cls.PIVOT_BUTTON_CLASS); this.parent.pivotButtonModule.createDraggable(false, this.parent instanceof SfPivotView ? buttonElement.querySelector('.' + cls.PIVOT_BUTTON_CONTENT_CLASS) : buttonElement.firstElementChild as HTMLElement, JSON.parse(buttonElement.getAttribute('data-fieldInfo'))); } } public createDraggable(isTreeElement: boolean, element: HTMLElement, field: IFieldOptions): void { this.draggable = new Draggable(element, { clone: true, enableTailMode: true, enableAutoScroll: true, helper: this.createDragClone.bind(this, field), dragStart: this.onDragStart.bind(this, isTreeElement), drag: (e: DragEventArgs) => { this.draggable.setProperties({ cursorAt: { top: (!isNullOrUndefined(e.event.targetTouches) || Browser.isDevice) ? 60 : -20, } }); }, dragStop: this.onDragStop.bind(this, isTreeElement), abort: (this.parent instanceof SfPivotView ? !(this.parent.groupingBarSettings.allowDragAndDrop && field.allowDragAndDrop) ? '.' + cls.PIVOT_BUTTON_CLASS : '' : !field.allowDragAndDrop ? '.' + cls.PIVOT_BUTTON_CLASS : '') }); if (!isTreeElement) { this.unWireEvents(element); this.wireEvents(element); } } private createDragClone(field: IFieldOptions): HTMLElement { let cloneElement: HTMLElement = createElement('div', { id: this.parent.element.id + '_DragClone', className: cls.DRAG_CLONE_CLASS }); let contentElement: HTMLElement = createElement('span', { className: cls.TEXT_CONTENT_CLASS, innerHTML: field ? field.caption ? field.caption : field.name : '' }); cloneElement.appendChild(contentElement); document.body.appendChild(cloneElement); return cloneElement; } private onDragStart(isTreeElement: boolean, e: DragEventArgs & BlazorDragEventArgs): void { let element: Element = closest(e.element, '.' + (isTreeElement ? cls.LIST_ITEM : cls.PIVOT_BUTTON_CLASS)); (this.parent.dotNetRef as any).invokeMethodAsync('TriggerNodeDraggingEvent', element.getAttribute('data-uid')).then((eventArgs: FieldDragStartEventArgs) => { if (!eventArgs.cancel) { this.parent.isDragging = true; let data: IOlapField = this.parent.fieldList[element.getAttribute('data-uid')]; let axis: string[] = [cls.ROW_AXIS_CLASS, cls.COLUMN_AXIS_CLASS, cls.FILTER_AXIS_CLASS]; addClass([isTreeElement ? element.querySelector('.' + cls.LIST_TEXT_CLASS) : element], cls.SELECTED_NODE_CLASS); if (data && data.aggregateType === 'CalculatedField') { for (let axisContent of axis) { addClass([this.parent.parentElement.querySelector('.' + axisContent)], cls.NO_DRAG_CLASS); } } e.bindEvents(e.dragElement); } else { this.parent.isDragging = false; this.draggable.intDestroy(e.event); detach(document.getElementById(this.parent.element.id + '_DragClone')); } }); } private onDragStop(isTreeElement: boolean, args: DragEventArgs & DragStopEventArgs): void { this.parent.isDragging = false; let cancel: boolean = false; if (!isTreeElement && args.target.classList && (args.target.classList.contains(cls.GROUP_CHART_VALUE) || args.target.classList.contains(cls.GROUP_CHART_VALUE_DROPDOWN))) { args.target = this.parent.element.querySelector('.' + cls.GROUP_CHART_ROW); } if (!isTreeElement && args.target.classList && args.element && (args.target.classList.contains(cls.GROUP_CHART_COLUMN) || args.target.classList.contains(cls.GROUP_CHART_COLUMN_DROPDOWN))) { cancel = true; } let element: Element = closest(args.element, '.' + (isTreeElement ? cls.LIST_ITEM : cls.PIVOT_BUTTON_CLASS)); if (this.parent.parentElement.querySelector('.' + cls.SELECTED_NODE_CLASS)) { removeClass([].slice.call(this.parent.parentElement.querySelectorAll('.' + cls.SELECTED_NODE_CLASS)), cls.SELECTED_NODE_CLASS); } let axis: string[] = [cls.ROW_AXIS_CLASS, cls.COLUMN_AXIS_CLASS, cls.FILTER_AXIS_CLASS]; for (let axisContent of axis) { removeClass([this.parent.parentElement.querySelector('.' + axisContent)], cls.NO_DRAG_CLASS); } removeClass([isTreeElement ? element.querySelector('.' + cls.LIST_TEXT_CLASS) : element], cls.SELECTED_NODE_CLASS); if (document.getElementById(this.parent.element.id + '_DragClone')) { remove(args.helper ? args.helper : document.getElementById(this.parent.element.id + '_DragClone')); } document.body.style.cursor = 'auto'; if (!this.isNodeDropped(isTreeElement, args, element) || !isTreeElement && cancel) { return; } this.nodeStateModified(isTreeElement, args, cancel, element.getAttribute('data-uid')); } private nodeStateModified(isTreeElement: boolean, args: DragEventArgs, cancel: boolean, fieldName: string): void { /* tslint:disable */ let target: string = closest(args.target, '.' + cls.DROPPABLE_CLASS) ? JSON.stringify((window as any).sfBlazor.getDomObject('dropTarget', closest(args.target, '.' + cls.DROPPABLE_CLASS))) : undefined; let element: string = isTreeElement ? undefined : JSON.stringify((window as any).sfBlazor.getDomObject('element', args.element.parentElement)); this.parent.dotNetRef.invokeMethodAsync('OnFieldDropped', (window as any).sfBlazor.getDomObject('target', args.target).xPath, target, element, isTreeElement || cancel ? true : false, fieldName); /* tslint:enable */ } private isNodeDropped(isTreeElement: boolean, args: DragEventArgs, element: Element): boolean { let isDropped: boolean = true; let targetID: string = element.getAttribute('data-uid'); if ((this.parent.fieldList[targetID] && this.parent.fieldList[targetID].isSelected) || !isTreeElement) { let target: Element = isTreeElement ? this.getButton(targetID) : element; let axisPanel: HTMLElement = closest(target, '.' + cls.DROPPABLE_CLASS) as HTMLElement; let droppableElement: HTMLElement = closest(args.target, '.' + cls.DROPPABLE_CLASS) as HTMLElement; if (target && axisPanel === droppableElement) { let pivotButtons: HTMLElement[] = [].slice.call(axisPanel.querySelectorAll('.' + cls.PIVOT_BUTTON_CLASS)); let dropTarget: HTMLElement = closest(args.target, '.' + cls.PIVOT_BUTTON_DIV_CLASS) as HTMLElement; let sourcePosition: number; let dropPosition: number = -1; for (let i: number = 0; i < pivotButtons.length; i++) { if (pivotButtons[i].id === target.id) { sourcePosition = i; } if (dropTarget) { let droppableButton: HTMLElement = dropTarget.querySelector('.' + cls.PIVOT_BUTTON_CLASS); if (pivotButtons[i].id === droppableButton.id) { dropPosition = i; } } } if (sourcePosition === dropPosition || sourcePosition === pivotButtons.length - 1 && dropPosition === -1) { /* tslint:disable-next-line:max-line-length */ removeClass([].slice.call(this.parent.parentElement.querySelectorAll('.' + cls.DROP_INDICATOR_CLASS)), cls.INDICATOR_HOVER_CLASS); isDropped = false; } } } return isDropped; } private getButton(fieldName: string): Element { for (let buttonElement of [].slice.call(this.parent.parentElement.querySelectorAll('.' + cls.PIVOT_BUTTON_CLASS))) { if ((buttonElement as HTMLElement).id === fieldName) { return buttonElement as Element; } } return undefined; } public getButtonPosition(target: HTMLElement, droppedClass: string): number { let buttonElement: HTMLElement = closest(target, '.' + cls.PIVOT_BUTTON_DIV_CLASS) as HTMLElement; if (buttonElement) { buttonElement = buttonElement.querySelector('.' + cls.PIVOT_BUTTON_CLASS); /* tslint:disable-next-line:max-line-length */ let pivotButtons: HTMLElement[] = [].slice.call(this.parent.parentElement.querySelector('.e-' + droppedClass).querySelectorAll('.' + cls.PIVOT_BUTTON_CLASS)); for (let i: number = 0, n: number = pivotButtons.length; i < n; i++) { if (pivotButtons[i].id === buttonElement.id) { return i; } } } return -1; } private wireEvents(element: HTMLElement): void { EventHandler.add(element, 'mouseover', this.parent.commonActionModule.updateDropIndicator, this); EventHandler.add(element, 'mouseleave', this.parent.commonActionModule.updateDropIndicator, this); } private unWireEvents(element: HTMLElement): void { EventHandler.remove(element, 'mouseover', this.parent.commonActionModule.updateDropIndicator); EventHandler.remove(element, 'mouseleave', this.parent.commonActionModule.updateDropIndicator); } public destroy(): void { for (let element of [].slice.call(this.parent.parentElement.querySelectorAll('.' + cls.AXIS_CONTENT_CLASS))) { this.unWireEvents(element); } if (this.draggable && this.draggable.isDestroyed) this.draggable.destroy(); } }
new Droppable(element, {}); this.unWireEvents(element);
streptomycescatenulae.py
""" This file offers the methods to automatically retrieve the graph Streptomyces catenulae. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--protein association networks with increased coverage, supporting functional discovery in genome-wide experimental datasets}, author={Szklarczyk, Damian and Gable, Annika L and Lyon, David and Junge, Alexander and Wyder, Stefan and Huerta-Cepas, Jaime and Simonovic, Milan and Doncheva, Nadezhda T and Morris, John H and Bork, Peer and others}, journal={Nucleic acids research}, volume={47}, number={D1}, pages={D607--D613}, year={2019}, publisher={Oxford University Press} } ``` """ from typing import Dict from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph from ...ensmallen import Graph # pylint: disable=import-error def
( directed: bool = False, preprocess: bool = True, load_nodes: bool = True, verbose: int = 2, cache: bool = True, cache_path: str = "graphs/string", version: str = "links.v11.5", **additional_graph_kwargs: Dict ) -> Graph: """Return new instance of the Streptomyces catenulae graph. The graph is automatically retrieved from the STRING repository. Parameters ------------------- directed: bool = False Wether to load the graph as directed or undirected. By default false. preprocess: bool = True Whether to preprocess the graph to be loaded in optimal time and memory. load_nodes: bool = True, Whether to load the nodes vocabulary or treat the nodes simply as a numeric range. verbose: int = 2, Wether to show loading bars during the retrieval and building of the graph. cache: bool = True Whether to use cache, i.e. download files only once and preprocess them only once. cache_path: str = "graphs" Where to store the downloaded graphs. version: str = "links.v11.5" The version of the graph to retrieve. The available versions are: - homology.v11.0 - homology.v11.5 - physical.links.v11.0 - physical.links.v11.5 - links.v11.0 - links.v11.5 additional_graph_kwargs: Dict Additional graph kwargs. Returns ----------------------- Instace of Streptomyces catenulae graph. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--protein association networks with increased coverage, supporting functional discovery in genome-wide experimental datasets}, author={Szklarczyk, Damian and Gable, Annika L and Lyon, David and Junge, Alexander and Wyder, Stefan and Huerta-Cepas, Jaime and Simonovic, Milan and Doncheva, Nadezhda T and Morris, John H and Bork, Peer and others}, journal={Nucleic acids research}, volume={47}, number={D1}, pages={D607--D613}, year={2019}, publisher={Oxford University Press} } ``` """ return AutomaticallyRetrievedGraph( graph_name="StreptomycesCatenulae", repository="string", version=version, directed=directed, preprocess=preprocess, load_nodes=load_nodes, verbose=verbose, cache=cache, cache_path=cache_path, additional_graph_kwargs=additional_graph_kwargs )()
StreptomycesCatenulae
datetime.rs
use std::fmt; use std::str::{self, FromStr}; use std::error; use serde::{de, ser}; /// A parsed TOML datetime value /// /// This structure is intended to represent the datetime primitive type that can /// be encoded into TOML documents. This type is a parsed version that contains /// all metadata internally. /// /// Currently this type is intentionally conservative and only supports /// `to_string` as an accessor. Over time though it's intended that it'll grow /// more support! /// /// Note that if you're using `Deserialize` to deserialize a TOML document, you /// can use this as a placeholder for where you're expecting a datetime to be /// specified. /// /// Also note though that while this type implements `Serialize` and /// `Deserialize` it's only recommended to use this type with the TOML format, /// otherwise encoded in other formats it may look a little odd. #[derive(PartialEq, Clone)] pub struct Datetime { date: Option<Date>, time: Option<Time>, offset: Option<Offset>, } /// Error returned from parsing a `Datetime` in the `FromStr` implementation. #[derive(Debug, Clone)] pub struct DatetimeParseError { _private: (), } // Currently serde itself doesn't have a datetime type, so we map our `Datetime` // to a special valid in the serde data model. Namely one with thiese special // fields/struct names. // // In general the TOML encoder/decoder will catch this and not literally emit // these strings but rather emit datetimes as they're intended. pub const SERDE_STRUCT_FIELD_NAME: &'static str = "$__toml_private_datetime"; pub const SERDE_STRUCT_NAME: &'static str = "$__toml_private_Datetime"; #[derive(PartialEq, Clone)] struct Date { year: u16, month: u8, day: u8, } #[derive(PartialEq, Clone)] struct Time { hour: u8, minute: u8, second: u8, secfract: Option<f64>, } #[derive(PartialEq, Clone)] enum Offset { Z, Custom { hours: i8, minutes: u8 }, } impl fmt::Debug for Datetime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(self, f) } } impl fmt::Display for Datetime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(ref date) = self.date { write!(f, "{}", date)?; } if let Some(ref time) = self.time { if self.date.is_some() { write!(f, "T")?; } write!(f, "{}", time)?;
} Ok(()) } } impl fmt::Display for Date { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:04}-{:02}-{:02}", self.year, self.month, self.day) } } impl fmt::Display for Time { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:02}:{:02}:{:02}", self.hour, self.minute, self.second)?; if let Some(i) = self.secfract { let s = format!("{}", i); write!(f, "{}", s.trim_left_matches("0"))?; } Ok(()) } } impl fmt::Display for Offset { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Offset::Z => write!(f, "Z"), Offset::Custom { hours, minutes } => { write!(f, "{:+03}:{:02}", hours, minutes) } } } } impl FromStr for Datetime { type Err = DatetimeParseError; fn from_str(date: &str) -> Result<Datetime, DatetimeParseError> { // Accepted formats: // // 0000-00-00T00:00:00.00Z // 0000-00-00T00:00:00.00 // 0000-00-00 // 00:00:00.00 if date.len() < 3 { return Err(DatetimeParseError { _private: () }) } let mut offset_allowed = true; let mut chars = date.chars(); // First up, parse the full date if we can let full_date = if chars.clone().nth(2) == Some(':') { offset_allowed = false; None } else { let y1 = digit(&mut chars)? as u16; let y2 = digit(&mut chars)? as u16; let y3 = digit(&mut chars)? as u16; let y4 = digit(&mut chars)? as u16; match chars.next() { Some('-') => {} _ => return Err(DatetimeParseError { _private: () }), } let m1 = digit(&mut chars)?; let m2 = digit(&mut chars)?; match chars.next() { Some('-') => {} _ => return Err(DatetimeParseError { _private: () }), } let d1 = digit(&mut chars)?; let d2 = digit(&mut chars)?; let date = Date { year: y1 * 1000 + y2 * 100 + y3 * 10 + y4, month: m1 * 10 + m2, day: d1 * 10 + d2, }; if date.month < 1 || date.month > 12 { return Err(DatetimeParseError { _private: () }) } if date.day < 1 || date.day > 31 { return Err(DatetimeParseError { _private: () }) } Some(date) }; // Next parse the "partial-time" if available let partial_time = if full_date.is_some() && chars.clone().next() == Some('T') { chars.next(); true } else { full_date.is_none() }; let time = if partial_time { let h1 = digit(&mut chars)?; let h2 = digit(&mut chars)?; match chars.next() { Some(':') => {} _ => return Err(DatetimeParseError { _private: () }), } let m1 = digit(&mut chars)?; let m2 = digit(&mut chars)?; match chars.next() { Some(':') => {} _ => return Err(DatetimeParseError { _private: () }), } let s1 = digit(&mut chars)?; let s2 = digit(&mut chars)?; let secfract = if chars.clone().next() == Some('.') { chars.next(); let mut first = true; let whole = chars.as_str(); let mut end = whole.len(); for (i, c) in whole.char_indices() { match c { '0' ... '9' => {} _ => { end = i; break } } first = false; } if first { return Err(DatetimeParseError { _private: () }) } chars = whole[end..].chars(); match format!("0.{}", &whole[..end]).parse() { Ok(f) => Some(f), Err(_) => return Err(DatetimeParseError { _private: () }), } } else { None }; let time = Time { hour: h1 * 10 + h2, minute: m1 * 10 + m2, second: s1 * 10 + s2, secfract: secfract, }; if time.hour > 24 { return Err(DatetimeParseError { _private: () }) } if time.minute > 59 { return Err(DatetimeParseError { _private: () }) } if time.second > 60 { return Err(DatetimeParseError { _private: () }) } Some(time) } else { offset_allowed = false; None }; // And finally, parse the offset let offset = if offset_allowed { let next = chars.clone().next(); if next == Some('Z') { chars.next(); Some(Offset::Z) } else if next.is_none() { None } else { let sign = match next { Some('+') => 1, Some('-') => -1, _ => return Err(DatetimeParseError { _private: () }), }; chars.next(); let h1 = digit(&mut chars)? as i8; let h2 = digit(&mut chars)? as i8; match chars.next() { Some(':') => {} _ => return Err(DatetimeParseError { _private: () }), } let m1 = digit(&mut chars)?; let m2 = digit(&mut chars)?; Some(Offset::Custom { hours: sign * (h1 * 10 + h2), minutes: m1 * 10 + m2, }) } } else { None }; // Return an error if we didn't hit eof, otherwise return our parsed // date if chars.next().is_some() { return Err(DatetimeParseError { _private: () }) } Ok(Datetime { date: full_date, time: time, offset: offset, }) } } fn digit(chars: &mut str::Chars) -> Result<u8, DatetimeParseError> { match chars.next() { Some(c) if '0' <= c && c <= '9' => Ok(c as u8 - b'0'), _ => Err(DatetimeParseError { _private: () }), } } impl ser::Serialize for Datetime { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: ser::Serializer { use serde::ser::SerializeStruct; let mut s = serializer.serialize_struct(SERDE_STRUCT_NAME, 1)?; s.serialize_field(SERDE_STRUCT_FIELD_NAME, &self.to_string())?; s.end() } } impl<'de> de::Deserialize<'de> for Datetime { fn deserialize<D>(deserializer: D) -> Result<Datetime, D::Error> where D: de::Deserializer<'de> { struct DatetimeVisitor; impl<'de> de::Visitor<'de> for DatetimeVisitor { type Value = Datetime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("a TOML datetime") } fn visit_map<V>(self, mut visitor: V) -> Result<Datetime, V::Error> where V: de::MapAccess<'de> { let value = visitor.next_key::<DatetimeKey>()?; if value.is_none() { return Err(de::Error::custom("datetime key not found")) } let v: DatetimeFromString = visitor.next_value()?; Ok(v.value) } } static FIELDS: [&'static str; 1] = [SERDE_STRUCT_FIELD_NAME]; deserializer.deserialize_struct(SERDE_STRUCT_NAME, &FIELDS, DatetimeVisitor) } } struct DatetimeKey; impl<'de> de::Deserialize<'de> for DatetimeKey { fn deserialize<D>(deserializer: D) -> Result<DatetimeKey, D::Error> where D: de::Deserializer<'de> { struct FieldVisitor; impl<'de> de::Visitor<'de> for FieldVisitor { type Value = (); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("a valid datetime field") } fn visit_str<E>(self, s: &str) -> Result<(), E> where E: de::Error { if s == SERDE_STRUCT_FIELD_NAME { Ok(()) } else { Err(de::Error::custom("expected field with custom name")) } } } deserializer.deserialize_identifier(FieldVisitor)?; Ok(DatetimeKey) } } pub struct DatetimeFromString { pub value: Datetime, } impl<'de> de::Deserialize<'de> for DatetimeFromString { fn deserialize<D>(deserializer: D) -> Result<DatetimeFromString, D::Error> where D: de::Deserializer<'de> { struct Visitor; impl<'de> de::Visitor<'de> for Visitor { type Value = DatetimeFromString; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("string containing a datetime") } fn visit_str<E>(self, s: &str) -> Result<DatetimeFromString, E> where E: de::Error, { match s.parse() { Ok(date) => Ok(DatetimeFromString { value: date }), Err(e) => Err(de::Error::custom(e)), } } } deserializer.deserialize_str(Visitor) } } impl fmt::Display for DatetimeParseError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { "failed to parse datetime".fmt(f) } } impl error::Error for DatetimeParseError { fn description(&self) -> &str { "failed to parse datetime" } }
} if let Some(ref offset) = self.offset { write!(f, "{}", offset)?;
Brands.js
import React from 'react'; import styled from 'styled-components'; import { StaticQuery, graphql } from 'gatsby'; import Img from 'gatsby-image'; import { Section, Container } from '@components/global'; import ExternalLink from '@common/ExternalLink'; const LOGOS = [ ]; const UsedBy = () => ( <StaticQuery query={graphql` query { art_story: file( sourceInstanceName: { eq: "art" } name: { eq: "tell_story" } ) { childImageSharp { fluid(maxWidth: 1200) { ...GatsbyImageSharpFluid_withWebp_tracedSVG } } } } `} render={data => ( <Section id="brands" accent> <StyledContainer> <div> <h1>Used by biggest in tech</h1> <LogoGrid> {LOGOS.map(({ logo, link }) => ( <ExternalLink key={link} href={link}> {logo()}
</LogoGrid> </div> <Art> <Img fluid={data.art_story.childImageSharp.fluid} /> </Art> </StyledContainer> </Section> )} /> ); const LogoGrid = styled.div` display: grid; grid-template-columns: 1fr 1fr; grid-gap: 64px; justify-items: center; margin-top: 96px; a { svg { width: 100%; } } @media (max-width: ${props => props.theme.screen.sm}) { grid-template-columns: 1fr; } `; const StyledContainer = styled(Container)` display: flex; justify-content: flex-end; position: relative; @media (max-width: ${props => props.theme.screen.md}) { justify-content: center; } `; const Art = styled.figure` width: 600px; position: absolute; top: -12%; right: 50%; @media (max-width: ${props => props.theme.screen.lg}) { top: 0; right: 65%; width: 500px; } @media (max-width: ${props => props.theme.screen.md}) { display: none; } `; export default UsedBy;
</ExternalLink> ))}
AbstractEntity.ts
Column, PrimaryGeneratedColumn } from 'typeorm'; export abstract class AbstractEntity extends BaseEntity { @PrimaryGeneratedColumn('uuid') id: string; @CreateDateColumn() createdAt: Date; @UpdateDateColumn() updatedAt: Date; @Column({ type: 'timestamp without time zone', nullable: true }) deletedAt: Date; }
import { BaseEntity, CreateDateColumn, UpdateDateColumn,
start.rs
use nu_errors::ShellError; use nu_protocol::{CallInfo, Value}; use nu_source::{Tag, Tagged, TaggedItem}; use std::path::Path; #[cfg(not(target_os = "windows"))] use std::process::{Command, Stdio}; #[derive(Default)] pub struct Start { pub tag: Tag, pub filenames: Vec<Tagged<String>>, pub application: Option<String>, } impl Start { pub fn new() -> Start { Start { tag: Tag::unknown(), filenames: vec![], application: None, } } pub fn parse(&mut self, call_info: CallInfo) -> Result<(), ShellError> { self.tag = call_info.name_tag.clone(); self.parse_filenames(&call_info)?; self.parse_application(&call_info); Ok(()) } fn add_filename(&mut self, filename: Tagged<String>) -> Result<(), ShellError> { if Path::new(&filename.item).exists() || url::Url::parse(&filename.item).is_ok() { self.filenames.push(filename); Ok(()) } else { Err(ShellError::labeled_error( format!("The file '{}' does not exist", filename.item), "doesn't exist",
fn glob_to_values(&self, value: &Value) -> Result<Vec<Tagged<String>>, ShellError> { let mut result = vec![]; match glob::glob(&value.as_string()?) { Ok(paths) => { for path_result in paths { match path_result { Ok(path) => result .push(path.to_string_lossy().to_string().tagged(value.tag.clone())), Err(glob_error) => { return Err(ShellError::labeled_error( format!("{}", glob_error), "glob error", value.tag.clone(), )); } } } } Err(pattern_error) => { return Err(ShellError::labeled_error( format!("{}", pattern_error), "invalid pattern", value.tag.clone(), )) } } Ok(result) } fn parse_filenames(&mut self, call_info: &CallInfo) -> Result<(), ShellError> { let candidates = match &call_info.args.positional { Some(values) => { let mut result = vec![]; for value in values.iter() { let res = self.glob_to_values(value)?; result.extend(res); } if result.is_empty() { return Err(ShellError::labeled_error( "No filename(s) given", "no filename(s) given", self.tag.span, )); } result } None => { return Err(ShellError::labeled_error( "No filename(s) given", "no filename(s) given", self.tag.span, )) } }; for candidate in candidates { self.add_filename(candidate)?; } Ok(()) } fn parse_application(&mut self, call_info: &CallInfo) { self.application = if let Some(app) = call_info.args.get("application") { match app.as_string() { Ok(name) => Some(name), Err(_) => None, } } else { None }; } #[cfg(target_os = "macos")] pub fn exec(&mut self) -> Result<(), ShellError> { let mut args = vec![]; args.append( &mut self .filenames .iter() .map(|x| x.item.clone()) .collect::<Vec<_>>(), ); if let Some(app_name) = &self.application { args.append(&mut vec![String::from("-a"), app_name.to_string()]); } exec_cmd("open", &args, self.tag.clone()) } #[cfg(target_os = "windows")] pub fn exec(&mut self) -> Result<(), ShellError> { if let Some(app_name) = &self.application { for file in &self.filenames { match open::with(&file.item, app_name) { Ok(_) => continue, Err(_) => { return Err(ShellError::labeled_error( "Failed to open file with specified application", "can't open with specified application", file.tag.span, )) } } } } else { for file in &self.filenames { match open::that(&file.item) { Ok(_) => continue, Err(_) => { return Err(ShellError::labeled_error( "Failed to open file with default application", "can't open with default application", file.tag.span, )) } } } } Ok(()) } #[cfg(not(any(target_os = "windows", target_os = "macos")))] pub fn exec(&mut self) -> Result<(), ShellError> { let mut args = vec![]; args.append( &mut self .filenames .iter() .map(|x| x.item.clone()) .collect::<Vec<_>>(), ); if let Some(app_name) = &self.application { exec_cmd(&app_name, &args, self.tag.clone()) } else { for cmd in &["xdg-open", "gnome-open", "kde-open", "wslview"] { if exec_cmd(cmd, &args, self.tag.clone()).is_err() { continue; } else { return Ok(()); } } Err(ShellError::labeled_error( "Failed to open file(s) with xdg-open. gnome-open, kde-open, and wslview", "failed to open xdg-open. gnome-open, kde-open, and wslview", self.tag.span, )) } } } #[cfg(not(target_os = "windows"))] fn exec_cmd(cmd: &str, args: &[String], tag: Tag) -> Result<(), ShellError> { if args.is_empty() { return Err(ShellError::labeled_error( "No file(s) or application provided", "no file(s) or application provided", tag, )); } let status = match Command::new(cmd) .stdout(Stdio::null()) .stderr(Stdio::null()) .args(args) .status() { Ok(exit_code) => exit_code, Err(_) => { return Err(ShellError::labeled_error( "Failed to run native open syscall", "failed to run native open call", tag, )) } }; if status.success() { Ok(()) } else { Err(ShellError::labeled_error( "Failed to run start. Hint: The file(s)/application may not exist", "failed to run", tag, )) } }
filename.tag, )) } }
hugelist.go
package main import ( "fmt" "image/color" g "github.com/nomos/giu" ) var ( names []string ) func buildRows() []*g.TableRowWidget { rows := make([]*g.TableRowWidget, len(names)) for i := range rows { rows[i] = g.TableRow( g.Label(fmt.Sprintf("%d", i)), g.Label(names[i]), ) }
rows[0].BgColor(&(color.RGBA{200, 100, 100, 255})) return rows } func loop() { g.SingleWindow("Huge list demo").Layout( g.Label("Note: FastTable only works if all rows have same height"), g.Table("Fast table").Freeze(0, 1).FastMode(true).Rows(buildRows()...), ) } func main() { names = make([]string, 10000) for i := range names { names[i] = fmt.Sprintf("Huge list name demo 范例 %d", i) } wnd := g.NewMasterWindow("Huge list demo", 800, 600, 0) wnd.Run(loop) }
main.go
/* =========================================================================== MIT License Copyright (c) 2021 Manish Meganathan, Mariyam A.Ghani Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =========================================================================== FyrMesh FyrCLI =========================================================================== */ package main import ( "fmt" "github.com/fyrwatch/fyrmesh/fyrcli/cmd" ) func main() { // Colors are defined with ANSI escape commands https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit // Change terminal color to orange fmt.Println("\033[38;5;208m") cmd.Execute()
fmt.Println("\033[0m") }
// Change terminal color to original
settings.ts
/// <reference path="_ref.d.ts" />
import CacheMode = require('../http/CacheMode'); import log = require('../xm/log'); var settings = { // control the cache used as fixture for the tests cache: CacheMode.forceLocal }; // seriously cool deepFreeze(settings); log.debug('helper.settings.cache', CacheMode[settings.cache]); export = settings;
'use strict'; import deepFreeze = require('deep-freeze');
ListObjectsCommand.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListObjectsCommand = void 0; const models_0_1 = require("../models/models_0"); const Aws_restXml_1 = require("../protocols/Aws_restXml"); const middleware_bucket_endpoint_1 = require("@aws-sdk/middleware-bucket-endpoint"); const middleware_serde_1 = require("@aws-sdk/middleware-serde"); const smithy_client_1 = require("@aws-sdk/smithy-client"); /** * <p>Returns some or all (up to 1,000) of the objects in a bucket. You can use the request * parameters as selection criteria to return a subset of the objects in a bucket. A 200 OK * response can contain valid or invalid XML. Be sure to design your application to parse the * contents of the response and handle it appropriately.</p> * <important> * <p>This action has been revised. We recommend that you use the newer version, <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html">ListObjectsV2</a>, when developing applications. For backward compatibility, * Amazon S3 continues to support <code>ListObjects</code>.</p> * </important> * * * <p>The following operations are related to <code>ListObjects</code>:</p> * <ul> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html">ListObjectsV2</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html">GetObject</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">CreateBucket</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html">ListBuckets</a> * </p> * </li> * </ul> * @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { S3Client, ListObjectsCommand } from "@aws-sdk/client-s3"; // ES Modules import * // const { S3Client, ListObjectsCommand } = require("@aws-sdk/client-s3"); // CommonJS import * const client = new S3Client(config); * const command = new ListObjectsCommand(input); * const response = await client.send(command); * ``` * * @see {@link ListObjectsCommandInput} for command's `input` shape. * @see {@link ListObjectsCommandOutput} for command's `response` shape. * @see {@link S3ClientResolvedConfig | config} for command's `input` shape. * */ class ListObjectsCommand extends smithy_client_1.Command { // Start section: command_properties // End section: command_properties constructor(input) { // Start section: command_constructor super(); this.input = input; // End section: command_constructor } /** * @internal */ resolveMiddleware(clientStack, configuration, options) { this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize)); this.middlewareStack.use(middleware_bucket_endpoint_1.getBucketEndpointPlugin(configuration)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "S3Client"; const commandName = "ListObjectsCommand"; const handlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: models_0_1.ListObjectsRequest.filterSensitiveLog, outputFilterSensitiveLog: models_0_1.ListObjectsOutput.filterSensitiveLog,
const { requestHandler } = configuration; return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); } serialize(input, context) { return Aws_restXml_1.serializeAws_restXmlListObjectsCommand(input, context); } deserialize(output, context) { return Aws_restXml_1.deserializeAws_restXmlListObjectsCommand(output, context); } } exports.ListObjectsCommand = ListObjectsCommand; //# sourceMappingURL=ListObjectsCommand.js.map
};
XET.py
#!/usr/bin/python3 import os import sys import time import urllib.request import hashlib try: from colorama import Fore, Back, Style, init except ModuleNotFoundError: print ("You have no colorama installed, i will install it for you") print path = sys.executable #path = path[:-11] path = path.replace("python.exe","") os.system(path+"/Scripts/pip install colorama") print print ("Ok, now you can restart script :)") from colorama import Fore, Back, Style, init from twrp import twrpInstaller init() # here i'm checking wchich os you are using and setting command to clear cmd/terminal window if sys.platform == "linux" or sys.platform == "linux2": clear = lambda: os.system('clear') s = "l" elif sys.platform == "win32": clear = lambda: os.system('cls') s = "w" # some global variables dashed_line = (Fore.MAGENTA + "--------------------------------------------------------------------" + Fore.RESET) killsystem = os.system("adb kill-server") # this is path to /res/ folder and to .py file resPath = os.path.abspath(os.path.dirname(__file__)) + os.sep + "res" + os.sep filePath = os.path.abspath(os.path.dirname(__file__)) + os.sep # resPath = os.path.dirname(sys.executable)+os.sep+"res"+os.sep # filePath = os.path.dirname(sys.executable)+os.sep # this is list of devices with official twrp support devices = ["cancro", "libra", "ferrari", "aqua", "gemini", "virgo", "leo", "scorpio", "jason", "tiffany", "song", "meri", "tisson", "capricorn", "natrium", "lithium", "chiron", "sagit", "hydrogen", "oxygen", "helium", "HM2013023", "armani", "HM2014811", "HM2014813", "omega", "lcsh92_wet_jb9", "gucci", "dior", "hermes", "ido", "land", "hennessy", "kate", "kenzo", "nikel", "prada", "markw", "ugg", "mido", "rolex", "santoni", "mocha", "latte", "cappu","ugglite" ] devicesDict = {'aries': "Mi 2", 'pisces': "Mi 3 TD", 'cancro': "Mi 3 W/Mi 4", 'libra': "Mi 4c", 'ferrari': "Mi 4i", 'aqua': "Mi 4s", 'gemini': "Mi 5", 'virgo': "Mi Note", 'leo': "Mi Note Pro", 'scorpio': "Mi Note 2", 'jason': "Mi Note 3", 'tiffany': "Mi 5x", 'song': "Mi 5c", 'meri': "Mi 5c", 'tissot': "Mi A1", 'capricorn': "Mi 5s", 'natrium': "Mi 5s+", 'lithium': "Mi MIX", 'chiron': "Mi MIX 2",'polaris':'Mi MIX 2s', 'sagit': "Mi 6", 'hydrogen': "Mi MAX", 'oxygen': "Mi MAX 2", 'helium': "Mi MAX PRO", 'HM2013023': "Redmi 1 - WCDMA", 'armani': "Redmi 1s - WCDMA", 'HM2014811': "Redmi 2 - WCDMA", 'HM2014813': "Redmi 2 - TD", 'omega': "Redmi PRO", 'lcsh92_wet_jb9': "Redmi note 1 - 3g-mtk", 'gucci': "Redmi note 1s", 'dior': "Redmi Note 1 - 4g", 'hermes': "Redmi Note 2", 'ido': "Redmi 3", 'land': "Redmi 3 S/X", 'hennessy': "Redmi Note 3 (MTK)", 'kate': "Redmi Note 3 Global", 'kenzo': "Redmi Note 3 Chinese", 'nikel': "Redmi Note 4", 'prada': "Redmi 4", 'markw': "Redmi 4 pro", 'ugg': "Redmi Note 5A", 'mido': "Redmi Note 4/4x", 'rolex': "Redmi 4a", 'santoni': "Redmi 4x", 'ugglite':'Redmi Note 5A','vince':'Redmi Note 5/5+','whyred':'Redmi Note 5 Pro', 'mocha': "Mi PAD", 'latte': "Mi PAD 2", 'cappu': "Mi PAD 3"} googleApps = { "youtube": "com.google.android.youtube", "drive": "com.google.android.apps.docs", "music": "com.google.android.music", "maps": ":com.google.android.apps.maps", "videos": "com.google.android.videos", "photos": "com.google.android.apps.photos", "chrome": "com.android.chrome", "gmail": "com.google.android.gm", "translate": "com.google.android.apps.translate", "duo": "com.google.android.apps.tachyon" } miuiApps = { "bugreport": "com.miui.bugreport", "compass": "com.miui.compass", "video": "com.miui.videoplayer", "mail": "com.android.email", "music": "com.miui.player", "scanner": "com.xiaomi.scanner", "browser": "com.android.browser", "screenrecorder": "com.miui.screenrecorder", "gallery": "com.miui.gallery", "updater": "com.android.updater", "midrop": "com.xiaomi.midrop", "calendar": "com.android.calendar", "miui assistant": "com.mi.android.globalpersonalassistant", "notes": "com.miui.notes", } localmd5s = [ "f337d1707478d63315820a45030f547d", # 0.camera "537e17e2585e731a1c26fbd81eb2affa", # 1.home ] def getInt(): try: case = int(input(Back.BLUE + "choose: " + Back.RESET)) return case except ValueError: print() print(Fore.RED+"Wrong, choose right option!"+Fore.RESET) case = int(getInt()) return case def mydevice(): os.system("adb start-server") os.system("adb shell mount /system") glob_device = os.system("adb shell \"cat /system/build.prop | grep ro.product.device=\" > tmp ") glob_device = open('tmp', 'r').read() open('tmp', "r").close() os.remove("tmp") os.system("adb shell umount /system") glob_device = glob_device.lstrip('ro.product.device')[1:] codename = ''.join(glob_device.split()) devicename = codename clear() for key, values in devicesDict.items(): if key == codename: codename = values return codename elif key != codename: continue codename = "none" return codename # Thanks to stackoverflow! def md5(fname): hash_md5 = hashlib.md5() with open(fname, "rb") as f: for chunk in iter(lambda: f.read(4096), b""): hash_md5.update(chunk) return hash_md5.hexdigest() def dpiChanger(): print(dashed_line) os.system("adb shell mount /system") print("Make sure that you made a build.prop backup! just in case") dpi = input("Tell me what is your desired dpi: ") print("Ok, i'll change dpi to this value!") os.system('adb shell "grep -v "ro.sf.lcd_density" /system/build.prop > /system/build.prop.2"') os.system('adb shell "cp /system/build.prop.2 /system/build.prop"') os.system('adb shell "echo "ro.sf.lcd_density = ' + dpi + '" >> /system/build.prop"') os.system('adb shell "chmod 644 /system/build.prop"') print("Dpi has been changed!" + Fore.RESET) os.system("adb shell umount /system") input("push enter to continue") print(dashed_line) sTweaksMenu() def mix2Cam(): print(dashed_line) path = resPath + os.sep + "cam.apk" os.system("adb shell mount /system") isf = os.path.isfile(os.path.dirname(resPath) + os.sep + "cam.apk") if not isf: print(Fore.WHITE + "I need to download camera file first, be patient please" + Fore.RESET) urllib.request.urlretrieve('http://www1.zippyshare.com/d/T0XrorQl/9267/cam.apk', resPath + 'cam.apk') elif isf: print(Fore.WHITE + "Ok, you have camera file already!" + Fore.RESET) md5sum = md5(path) if md5sum == localmd5s[0]: os.system("adb push " + resPath + "cam.apk /system/priv-app/MiuiCamera/MiuiCamera.apk") os.system("adb shell chmod 644 /system/priv-app/MiuiCamera/MiuiCamera.apk") print(Back.BLUE + "Your old camera is still here, backed up, just in case" + Back.RESET) os.system("adb shell umount /system") input(Fore.GREEN + "push enter to continue" + Fore.RESET) print(dashed_line) sTweaksMenu() else: print("But it's looks like it's broken, let me re-download it!") os.remove(path) mix2Cam() def comMiuiHome(): print(dashed_line) path = resPath + os.sep + "com.miui.home" os.system("adb shell mount /system") os.system("adb shell mv /system/media/theme/default/com.miui.home /system/media/theme/default/com.miui.home.old") isf = os.path.isfile(os.path.dirname(resPath) + os.sep + "com.miui.home") if not isf: print(Fore.WHITE + "I need to download custom home file first, be patient please" + Fore.RESET) urllib.request.urlretrieve('http://www9.zippyshare.com/d/dRMuSMgW/9585/com.miui.home', resPath + 'com.miui.home') elif isf: print(Fore.WHITE + "Ok, you have custom home file already!" + Fore.RESET) md5sum = md5(path) if md5sum == localmd5s[1]: os.system("adb push " + resPath + "com.miui.home /system/media/theme/default/com.miui.home") os.system("adb shell chmod 644 /system/media/theme/default/com.miui.home") print(Back.BLUE + "Your old com.miui.home is still here, backed up, just in case" + Back.RESET) os.system("adb shell umount /system") input(Fore.GREEN +"push enter to continue" + Fore.RESET) print(dashed_line) sTweaksMenu() else: os.remove(path) print("But it's looks like it's broken, let me re-download it!") comMiuiHome() def bl(): os.system("adb reboot bootloader") clear() print(dashed_line) print("Your bootloader status is: ") os.system('fastboot oem device-info > results.txt 2>&1') bl = open('results.txt', 'r').read() os.remove('results.txt') # bl = bl[72]+bl[73]+bl[74]+bl[75]+bl[76] if bl[72] == "t": bl = "Unlocked" print(Fore.GREEN + bl + Fore.RESET) elif bl[72] == "f": bl = "Locked" print(Fore.RED + bl + Fore.RESET) print() input(Back.BLUE + "Push enter to exit" + Back.RESET) menu() def sideloader(): while (True): print(dashed_line) print( Fore.WHITE + "Due to problems with adb sideload implementation, you have to start sideload on your phone manually!" + Fore.RESET) sideloadFile = input(Back.BLUE + "Drag and drop your file here: " + Back.RESET) os.system("adb sideload " + sideloadFile) ifContinue = input("Do you want to sideload next file? (y/n)") ifContinue = str(ifContinue).lower() if ifContinue == 'n': print(Fore.WHITE + "Ok, we'll go back now" + Fore.RESET) input("Push enter to continue") print(dashed_line) menu() elif ifContinue == "y": print(Fore.WHITE + "Ok! so here we go again" + Fore.RESET) else: print( Fore.RED + "Wrong option, so we will stop now, if u want to continue sideloading, just re launch this option from menu" + Fore.RESET) print(dashed_line) time.sleep(5) menu() def remover(appList): print(dashed_line + Fore.LIGHTCYAN_EX) i = 1 for key, values in appList.items(): print("%i. %s" % (i, key.capitalize())) i = i + 1 print() print("0. Exit") case = getInt() i = 0 if case == 0: clear() sTweaksMenu() else: for key, values in appList.items(): pckg = values if case == i + 1: clear() print(dashed_line + Fore.GREEN) os.system("adb shell \"pm uninstall -k --user 0 %s\"" % pckg) print (pckg) if appList==miuiApps: removermiui() elif appList==googleApps: removergoogle() else: i = i + 1 continue def appremover(): print(dashed_line) print(Fore.YELLOW + "| X.E.T |") print("| App remover menu |") print(dashed_line) print(Fore.CYAN + "| 1. Miui Apps") print(dashed_line) print(Fore.CYAN +"| 2. Google Apps") print(dashed_line) print(Fore.CYAN +"| 3. Full") print(Fore.RED + "| ^This one will remove all possible google and miui apps"+Fore.RESET) print(dashed_line) print(Fore.CYAN + "| 0. Exit") print(dashed_line) case = getInt() if case == 1: clear() remover(miuiApps) elif case == 2: clear() remover(googleApps) elif case == 3: apps = list("") pckg = list("") i = 0 for key, values in googleApps.items(): apps.append(key) pckg.append(values) i = i + 1 continue for key, values in miuiApps.items(): apps.append(key) pckg.append(values) i = i + 1
continue print(Fore.RED + "Are you sure you want to remove: %s?" % ', '.join(apps)) case = input(Back.BLUE + "Y/N: " + Back.RESET) if case.lower() == "y": for x in pckg: os.system("adb shell \" pm uninstall -k --user 0 %s\"" % x) clear() print(dashed_line) print("Everything seems to be removed") input("Press enter to go back") sTweaksMenu() elif case.lower() == "n": sTweaksMenu() elif case==0: sTweaksMenu() def rbMenu(): clear() print(mydevice()) print(dashed_line) print(Fore.YELLOW + "| X.E.T |") print("| REBOOT MENU |") print("| Some devices, like RN3P might have problems with reboots |") print("| from system, but reboots should work from adb/fastboot |") print(dashed_line + Fore.RESET) print(Fore.CYAN + "|1. Reboot to recovery |") print(Fore.WHITE + "|Reboot to recovery using ADB (so make sure to turn on debugging) |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|2. Reboot to fastboot |") print(Fore.WHITE + "|Reboot to fastboot using ADB (so make sure to turn on debugging) |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|3. Reboot to system |") print(Fore.WHITE + "|Reboot to system using ADB (so make sure to turn on debugging) |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|4. Reboot to system |") print(Fore.WHITE + "|Reboot to system using Fastboot mode! |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|5. Reboot to adb-sideload |") print(Fore.WHITE + "|Reboot to sideload using ADB-root (so use it when in recovery) |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|6. Boot twrp from file |") print(Fore.WHITE + "|You can use it when you dont want to install it |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|0. Back to main menu |") print(dashed_line + Fore.RESET) case = getInt() if case == 1: clear() os.system('adb reboot recovery') os.system('adb kill-server') rbMenu() elif case == 2: clear() os.system('adb reboot bootloader') os.system('adb kill-server') rbMenu() elif case == 3: clear() os.system('adb reboot') os.system('adb kill-server') rbMenu() elif case == 4: clear() os.system('fastboot reboot') menu() elif case == 5: clear() os.system('adb reboot sideload') menu() elif case == 6: clear() twrp = input("Put twrp file here: ") os.system('fastboot boot '+twrp) menu() elif case == 0: killsystem clear() menu() else: clear() print(Fore.RED + "Error you should choose right option!" + Fore.RESET) input("push enter to continue") rbMenu() # Tweaks def sTweaksMenu(): clear() print(mydevice()) print(dashed_line) print(Fore.YELLOW + "| X.E.T |") print("| SYSTEM TWEEKS MENU |") print(dashed_line) print(Fore.CYAN + "|1. Build.prop backup |") print(Fore.WHITE + "|Use it to backup your build.prop file! |") print(dashed_line) print(Fore.CYAN + "|2. Build.prop restore |") print(Fore.WHITE + "|Use it to restore your build.prop file! |") print(dashed_line) print(Fore.CYAN + "|3. Change DPI |") print(Fore.WHITE + "|For changing dpi more than once, you have to restore build.prop! |") print(dashed_line) print(Fore.CYAN + "|4. Install mix 2 camera |") print(Fore.WHITE + "|Mix 2 camera ported for all Xiaomi devices;Tested only on miui9 |") print(dashed_line) print(Fore.CYAN + "|5. Install modified com.miui.home (desktop grid up to 10x10) |") print(Fore.WHITE + "|Miui 9 exclusive |") print(dashed_line) print(Fore.CYAN + "|6. Activate Camera 2 API |") print(Fore.WHITE + "|Use it to activate cam2api in your build.prop |") print(dashed_line) print(Fore.CYAN + "|7. System apps remover |") print(Fore.WHITE + "|Remove google/miui apss without root, from system |") print(dashed_line) print(Fore.CYAN + "|0. Back to main menu |") print(dashed_line) case = getInt() if case == 1: clear() print(dashed_line) os.system("adb shell mount /system") os.system("adb pull /system/build.prop " + resPath + "build.prop") print(Fore.WHITE + "Backup complete! Your build.prop is now in res folder!" + Fore.RESET) os.system("adb shell umount /system") input("push enter to continue") print(dashed_line) sTweaksMenu() elif case == 2: clear() print(dashed_line) os.system("adb shell mount /system") os.system("adb push " + resPath + "build.prop /system/build.prop") os.system('adb shell "chmod 644 /system/build.prop"') print(Fore.WHITE + "Restore complete!" + Fore.RESET) os.system("adb shell umount /system") input("push enter to continue") print(dashed_line) sTweaksMenu() elif case == 3: clear() dpiChanger() elif case == 4: clear() mix2Cam() elif case == 5: clear() comMiuiHome() elif case == 6: clear() os.system("adb shell mount /system") os.system('adb shell "echo persist.camera.HAL3.enabled=1 >> /system/build.prop"') print("You have enabled Camera 2 API YAY!") os.system("adb shell umount /system") input("push enter to continue") sTweaksMenu() elif case == 7: clear() appremover() elif case == 8: clear() autoroot() elif case == 0: killsystem clear() menu() else: clear() print(Fore.RED + "Error you should choose right option!" + Fore.RESET) input("push enter to continue") sTweaksMenu() # about def aboutMenu(): clear() print(mydevice()) print(dashed_line) print(Fore.YELLOW + "| X.E.T |") print("| About |") print(dashed_line) print(Fore.CYAN + "|1. About script |") print(dashed_line) print(Fore.CYAN + "|2. Contact |") print(dashed_line) print(Fore.CYAN + "|3. Donations |") print(dashed_line) print(Fore.CYAN + "|4. Credits |") print(dashed_line) print(Fore.CYAN + "|0. Back |") print(dashed_line) case = getInt() if case == 1: print(dashed_line) print("Simply script, created by student, to make some tweaks easier to apply") print("First script purpose was to only automatize twrp installing (that's why repo is called twrp-installer)") print("Script is aiming to support Xiaomi devices(Some features are universal) on both Windows and Linux") print("When more test will be made, there will be stable executable version avalible for Windows") print(dashed_line) input() aboutMenu() elif case == 2: print(dashed_line) print("U can contact me on various sites, mostly under nickname Mezutelni") print("- github.com/mezutelni/") print("- miuipolska.pl/forum/profile/7082-mezutelni/") print("- forum.xda-developers.com/member.php?u=6270598") print(dashed_line) input() aboutMenu() elif case == 3: print(dashed_line) print( "If you want to buy me a beer, or keep my servers online, or simply say Thank You, please consider Donation for me") print("You can do it by PayPal on PayPal.me/Mezutelni or by contacting with me directly (see contact)") print(dashed_line) input() aboutMenu() elif case == 4: print(dashed_line) print("Thanks to: ") print("- Facebook group \" Złomowisko Rudej\" for inspiration and help with testing") print("- MiuiPolska forum society for help with testing and trusting me") print("- Orjon from MiuiPolska for idea and alpha code for google's app remover") print(dashed_line) input() aboutMenu() elif case == 0: menu() else: aboutMenu() # main def menu(): clear() print(mydevice()) print(dashed_line) print(Fore.YELLOW + "| X.E.T |") print("| Xiaomi Essential Tools |") print(dashed_line + Fore.RESET) print(Fore.CYAN + "|1. Reboot menu |") print(Fore.WHITE + "|Simple reboot menu, to make your life more comfortable! |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|2. System tweaks |") print(Fore.WHITE + "|Here you can find system tweaks, they are all applied in recovery!|" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|3. Install Recovery |") print(Fore.WHITE + "|Use it to install recovery | Due to server problems, auto installer is off for now|" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|4. Check bootloader status (locked/unlocked) |") print(Fore.WHITE + "|You have to be in fastboot mode to make it work |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|5. ADB sideloader |") print(Fore.WHITE + "|Start in recovery, then use it to flash all zips you want! |" + Fore.RESET) print(dashed_line) print(Fore.CYAN + "|9. About |") print(dashed_line) print(Fore.CYAN + "|0. Exit |") print(dashed_line + Fore.RESET) case = getInt() if case == 1: killsystem rbMenu() elif case == 2: killsystem sTweaksMenu() elif case == 3: killsystem twrpInstaller(mydevice(), s) menu() elif case == 4: clear() bl() input("push enter to continue") menu() elif case == 5: killsystem clear() sideloader() elif case == 9: clear() aboutMenu() elif case == 0: killsystem print(Fore.GREEN + "Consider a donation for me to keep my servers up!") print("www.paypal.me/Mezutelni") sys.exit() else: clear() print("Error choose right option\n" + Fore.RESET) input("push enter to continue") menu() menu()
request_log.py
import logging import sys import time from pyramid.events import NewResponse, NewRequest from pyramid.events import subscriber if sys.version_info[0] < 3: str = basestring log = logging.getLogger(__name__) unlog_pattern = None unlog_route = None authenticated_id = '' @subscriber(NewRequest) def log_request(event): request = event.request if ignore_route(request.path): return request.pyramid_request_log_start = time.time() user = 'UnAuthenticatedUser' if request.authenticated_userid: user = getattr(request.authenticated_userid, authenticated_id, 'AuthenticatedUser') if request.content_type == 'application/json' and request.body: try: body = request.json_body clean(body) except Exception: body = 'Json error' log.info('New request: %s %s (body: %s) (%s: %s)', request.method, request.path_qs, body, authenticated_id, user) else: log.info('New request: %s %s (%s: %s)', request.method, request.path_qs, authenticated_id, user) @subscriber(NewResponse) def log_response(event): request = event.request response = event.response if ignore_route(request.path): return duration = '{:.3f}'.format(time.time() - request.pyramid_request_log_start) extra = { 'method': request.method, 'route_url': request.path_qs, 'status': response.status, 'duration': duration, } user = 'UnAuthenticatedUser' if request.authenticated_userid: user = getattr(request.authenticated_userid, authenticated_id, 'AuthenticatedUser') if response.content_type == 'application/json' and response.body: try: body = response.json_body clean(body) except Exception: body = 'Json error' log.info( 'Response for request: %s %s: HTTPCode: %s, (body: %s) ' '(%s: %s) (endded in %ss)', request.method, request.path_qs, response.status, body, authenticated_id, user, duration, extra=extra, ) else: log.info('Response for request: %s %s: HTTPCode: %s, (%s: %s) ' '(endded in %ss)', request.method, request.path_qs, response.status, authenticated_id, user, duration, extra=extra) def clean(body):
def ignore_route(route): if unlog_route and unlog_route.match(route): return True return False
for key in body: if isinstance(key, (dict, list)): clean(key) elif isinstance(body, dict): if isinstance(body[key], (dict, list)): clean(body[key]) elif unlog_pattern and unlog_pattern.match(key): body[key] = '*'*6
lib.rs
#[cfg(test)] mod tests; /// Silly helper function // pub(crate) fn fill<T>(slice: &mut [T], val: T) // where // T: Copy, // { // for v in slice { // *v = val; // } // } /// This function is here to take care of the common C /// idiom of looping down a pointer to an array and bumping /// the position of the pointer each iteration of the loop. /// This works fine in Rust just by doing `s = s[1..];` /// for immutable borrows, but with mutable ones this behavior /// causes a double-borrow. It SHOULD be safe though, so /// this helper does takes a `&mut` to the slice(!) and does /// it for us. Panics if you try to increment past the end /// of the slice. pub(crate) fn increment_by_mut<T>(slice: &mut &mut [T], amount: usize) { let lifetime_hack = unsafe { let slice_ptr = slice.as_mut_ptr(); ::std::slice::from_raw_parts_mut(slice_ptr, slice.len()) }; *slice = &mut lifetime_hack[amount..] } /// Same as `increment_by_mut()` but operates on a mutable /// reference to an immutable slice. /// /// This is less common than the other way around, 'cause /// we're usually stepping down buffers that are being filled, /// or altered, but let's follow std's convention of naming /// const vs. mut. pub(crate) fn increment_by<T>(slice: &mut &[T], amount: usize) { let lifetime_hack = unsafe { let slice_ptr = slice.as_ptr(); ::std::slice::from_raw_parts(slice_ptr, slice.len()) }; *slice = &lifetime_hack[amount..] } static GPOW43: [f32; 145] = [ 0.0, -1.0, -2.519842, -4.326749, -6.349604, -8.549880, -10.902724, -13.390518, -16.000000, -18.720754, -21.544347, -24.463781, -27.473142, -30.567351, -33.741992, -36.993181, 0.0, 1.0, 2.519842, 4.326749, 6.349604, 8.549880, 10.902724, 13.390518, 16.000000, 18.720754, 21.544347, 24.463781, 27.473142, 30.567351, 33.741992, 36.993181, 40.317474, 43.711787, 47.173345, 50.699631, 54.288352, 57.937408, 61.644865, 65.408941, 69.227979, 73.100443, 77.024898, 81.000000, 85.024491, 89.097188, 93.216975, 97.382800, 101.593667, 105.848633, 110.146801, 114.487321, 118.869381, 123.292209, 127.755065, 132.257246, 136.798076, 141.376907, 145.993119, 150.646117, 155.335327, 160.060199, 164.820202, 169.614826, 174.443577, 179.305980, 184.201575, 189.129918, 194.090580, 199.083145, 204.107210, 209.162385, 214.248292, 219.364564, 224.510845, 229.686789, 234.892058, 240.126328, 245.389280, 250.680604, 256.000000, 261.347174, 266.721841, 272.123723, 277.552547, 283.008049, 288.489971, 293.998060, 299.532071, 305.091761, 310.676898, 316.287249, 321.922592, 327.582707, 333.267377, 338.976394, 344.709550, 350.466646, 356.247482, 362.051866, 367.879608, 373.730522, 379.604427, 385.501143, 391.420496, 397.362314, 403.326427, 409.312672, 415.320884, 421.350905, 427.402579, 433.475750, 439.570269, 445.685987, 451.822757, 457.980436, 464.158883, 470.357960, 476.577530, 482.817459, 489.077615, 495.357868, 501.658090, 507.978156, 514.317941, 520.677324, 527.056184, 533.454404, 539.871867, 546.308458, 552.764065, 559.238575, 565.731879, 572.243870, 578.774440, 585.323483, 591.890898, 598.476581, 605.080431, 611.702349, 618.342238, 625.000000, 631.675540, 638.368763, 645.079578, ]; #[derive(Copy)] #[repr(C)] pub struct Mp3Dec { pub mdct_overlap: [[f32; 288]; 2], pub qmf_state: [f32; 960], pub reserv: i32, pub free_format_bytes: i32, pub header: [u8; 4], pub reserv_buf: [u8; 511], } impl Clone for Mp3Dec { fn clone(&self) -> Self { *self } } impl Mp3Dec { pub fn new() -> Self { Self { mdct_overlap: [[0.0; 288]; 2], qmf_state: [0.0; 960], reserv: 0, free_format_bytes: 0, header: [0; 4], reserv_buf: [0; 511], } } } #[derive(Copy, Default, Debug)] #[repr(C)] pub struct FrameInfo { pub frame_bytes: i32, pub channels: i32, pub hz: i32, pub layer: i32, pub bitrate_kbps: i32, } impl Clone for FrameInfo { fn clone(&self) -> Self { *self } } #[derive(Copy, Debug, Default)] #[repr(C)] pub struct Bs<'a> { // pub buf: *const u8, pub buf: &'a [u8], // TODO: Should be usize pub pos: i32, // TODO: Should be usize pub limit: i32, } impl<'a> Bs<'a> { pub fn new(buf: &'a [u8], bytes: i32) -> Self { Self { buf, pos: 0, limit: bytes * 8, } } } impl<'a> Clone for Bs<'a> { fn clone(&self) -> Self { *self } } #[derive(Copy, Default)] #[repr(C)] pub struct L3GrInfo { pub sfbtab: &'static [u8], pub part_23_length: u16, pub big_values: u16, pub scalefac_compress: u16, pub global_gain: u8, pub block_type: u8, pub mixed_block_flag: u8, pub n_long_sfb: u8, pub n_short_sfb: u8, pub table_select: [u8; 3], pub region_count: [u8; 3], pub subblock_gain: [u8; 3], pub preflag: u8, pub scalefac_scale: u8, pub count1_table: u8, pub scfsi: u8, } impl Clone for L3GrInfo { fn clone(&self) -> Self { *self } } #[derive(Copy)] #[repr(C)] pub struct Mp3DecScratch<'a> { pub bs: Bs<'a>, pub maindata: [u8; 2815], pub gr_info: [L3GrInfo; 4], pub grbuf: [[f32; 576]; 2], pub scf: [f32; 40], pub syn: [[f32; 64]; 33], pub ist_pos: [[u8; 39]; 2], } impl<'a> Clone for Mp3DecScratch<'a> { fn clone(&self) -> Self { *self } } impl<'a> Mp3DecScratch<'a> { pub(crate) fn clear_grbuf(&mut self) { self.grbuf = [[0.0; 576]; 2]; } } /* pub struct Hdr([u8; 4]); // TODO: Ponder unit tests for these. impl Hdr { pub fn hdr_is_mono(&self) -> bool { // TODO: Might be nicer ways to do these bit-tests (self.0[3] & 0xC0) == 0xC0 } pub fn hdr_is_ms_stereo(&self) -> bool { (self.0[3] & 0xE0) == 0x60 } pub fn hdr_is_free_format(&self) -> bool { (self.0[2] & 0xF0) == 0 } pub fn hdr_is_crc(&self) -> bool { // TODO: Double-check (self.0[1] & 1) == 0 } pub fn hdr_test_padding(&self) -> bool { (self.0[2] & 0x2) != 0 } pub fn hdr_test_mpeg1(&self) -> bool { (self.0[1] & 0x08) != 0 } pub fn hdr_test_not_mpeg25(&self) -> bool { (self.0[1] & 0x10) != 0 } pub fn hdr_test_i_stereo(&self) -> bool { (self.0[3] & 0x10) != 0 } pub fn hdr_test_ms_stereo(&self) -> bool { (self.0[3] & 0x20) != 0 } pub fn hdr_get_stereo_mode(&self) -> u8 { ((self.0[3] >> 6) & 3) } pub fn hdr_get_stereo_mode_ext(&self) -> u8 { ((self.0[3] >> 4) & 3) } pub fn hdr_get_layer(&self) -> u8 { ((self.0[1] >> 1) & 3) } pub fn hdr_get_bitrate(&self) -> u8 { (self.0[2] >> 4) } pub fn hdr_get_sample_rate(&self) -> u8 { ((self.0[2] >> 2) & 3) } pub fn hdr_is_frame_576(&self) -> bool { (self.0[1] & 14) == 2 } pub fn hdr_is_layer_1(&self) -> bool { (self.0[1] & 6) == 6 } pub fn hdr_valid(&self) -> bool { self.0[0] == 0xFF && ((self.0[1] & 0xF0) == 0xF0 || (self.0[1] & 0xFE) == 0xE2) && self.hdr_get_layer() != 0 && self.hdr_get_bitrate() != 15 && self.hdr_get_sample_rate() != 3 } pub fn hdr_compare(h1: Hdr, h2: Hdr) -> bool { h2.hdr_valid() && ((h1.0[1] ^ h2.0[1]) & 0xFE) == 0 && ((h1.0[2] ^ h2.0[2]) & 0x0C) == 0 && !(h1.hdr_is_free_format() ^ h2.hdr_is_free_format()) } pub fn hdr_bitrate_kbps(&self) -> u32 { let halfrate: [[[u32; 15]; 3]; 2] = [ [ [0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80], [0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80], [0, 16, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 112, 128], ], [ [0, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160], [ 0, 16, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, ], [ 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, ], ], ]; 2 * halfrate[self.hdr_test_mpeg1() as usize][self.hdr_get_layer() as usize - 1] [self.hdr_get_bitrate() as usize] } pub fn hdr_sample_rate_hz(&self) -> u32 { let g_hz: [u32; 3] = [44100, 48000, 32000]; g_hz[self.hdr_get_sample_rate() as usize] >> (!self.hdr_test_mpeg1()) as u32 >> (!self.hdr_test_not_mpeg25()) as u32 } pub fn hdr_frame_samples(&self) -> u32 { if self.hdr_is_layer_1() { 384 } else { 1152 >> (self.hdr_is_frame_576() as i32) } } pub fn hdr_frame_bytes(&self, free_format_size: u32) -> u32 { let mut frame_bytes = self.hdr_frame_samples() * self.hdr_bitrate_kbps() * 125 / self.hdr_sample_rate_hz(); if self.hdr_is_layer_1() { // Slot align frame_bytes &= !3; } if frame_bytes != 0 { frame_bytes } else { free_format_size } } pub fn hdr_padding(&self) -> u32 { if self.hdr_test_padding() { if self.hdr_is_layer_1() { 4 } else { 1 } } else { 0 } } } */ // TODO: All the horrible bit-tests in the `hdr_` functions // are macros in the C version; can we translate them back to // functions? pub(crate) fn hdr_valid(h: &[u8]) -> i32 { (h[0] as (i32) == 0xffi32 && (h[1] as (i32) & 0xf0 == 0xf0 || h[1] as (i32) & 0xfei32 == 0xe2) && (h[1] as (i32) >> 1 & 3 != 0) && (h[2] as (i32) >> 4 != 15) && (h[2] as (i32) >> 2 & 3 != 3)) as (i32) } pub(crate) fn hdr_compare(h1: &[u8], h2: &[u8]) -> i32 { (hdr_valid(h2) != 0 && ((h1[1] as (i32) ^ h2[1] as (i32)) & 0xfei32 == 0) && ((h1[2] as (i32) ^ h2[2] as (i32)) & 0xci32 == 0) && ((h1[2] as (i32) & 0xf0 == 0) as (i32) ^ (h2[2] as (i32) & 0xf0 == 0) as (i32) == 0)) as (i32) } pub(crate) fn hdr_frame_samples(h: &[u8]) -> u32 { (if h[1] as (i32) & 6 == 6 { 384 } else { 1152 >> (h[1] as (i32) & 14 == 2) as (i32) }) as (u32) } pub fn hdr_bitrate_kbps(h: &[u8]) -> u32 { static HALFRATE: [[[u8; 15]; 3]; 2] = [ [ [0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80], [0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80], [0, 16, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 112, 128], ], [ [0, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160], [ 0, 16, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, ], [ 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, ], ], ]; let i1 = if (h[1] & 0x8) == 0 { 0 } else { 1 }; let i2 = (((h[1] >> 1) & 3) - 1) as usize; let i3 = (h[2] >> 4) as usize; debug_assert!(i1 < HALFRATE.len()); debug_assert!(i2 < HALFRATE[0].len()); debug_assert!(i3 < HALFRATE[0][0].len()); 2 * HALFRATE[i1][i2][i3] as u32 } pub fn hdr_sample_rate_hz(h: &[u8]) -> u32 { static G_HZ: [u32; 3] = [44100, 48000, 32000]; G_HZ[(h[2] as (i32) >> 2 & 3) as usize] >> (h[1] as (i32) & 0x8 == 0) as (i32) >> (h[1] as (i32) & 0x10 == 0) as (i32) } pub fn hdr_frame_bytes(h: &[u8], free_format_size: i32) -> i32 { let mut frame_bytes: i32 = hdr_frame_samples(h) .wrapping_mul(hdr_bitrate_kbps(h)) .wrapping_mul(125) .wrapping_div(hdr_sample_rate_hz(h)) as (i32); if h[1] as (i32) & 6 == 6 { frame_bytes = frame_bytes & !3; } if frame_bytes != 0 { frame_bytes } else { free_format_size } } pub fn hdr_padding(h: &[u8]) -> i32 { if h[2] as (i32) & 0x2 != 0 { (if h[1] as (i32) & 6 == 6 { 4 } else { 1 }) } else { 0 } } pub(crate) fn mp3d_match_frame(hdr: &[u8], mp3_bytes: i32, frame_bytes: i32) -> i32 { let current_block; let mut i: i32; let mut nmatch: i32; i = 0; nmatch = 0; loop { if !(nmatch < 10) { current_block = 2; break; } i = i + (hdr_frame_bytes(&hdr[i as usize..], frame_bytes) + hdr_padding(&hdr[i as usize..])); if i + 4 > mp3_bytes { current_block = 7; break; } if hdr_compare(hdr, &hdr[i as usize..]) == 0 { current_block = 6; break; } nmatch = nmatch + 1; } if current_block == 2 { 1 } else if current_block == 6 { 0 } else { (nmatch > 0) as (i32) } } // TODO: Make free_format_bytes and ptr_frame_bytes // returned values instead of mut references pub fn mp3d_find_frame( mut mp3: &[u8], mp3_bytes: i32, free_format_bytes: &mut i32, ptr_frame_bytes: &mut i32, ) -> i32 { let current_block; let mut i: i32; let mut k: i32; i = 0; let mut frame_bytes: i32; let mut frame_and_padding: i32 = 0; loop { if !(i < mp3_bytes - 4)
if hdr_valid(mp3) != 0 { frame_bytes = hdr_frame_bytes(mp3, *free_format_bytes); frame_and_padding = frame_bytes + hdr_padding(mp3); k = 4; loop { if !(frame_bytes == 0 && (k < 2304) && (i + 2 * k < mp3_bytes - 4)) { break; } if hdr_compare(mp3, &mp3[k as usize..]) != 0 { let fb: i32 = k - hdr_padding(mp3); let nextfb: i32 = fb + hdr_padding(&mp3[k as usize..]); // TODO: Double-check the hdr_compare() if !(i + k + nextfb + 4 > mp3_bytes || hdr_compare(mp3, &mp3[(k + nextfb) as usize..]) == 0) { frame_and_padding = k; frame_bytes = fb; *free_format_bytes = fb; } } k = k + 1; } if frame_bytes != 0 && (i + frame_and_padding <= mp3_bytes) && (mp3d_match_frame(mp3, mp3_bytes - i, frame_bytes) != 0) || i == 0 && (frame_and_padding == mp3_bytes) { current_block = 9; break; } *free_format_bytes = 0; } i = i + 1; mp3 = &mp3[1..]; } if current_block == 2 { *ptr_frame_bytes = 0; i } else { *ptr_frame_bytes = frame_and_padding; i } } /// Rewritten by hand; original is on /// https://github.com/lieff/minimp3/blob/master/minimp3.h#L232 pub(crate) fn get_bits(bs: &mut Bs, n: u32) -> u32 { let n: i32 = n as i32; let mut next: u32; let mut cache: u32 = 0; let s: i32 = bs.pos & 7; let mut shl: i32 = n + s; let mut p: usize = (bs.pos >> 3) as usize; bs.pos += n; if bs.pos > bs.limit { return 0; } next = (bs.buf[p] & (255 & s) as u8) as u32; p += 1; shl -= 8; while shl > 0 { // println!("cache, next, shl: {}, {}, {}", cache, next, shl); cache |= next.wrapping_shl(shl as u32); next = bs.buf[p] as u32; p += 1; shl -= 8; } // cache | ((next as u32) >> -shl) // Why on Eris's earth is this shifting by an almost-certainly-negative // number? // Pretty sure that's undefined behavior in C. // OH! It's because shl is negative here after we've fallen out // of the while loop! // println!("cache, next, res: {}, {}, {}", cache, next, cache | ((next as u32).wrapping_shl(shl as u32))); cache | ((next as u32).wrapping_shr(-shl as u32)) } #[derive(Copy)] #[repr(C)] pub struct L12ScaleInfo { pub scf: [f32; 192], pub total_bands: u8, pub stereo_bands: u8, pub bitalloc: [u8; 64], pub scfcod: [u8; 64], } impl Clone for L12ScaleInfo { fn clone(&self) -> Self { *self } } impl Default for L12ScaleInfo { fn default() -> Self { Self { scf: [0.0; 192], total_bands: 0, stereo_bands: 0, bitalloc: [0; 64], scfcod: [0; 64], } } } #[derive(Copy)] #[repr(C)] pub struct L12SubbandAlloc { pub tab_offset: u8, pub code_tab_width: u8, pub band_count: u8, } impl Clone for L12SubbandAlloc { fn clone(&self) -> Self { *self } } /// TODO: This *const it returns is actually an array, /// make it return a proper slice if possible. pub(crate) fn l12_subband_alloc_table( hdr: &[u8], sci: &mut L12ScaleInfo, ) -> &'static [L12SubbandAlloc] { let mut alloc: &[L12SubbandAlloc]; let mode: i32 = hdr[3] as (i32) >> 6 & 3; let mut nbands: i32; let stereo_bands: i32 = if mode == 3 { 0 } else if mode == 1 { ((hdr[3] as (i32) >> 4 & 3) << 2) + 4 } else { 32 }; if hdr[1] as (i32) & 6 == 6 { static G_ALLOC_L1: [L12SubbandAlloc; 1] = [L12SubbandAlloc { tab_offset: 76, code_tab_width: 4, band_count: 32, }]; alloc = &G_ALLOC_L1[..]; nbands = 32; } else if hdr[1] as (i32) & 0x8 == 0 { static G_ALLOC_L2M2: [L12SubbandAlloc; 3] = [ L12SubbandAlloc { tab_offset: 60, code_tab_width: 4, band_count: 4, }, L12SubbandAlloc { tab_offset: 44, code_tab_width: 3, band_count: 7, }, L12SubbandAlloc { tab_offset: 44, code_tab_width: 2, band_count: 19, }, ]; alloc = &G_ALLOC_L2M2[..]; nbands = 30; } else { static G_ALLOC_L2M1: [L12SubbandAlloc; 4] = [ L12SubbandAlloc { tab_offset: 0, code_tab_width: 4, band_count: 3, }, L12SubbandAlloc { tab_offset: 16, code_tab_width: 4, band_count: 8, }, L12SubbandAlloc { tab_offset: 32, code_tab_width: 3, band_count: 12, }, L12SubbandAlloc { tab_offset: 40, code_tab_width: 2, band_count: 7, }, ]; let sample_rate_idx: i32 = hdr[2] as (i32) >> 2 & 3; let mut kbps: u32 = hdr_bitrate_kbps(hdr) >> (mode != 3) as (i32); if kbps == 0 { kbps = 192; } alloc = &G_ALLOC_L2M1[..]; nbands = 27; if kbps < 56 { static G_ALLOC_L2M1_LOWRATE: [L12SubbandAlloc; 2] = [ L12SubbandAlloc { tab_offset: 44, code_tab_width: 4, band_count: 2, }, L12SubbandAlloc { tab_offset: 44, code_tab_width: 3, band_count: 10, }, ]; alloc = &G_ALLOC_L2M1_LOWRATE[..]; nbands = if sample_rate_idx == 2 { 12 } else { 8 }; } else if kbps >= 96 && (sample_rate_idx != 1) { nbands = 30; } } (*sci).total_bands = nbands as (u8); (*sci).stereo_bands = if stereo_bands > nbands { nbands } else { stereo_bands } as (u8); alloc } pub(crate) fn l12_read_scalefactors( bs: &mut Bs, mut pba: &mut [u8], scfcod: &mut [u8], bands: i32, mut scf: &mut [f32], ) { static G_DEQ_L12: [f32; 54] = [ 9.53674316e-07 / 3.0, 7.56931807e-07 / 3.0, 6.00777173e-07 / 3.0, 9.53674316e-07 / 7.0, 7.56931807e-07 / 7.0, 6.00777173e-07 / 7.0, 9.53674316e-07 / 15.0, 7.56931807e-07 / 15.0, 6.00777173e-07 / 15.0, 9.53674316e-07 / 31.0, 7.56931807e-07 / 31.0, 6.00777173e-07 / 31.0, 9.53674316e-07 / 63.0, 7.56931807e-07 / 63.0, 6.00777173e-07 / 63.0, 9.53674316e-07 / 127.0, 7.56931807e-07 / 127.0, 6.00777173e-07 / 127.0, 9.53674316e-07 / 255.0, 7.56931807e-07 / 255.0, 6.00777173e-07 / 255.0, 9.53674316e-07 / 511.0, 7.56931807e-07 / 511.0, 6.00777173e-07 / 511.0, 9.53674316e-07 / 1023.0, 7.56931807e-07 / 1023.0, 6.00777173e-07 / 1023.0, 9.53674316e-07 / 2047.0, 7.56931807e-07 / 2047.0, 6.00777173e-07 / 2047.0, 9.53674316e-07 / 4095.0, 7.56931807e-07 / 4095.0, 6.00777173e-07 / 4095.0, 9.53674316e-07 / 8191.0, 7.56931807e-07 / 8191.0, 6.00777173e-07 / 8191.0, 9.53674316e-07 / 16383.0, 7.56931807e-07 / 16383.0, 6.00777173e-07 / 16383.0, 9.53674316e-07 / 32767.0, 7.56931807e-07 / 32767.0, 6.00777173e-07 / 32767.0, 9.53674316e-07 / 65535.0, 7.56931807e-07 / 65535.0, 6.00777173e-07 / 65535.0, 9.53674316e-07 / 3.0, 7.56931807e-07 / 3.0, 6.00777173e-07 / 3.0, 9.53674316e-07 / 5.0, 7.56931807e-07 / 5.0, 6.00777173e-07 / 5.0, 9.53674316e-07 / 9.0, 7.56931807e-07 / 9.0, 6.00777173e-07 / 9.0, ]; let mut i: usize; let mut m: i32; i = 0; loop { if !(i < (bands as usize)) { break; } let mut s: f32 = 0.0; let ba: u32 = { let _old = pba[0]; // pba = pba.offset(1); increment_by_mut(&mut pba, 1); _old } as u32; let mask: i32 = if ba != 0 { 4 + (19 >> scfcod[i] as (i32) & 3) } else { 0 }; m = 4; loop { if m == 0 { break; } if mask & m != 0 { let b: u32 = get_bits(bs, 6); s = G_DEQ_L12[(ba * 3 - 6 + b % 3) as usize] * ((1u32 << 21).wrapping_shr(b / 3)) as f32; } // *{ // let _old = scf; // // scf = scf.offset(1); // increment_by(scf, 1); // _old // } = s; scf[0] = s; increment_by_mut(&mut scf, 1); m = m >> 1; } i = i + 1; } } pub(crate) fn l12_read_scale_info(hdr: &[u8], bs: &mut Bs, sci: &mut L12ScaleInfo) { static G_BITALLOC_CODE_TAB: [u8; 92] = [ 0, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 17, 18, 3, 19, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 0, 17, 18, 3, 19, 4, 5, 16, 0, 17, 18, 16, 0, 17, 18, 19, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 17, 18, 3, 19, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ]; let mut subband_alloc: &[L12SubbandAlloc] = l12_subband_alloc_table(hdr, &mut *sci); let mut i: i32; let mut k: i32 = 0; let mut ba_bits: u32 = 0; let mut ba_code_tab: &[u8] = &G_BITALLOC_CODE_TAB[..]; i = 0; loop { if !(i < (*sci).total_bands as (i32)) { break; } let mut ba: u8; if i == k { k = k + subband_alloc[0].band_count as (i32); ba_bits = subband_alloc[0].code_tab_width as (u32); ba_code_tab = &G_BITALLOC_CODE_TAB[subband_alloc[0].tab_offset as usize..]; // subband_alloc = subband_alloc.offset(1); increment_by(&mut subband_alloc, 1); } {} let idx = get_bits(bs, ba_bits); ba = ba_code_tab[idx as usize]; (*sci).bitalloc[(2 * i) as usize] = ba; if i < (*sci).stereo_bands as (i32) { ba = ba_code_tab[get_bits(bs, ba_bits) as usize]; } (*sci).bitalloc[(2 * i + 1) as usize] = if (*sci).stereo_bands != 0 { ba as (i32) } else { 0 } as (u8); i = i + 1; } i = 0; loop { if !(i < 2 * (*sci).total_bands as (i32)) { break; } (*sci).scfcod[i as usize] = if (*sci).bitalloc[i as usize] != 0 { (if hdr[1] as (i32) & 6 == 6 { 2 } else { get_bits(bs, 2) }) } else { 6 } as (u8); i = i + 1; } l12_read_scalefactors( &mut *bs, &mut sci.bitalloc, &mut sci.scfcod, sci.total_bands as (i32) * 2, &mut sci.scf, ); i = (*sci).stereo_bands as (i32); loop { if !(i < (*sci).total_bands as (i32)) { break; } (*sci).bitalloc[(2 * i + 1) as usize] = 0; i = i + 1; } } pub(crate) fn l12_dequantize_granule( grbuf: &mut [f32], bs: &mut Bs, sci: &mut L12ScaleInfo, group_size: i32, ) -> i32 { let mut choff: i32 = 576; for j in 0..4 { let mut dst = &mut grbuf[(group_size as usize * j)..]; for i in 0..(2 * sci.total_bands) { let ba: i32 = (*sci).bitalloc[i as usize] as (i32); if ba != 0 { if ba < 17 { let half: i32 = (1 << ba - 1) - 1; for k in 0..group_size { println!("DST: {:?}, {}, {}", dst, k, group_size); // TODO: Crash happening here, // dst is size 0. Investigate. dst[k as usize] = (get_bits(bs, ba as u32) as i32 - half) as f32; } } else { let mod_: u32 = ((2 << ba - 17) + 1) as (u32); let mut code: u32 = get_bits(bs, mod_.wrapping_add(2).wrapping_sub(mod_ >> 3) as (u32)); for k in 0..group_size { dst[k as usize] = code.wrapping_rem(mod_).wrapping_sub(mod_.wrapping_div(2)) as (i32) as f32; code = code.wrapping_div(mod_); } } } increment_by_mut(&mut dst, choff as usize); choff = 18 - choff; } } group_size * 4 } pub(crate) fn l12_apply_scf_384(sci: &mut L12ScaleInfo, mut scf: &[f32], mut dst: &mut [f32]) { // memcpy( // dst.offset(576) // .offset(((*sci).stereo_bands as (i32) * 18) as isize) // as (*mut ::std::os::raw::c_void), // dst.offset(((*sci).stereo_bands as (i32) * 18) as isize) as (*const ::std::os::raw::c_void), // ((((*sci).total_bands as (i32) - (*sci).stereo_bands as (i32)) * 18) as usize) // .wrapping_mul(::std::mem::size_of::<f32>()), // ); { let dst_offset = 576 + sci.stereo_bands as usize * 18; let src_offset = sci.stereo_bands as usize * 18; let len = sci.total_bands as usize - sci.stereo_bands as usize * 18; let (src, dst) = dst.split_at_mut(dst_offset); dst[..len].copy_from_slice(&src[src_offset..(src_offset + len)]); } // dst[dst_offset..(dst_offset + len)].copy_from_slice(&dst[src_offset..(src_offset+len)]); // for (i = 0; i < sci->total_bands; i++, dst += 18, scf += 6) // { // for (k = 0; k < 12; k++) // { // dst[k + 0] *= scf[0]; // dst[k + 576] *= scf[3]; // } // } for _ in 0..sci.total_bands { for k in 0..12 { dst[k + 0] *= scf[0]; dst[k + 576] *= scf[3]; } increment_by_mut(&mut dst, 18); increment_by(&mut scf, 6); } } #[allow(non_snake_case)] pub(crate) fn mp3d_DCT_II(grbuf: &mut [f32], n: i32) { static G_SEC: [f32; 24] = [ 10.19000816, 0.50060302, 0.50241929, 3.40760851, 0.50547093, 0.52249861, 2.05778098, 0.51544732, 0.56694406, 1.48416460, 0.53104258, 0.64682180, 1.16943991, 0.55310392, 0.78815460, 0.97256821, 0.58293498, 1.06067765, 0.83934963, 0.62250412, 1.72244716, 0.74453628, 0.67480832, 5.10114861, ]; let mut i: usize; let mut k: i32 = 0; loop { if !(k < n) { break; } // let mut t: [[f32; 8]; 4] = [[0.0; 8]; 4]; let mut t: [f32; 32] = [0.0; 32]; let y: &mut [f32] = &mut grbuf[k as usize..]; { let mut x: &mut [f32] = &mut t[..]; i = 0; loop { if !(i < 8) { break; } let x0: f32 = y[i * 18]; let x1: f32 = y[(15 - i) * 18]; let x2: f32 = y[(16 + i) * 18]; let x3: f32 = y[(31 - i) * 18]; let t0: f32 = x0 + x3; let t1: f32 = x1 + x2; let t2: f32 = (x1 - x2) * G_SEC[(3 * i + 0) as usize]; let t3: f32 = (x0 - x3) * G_SEC[(3 * i + 1) as usize]; x[0] = t0 + t1; x[8] = (t0 - t1) * G_SEC[(3 * i + 2) as usize]; x[16] = t3 + t2; x[24] = (t3 - t2) * G_SEC[(3 * i + 2) as usize]; i = i + 1; // x = x.offset(1); increment_by_mut(&mut x, 1); } } { let mut x: &mut [f32] = &mut t[..]; i = 0; loop { if !(i < 4) { break; } let mut x0: f32 = x[0]; let mut x1: f32 = x[1]; let mut x2: f32 = x[2]; let mut x3: f32 = x[3]; let mut x4: f32 = x[4]; let mut x5: f32 = x[5]; let mut x6: f32 = x[6]; let mut x7: f32 = x[7]; let mut xt: f32; xt = x0 - x7; x0 = x0 + x7; x7 = x1 - x6; x1 = x1 + x6; x6 = x2 - x5; x2 = x2 + x5; x5 = x3 - x4; x3 = x3 + x4; x4 = x0 - x3; x0 = x0 + x3; x3 = x1 - x2; x1 = x1 + x2; x[0] = x0 + x1; x[4] = (x0 - x1) * 0.70710677; x5 = x5 + x6; x6 = (x6 + x7) * 0.70710677; x7 = x7 + xt; x3 = (x3 + x4) * 0.70710677; x5 = x5 - x7 * 0.198912367; x7 = x7 + x5 * 0.382683432; x5 = x5 - x7 * 0.198912367; x0 = xt - x6; xt = xt + x6; x[1] = (xt + x7) * 0.50979561; x[2] = (x4 + x3) * 0.54119611; x[3] = (x0 - x5) * 0.60134488; x[5] = (x0 + x5) * 0.89997619; x[6] = (x4 - x3) * 1.30656302; x[7] = (xt - x7) * 2.56291556; i = i + 1; // x = x.offset(8); increment_by_mut(&mut x, 8); } } i = 0; loop { if !(i < 7) { break; } y[(0 * 18)] = t[i]; y[(1 * 18)] = t[2 * 8 + i] + t[3 * 8 + i] + t[3 * 8 + (i + 1)]; y[(2 * 18)] = t[8 + i] + t[8 + (i + 1)]; y[(3 * 18)] = t[2 * 8 + (i + 1)] + t[3 * 8 + i] + t[3 * 8 + (i + 1)]; i = i + 1; } y[0 * 18] = t[0 * 8 + 7]; y[1 * 18] = t[2 * 8 + 7] + t[3 * 8 + 7]; y[2 * 18] = t[1 * 8 + 7]; y[3 * 18] = t[3 * 8 + 7]; k = k + 1; } } pub(crate) fn mp3d_scale_pcm(sample: f32) -> i16 { if sample as (f64) >= 32766.5f64 { 32767 } else if sample as (f64) <= -32767.5f64 { -32768 } else { let mut s: i16 = (sample + 0.5) as (i16); s = (s as (i32) - (s as (i32) < 0) as (i32)) as (i16); s } } pub(crate) fn mp3d_synth_pair(pcm: &mut [i16], nch: usize, mut z: &[f32]) { let mut a: f32; a = z[14 * 64] - z[0] * 29.0; a = a + z[1 * 64] + z[13 * 64] * 213.0; a = a + z[12 * 64] - z[2 * 64] * 459.0; a = a + z[3 * 64] + z[11 * 64] * 2037.0; a = a + z[10 * 64] - z[4 * 64] * 5153.0; a = a + z[5 * 64] + z[9 * 64] * 6574.0; a = a + z[8 * 64] - z[6 * 64] * 37489.0; a = a + z[7 * 64] * 75038.0; pcm[0] = mp3d_scale_pcm(a); increment_by(&mut z, 2); a = z[14 * 64] * 104.0; a = a + z[12 * 64] * 1567.0; a = a + z[10 * 64] * 9727.0; a = a + z[8 * 64] * 64019.0; a = a + z[6 * 64] * -9975.0; a = a + z[4 * 64] * -45.0; a = a + z[2 * 64] * 146.0; a = a + z[0 * 64] * -5.0; pcm[16 * nch] = mp3d_scale_pcm(a) } pub(crate) fn mp3d_synth(xl: &mut [f32], dstl: &mut [i16], nch: usize, lins: &mut [f32]) { // let xr = &xl[(576 * (nch - 1)) as usize..]; let (xl, xr) = xl.split_at(576 * (nch - 1) as usize); // let dstr = &mut dstl[(nch - 1) as usize..]; let dstr_offset = (nch - 1) as usize; static G_WIN: [f32; 240] = [ -1.0, 26.0, -31.0, 208.0, 218.0, 401.0, -519.0, 2063.0, 2000.0, 4788.0, -5517.0, 7134.0, 5959.0, 35640.0, -39336.0, 74992.0, -1.0, 24.0, -35.0, 202.0, 222.0, 347.0, -581.0, 2080.0, 1952.0, 4425.0, -5879.0, 7640.0, 5288.0, 33791.0, -41176.0, 74856.0, -1.0, 21.0, -38.0, 196.0, 225.0, 294.0, -645.0, 2087.0, 1893.0, 4063.0, -6237.0, 8092.0, 4561.0, 31947.0, -43006.0, 74630.0, -1.0, 19.0, -41.0, 190.0, 227.0, 244.0, -711.0, 2085.0, 1822.0, 3705.0, -6589.0, 8492.0, 3776.0, 30112.0, -44821.0, 74313.0, -1.0, 17.0, -45.0, 183.0, 228.0, 197.0, -779.0, 2075.0, 1739.0, 3351.0, -6935.0, 8840.0, 2935.0, 28289.0, -46617.0, 73908.0, -1.0, 16.0, -49.0, 176.0, 228.0, 153.0, -848.0, 2057.0, 1644.0, 3004.0, -7271.0, 9139.0, 2037.0, 26482.0, -48390.0, 73415.0, -2.0, 14.0, -53.0, 169.0, 227.0, 111.0, -919.0, 2032.0, 1535.0, 2663.0, -7597.0, 9389.0, 1082.0, 24694.0, -50137.0, 72835.0, -2.0, 13.0, -58.0, 161.0, 224.0, 72.0, -991.0, 2001.0, 1414.0, 2330.0, -7910.0, 9592.0, 70.0, 22929.0, -51853.0, 72169.0, -2.0, 11.0, -63.0, 154.0, 221.0, 36.0, -1064.0, 1962.0, 1280.0, 2006.0, -8209.0, 9750.0, -998.0, 21189.0, -53534.0, 71420.0, -2.0, 10.0, -68.0, 147.0, 215.0, 2.0, -1137.0, 1919.0, 1131.0, 1692.0, -8491.0, 9863.0, -2122.0, 19478.0, -55178.0, 70590.0, -3.0, 9.0, -73.0, 139.0, 208.0, -29.0, -1210.0, 1870.0, 970.0, 1388.0, -8755.0, 9935.0, -3300.0, 17799.0, -56778.0, 69679.0, -3.0, 8.0, -79.0, 132.0, 200.0, -57.0, -1283.0, 1817.0, 794.0, 1095.0, -8998.0, 9966.0, -4533.0, 16155.0, -58333.0, 68692.0, -4.0, 7.0, -85.0, 125.0, 189.0, -83.0, -1356.0, 1759.0, 605.0, 814.0, -9219.0, 9959.0, -5818.0, 14548.0, -59838.0, 67629.0, -4.0, 7.0, -91.0, 117.0, 177.0, -106.0, -1428.0, 1698.0, 402.0, 545.0, -9416.0, 9916.0, -7154.0, 12980.0, -61289.0, 66494.0, -5.0, 6.0, -97.0, 111.0, 163.0, -127.0, -1498.0, 1634.0, 185.0, 288.0, -9585.0, 9838.0, -8540.0, 11455.0, -62684.0, 65290.0, ]; { let zlin = &mut lins[(15 * 64)..]; zlin[4 * 15] = xl[(18 * 16)]; zlin[4 * 15 + 1] = xr[(18 * 16)]; zlin[4 * 15 + 2] = xl[0]; zlin[4 * 15 + 3] = xr[0]; zlin[4 * 31] = xl[(1 + 18 * 16)]; zlin[4 * 31 + 1] = xr[(1 + 18 * 16)]; zlin[4 * 31 + 2] = xl[1]; zlin[4 * 31 + 3] = xr[1]; } mp3d_synth_pair( &mut dstl[dstr_offset..], nch as usize, &mut lins[((4 * 15) + 1)..], ); mp3d_synth_pair( &mut dstl[dstr_offset + 32 * nch..], nch as usize, &lins[4 * 15 + 64 + 1..], ); mp3d_synth_pair(dstl, nch, &lins[4 * 15..]); mp3d_synth_pair(&mut dstl[32 * nch..], nch, &lins[4 * 15 + 64..]); let mut w: &[f32] = &G_WIN[..]; let zlin = &mut lins[(15 * 64)..]; for i in (0..14).rev() { let mut a: [f32; 4] = [0.0; 4]; let mut b: [f32; 4] = [0.0; 4]; zlin[4 * i] = xl[18 * (31 - i)]; zlin[4 * i + 1] = xr[18 * (31 - i)]; zlin[4 * i + 2] = xl[1 + 18 * (31 - i)]; zlin[4 * i + 3] = xr[1 + 18 * (31 - i)]; zlin[4 * (i + 16)] = xl[1 + 18 * (1 + i)]; zlin[4 * (i + 16) + 1] = xr[1 + 18 * (1 + i)]; zlin[4 * (i - 16) + 2] = xl[18 * (1 + i)]; zlin[4 * (i - 16) + 3] = xr[18 * (1 + i)]; // All this nonsense with `w` is from SIMD-replacing macros; // I think the code we're actually getting is here: // https://github.com/lieff/minimp3/blob/master/minimp3.h#L1534 // Seems simplest to just rewrite it entirely. // I rewrote it using macros 'cause using closures caused lifetime // kerfuffles. // TODO: Doublecheck all this. { macro_rules! load { ($k:expr) => {{ let w0: f32 = w[0]; increment_by(&mut w, 1); let w1: f32 = w[1]; increment_by(&mut w, 1); let vz = &zlin[4 * i - $k * 64..]; let vy = &zlin[4 * i - (15 - $k) * 64..]; (w0, w1, vz, vy) }}; } macro_rules! S0 { ($k:expr) => {{ let (w0, w1, vz, vy) = load!($k); for j in 0..4 { b[j] = vz[j] * w1 + vy[j] * w0; a[j] = vz[j] * w0 - vy[j] * w1; } }}; } macro_rules! S1 { ($k:expr) => {{ let (w0, w1, vz, vy) = load!($k); for j in 0..4 { b[j] += vz[j] * w1 + vy[j] * w0; a[j] += vz[j] * w0 - vy[j] * w1; } }}; } macro_rules! S2 { ($k:expr) => {{ let (w0, w1, vz, vy) = load!($k); for j in 0..4 { b[j] += vz[j] * w1 + vy[j] * w0; a[j] += vz[j] * w1 - vy[j] * w0; } }}; } S0!(0); S2!(1); S1!(2); S2!(3); S1!(4); S2!(5); S1!(6); S2!(7); } dstl[dstr_offset + (15 - i) * nch] = mp3d_scale_pcm(a[1]); dstl[dstr_offset + (17 + i) * nch] = mp3d_scale_pcm(b[1]); dstl[(15 - i) * nch] = mp3d_scale_pcm(a[0]); dstl[(17 + i) * nch] = mp3d_scale_pcm(b[0]); dstl[dstr_offset + (47 - i) * nch] = mp3d_scale_pcm(a[3]); dstl[dstr_offset + (49 + i) * nch] = mp3d_scale_pcm(b[3]); dstl[(47 - i) * nch] = mp3d_scale_pcm(a[2]); dstl[(49 + i) * nch] = mp3d_scale_pcm(b[2]); } } pub(crate) fn mp3d_synth_granule( qmf_state: &mut [f32], grbuf: &mut [f32], nbands: i32, nch: i32, pcm: &mut [i16], lins: &mut [f32], ) { for i in 0..(nch as usize) { // let grbuf_slice = ::std::slice::from_raw_parts_mut(grbuf, 576); // mp3d_DCT_II(grbuf.offset((576 * i) as isize), nbands); mp3d_DCT_II(&mut grbuf[..576 * i], nbands); } // memcpy( // lins as (*mut ::std::os::raw::c_void), // qmf_state as (*const ::std::os::raw::c_void), // ::std::mem::size_of::<f32>() // .wrapping_mul(15) // .wrapping_mul(64), // ); let len = 15 * 64; lins[..len].copy_from_slice(&qmf_state[..len]); let mut i: i32 = 0; while i < nbands { let offset = (32 * nch * i) as usize; mp3d_synth( &mut grbuf[i as usize..], &mut pcm[offset..], nch as usize, &mut lins[(i * 64) as usize..], ); i = i + 2; } if nch == 1 { i = 0; while i < 15 * 64 { qmf_state[i as usize] = lins[(nbands * 64 + i) as usize]; i = i + 2; } } else { let len: i32 = 15 * 64; // memcpy( // qmf_state as (*mut ::std::os::raw::c_void), // lins.offset((nbands * 64) as isize) as (*const ::std::os::raw::c_void), // ::std::mem::size_of::<f32>() // .wrapping_mul(15) // .wrapping_mul(64), // ); qmf_state[..len as usize] .copy_from_slice(&lins[(nbands * 64) as usize..(nbands * 64 + len) as usize]); } } pub(crate) fn l3_read_side_info(bs: &mut Bs, mut gr: &mut [L3GrInfo], hdr: &[u8]) -> i32 { let current_block; static G_SCF_LONG: [[u8; 23]; 8] = [ [ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, 0, ], [ 12, 12, 12, 12, 12, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 76, 90, 2, 2, 2, 2, 2, 0, ], [ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, 0, ], [ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, 18, 22, 26, 32, 38, 46, 54, 62, 70, 76, 36, 0, ], [ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, 0, ], [ 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10, 12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, 0, ], [ 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 10, 12, 16, 18, 22, 28, 34, 40, 46, 54, 54, 192, 0, ], [ 4, 4, 4, 4, 4, 4, 6, 6, 8, 10, 12, 16, 20, 24, 30, 38, 46, 56, 68, 84, 102, 26, 0, ], ]; static G_SCF_SHORT: [[u8; 40]; 8] = [ [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 24, 24, 24, 30, 30, 30, 40, 40, 40, 18, 18, 18, 0, ], [ 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 16, 16, 16, 20, 20, 20, 24, 24, 24, 28, 28, 28, 36, 36, 36, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 26, 26, 0, ], [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 8, 8, 8, 10, 10, 10, 14, 14, 14, 18, 18, 18, 26, 26, 26, 32, 32, 32, 42, 42, 42, 18, 18, 18, 0, ], [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 24, 24, 24, 32, 32, 32, 44, 44, 44, 12, 12, 12, 0, ], [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 24, 24, 24, 30, 30, 30, 40, 40, 40, 18, 18, 18, 0, ], [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 22, 22, 22, 30, 30, 30, 56, 56, 56, 0, ], [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 10, 10, 10, 12, 12, 12, 14, 14, 14, 16, 16, 16, 20, 20, 20, 26, 26, 26, 66, 66, 66, 0, ], [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 8, 8, 12, 12, 12, 16, 16, 16, 20, 20, 20, 26, 26, 26, 34, 34, 34, 42, 42, 42, 12, 12, 12, 0, ], ]; // TODO: These... lengths are wrong??? I jus padded them out with 0's static G_SCF_MIXED: [[u8; 40]; 8] = [ [ 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 24, 24, 24, 30, 30, 30, 40, 40, 40, 18, 18, 18, 0, 0, 0, 0, ], [ 12, 12, 12, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16, 20, 20, 20, 24, 24, 24, 28, 28, 28, 36, 36, 36, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 26, 26, 0, ], [ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 10, 10, 10, 14, 14, 14, 18, 18, 18, 26, 26, 26, 32, 32, 32, 42, 42, 42, 18, 18, 18, 0, 0, 0, 0, ], [ 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 24, 24, 24, 32, 32, 32, 44, 44, 44, 12, 12, 12, 0, 0, 0, 0, ], [ 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 24, 24, 24, 30, 30, 30, 40, 40, 40, 18, 18, 18, 0, 0, 0, 0, ], [ 4, 4, 4, 4, 4, 4, 6, 6, 4, 4, 4, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18, 18, 22, 22, 22, 30, 30, 30, 56, 56, 56, 0, 0, ], [ 4, 4, 4, 4, 4, 4, 6, 6, 4, 4, 4, 6, 6, 6, 6, 6, 6, 10, 10, 10, 12, 12, 12, 14, 14, 14, 16, 16, 16, 20, 20, 20, 26, 26, 26, 66, 66, 66, 0, 0, ], [ 4, 4, 4, 4, 4, 4, 6, 6, 4, 4, 4, 6, 6, 6, 8, 8, 8, 12, 12, 12, 16, 16, 16, 20, 20, 20, 26, 26, 26, 34, 34, 34, 42, 42, 42, 12, 12, 12, 0, 0, ], ]; let mut tables: u32; let mut scfsi: u32 = 0; let main_data_begin: i32; let mut part_23_sum: i32 = 0; let mut sr_idx: i32 = (hdr[2] as (i32) >> 2 & 3) + ((hdr[1] as (i32) >> 3 & 1) + (hdr[1] as (i32) >> 4 & 1)) * 3; sr_idx = sr_idx - (sr_idx != 0) as (i32); let mut gr_count: u32 = if hdr[3] as (i32) & 0xc0 == 0xc0 { 1 } else { 2 }; if hdr[1] as (i32) & 0x8 != 0 { gr_count = gr_count * 2; main_data_begin = get_bits(bs, 9) as (i32); scfsi = get_bits(bs, 7 + gr_count); } else { main_data_begin = (get_bits(bs, 8 + gr_count) >> gr_count) as (i32); } loop { if hdr[3] as (i32) & 0xc0 == 0xc0 { scfsi = scfsi << 4; } gr[0].part_23_length = get_bits(bs, 12) as (u16); part_23_sum = part_23_sum + gr[0].part_23_length as (i32); gr[0].big_values = get_bits(bs, 9) as (u16); if gr[0].big_values as (i32) > 288 { current_block = 20; break; } gr[0].global_gain = get_bits(bs, 8) as (u8); gr[0].scalefac_compress = get_bits(bs, if hdr[1] as (i32) & 0x8 != 0 { 4 } else { 9 }) as (u16); gr[0].sfbtab = &G_SCF_LONG[sr_idx as usize]; gr[0].n_long_sfb = 22; gr[0].n_short_sfb = 0; if get_bits(bs, 1) != 0 { gr[0].block_type = get_bits(bs, 2) as (u8); if gr[0].block_type == 0 { current_block = 19; break; } gr[0].mixed_block_flag = get_bits(bs, 1) as (u8); gr[0].region_count[0] = 7; gr[0].region_count[1] = 255; if gr[0].block_type as (i32) == 2 { scfsi = scfsi & 0xf0fu32; if gr[0].mixed_block_flag == 0 { gr[0].region_count[0] = 8; gr[0].sfbtab = &G_SCF_SHORT[sr_idx as usize]; gr[0].n_long_sfb = 0; gr[0].n_short_sfb = 39; } else { gr[0].sfbtab = &G_SCF_MIXED[sr_idx as usize]; gr[0].n_long_sfb = if hdr[1] as (i32) & 0x8 != 0 { 8 } else { 6 } as (u8); gr[0].n_short_sfb = 30; } } tables = get_bits(bs, 10); tables = tables << 5; gr[0].subblock_gain[0] = get_bits(bs, 3) as (u8); gr[0].subblock_gain[1] = get_bits(bs, 3) as (u8); gr[0].subblock_gain[2] = get_bits(bs, 3) as (u8); } else { gr[0].block_type = 0; gr[0].mixed_block_flag = 0; tables = get_bits(bs, 15); gr[0].region_count[0] = get_bits(bs, 4) as (u8); gr[0].region_count[1] = get_bits(bs, 3) as (u8); gr[0].region_count[2] = 255; } gr[0].table_select[0] = (tables >> 10) as (u8); gr[0].table_select[1] = (tables >> 5 & 31) as (u8); gr[0].table_select[2] = (tables & 31) as (u8); gr[0].preflag = if hdr[1] as (i32) & 0x8 != 0 { get_bits(bs, 1) } else { (gr[0].scalefac_compress as (i32) >= 500) as (u32) } as (u8); gr[0].scalefac_scale = get_bits(bs, 1) as (u8); gr[0].count1_table = get_bits(bs, 1) as (u8); gr[0].scfsi = (scfsi >> 12 & 15) as (u8); scfsi = scfsi << 4; // gr = gr.offset(1); increment_by_mut(&mut gr, 1); if { gr_count = gr_count - 1; gr_count } == 0 { current_block = 16; break; } } if current_block == 16 { (if part_23_sum + (*bs).pos > (*bs).limit + main_data_begin * 8 { -1 } else { main_data_begin }) } else if current_block == 19 { -1 } else { -1 } } /// BUGGO: The lifetimes here between /// Bs and Mp3DecScratch are not entirely /// obvious; double-check. pub(crate) fn l3_restore_reservoir<'a>( h: &mut Mp3Dec, bs: &'a mut Bs, s: &'a mut Mp3DecScratch<'a>, main_data_begin: i32, ) -> bool { let frame_bytes = (((*bs).limit - (*bs).pos) / 8) as usize; let bytes_have = if (*h).reserv > main_data_begin { main_data_begin as usize } else { h.reserv as usize }; // memcpy( // (*s).maindata.as_mut_ptr() as (*mut ::std::os::raw::c_void), // (*h).reserv_buf // .as_mut_ptr() // .offset(if 0 < (*h).reserv - main_data_begin { // (*h).reserv - main_data_begin // } else { // 0 // } as isize) as (*const ::std::os::raw::c_void), // if (*h).reserv > main_data_begin { // main_data_begin // } else { // (*h).reserv // } as usize, // ); let end = i32::max(0, h.reserv - main_data_begin) as usize; let len = i32::min(h.reserv, main_data_begin) as usize; s.maindata[..len].copy_from_slice(&h.reserv_buf[end..(end + len)]); // memcpy( // (*s).maindata.as_mut_ptr().offset(bytes_have as isize) as (*mut ::std::os::raw::c_void), // (*bs).buf.as_ptr().offset(((*bs).pos / 8) as isize) as (*const ::std::os::raw::c_void), // frame_bytes as usize, // ); s.maindata[bytes_have..(bytes_have + frame_bytes)] .copy_from_slice(&bs.buf[(bs.pos / 8) as usize..(bs.pos as usize / 8 + frame_bytes)]); s.bs = Bs::new(&(*s).maindata[..], (bytes_have + frame_bytes) as i32); (*h).reserv >= main_data_begin } pub(crate) fn l3_read_scalefactors( mut scf: &mut [u8], mut ist_pos: &mut [u8], scf_size: &[u8], scf_count: &[u8], bitbuf: &mut Bs, mut scfsi: i32, ) { let mut i: usize; let mut k: usize; i = 0; loop { if !(i < 4 && (scf_count[i] != 0)) { break; } let cnt: usize = scf_count[i] as usize; if scfsi & 8 != 0 { // memcpy( // scf as (*mut ::std::os::raw::c_void), // ist_pos as (*const ::std::os::raw::c_void), // cnt as usize, // ); scf.copy_from_slice(&ist_pos[..cnt]); } else { let bits: u32 = scf_size[i] as (u32); if bits == 0 { // memset(scf as (*mut ::std::os::raw::c_void), 0, cnt as usize); // memset( // ist_pos as (*mut ::std::os::raw::c_void), // 0, // cnt as usize, // ); // ::std::ptr::write_bytes(scf, 0, cnt as usize); // ::std::ptr::write_bytes(ist_pos, 0, cnt as usize); // TODO: Crude, but eh. for i in 0..cnt { scf[i] = 0; ist_pos[i] = 0; } } else { let max_scf: i32 = if scfsi < 0 { (1 << bits) - 1 } else { -1 }; k = 0; loop { if !(k < cnt) { break; } let s: i32 = get_bits(bitbuf, bits) as (i32); ist_pos[k] = if s == max_scf { -1 } else { s } as (u8); scf[k] = s as (u8); k = k + 1; } } } // ist_pos = ist_pos.offset(cnt as isize); // scf = scf.offset(cnt as isize); increment_by_mut(&mut ist_pos, cnt); increment_by_mut(&mut scf, cnt); i = i + 1; scfsi = scfsi * 2; } // TODO: Clean up this horrible post-increment-y mess. scf[0] = { let _rhs = { let _rhs = 0; let _lhs = &mut scf[2]; *_lhs = _rhs as (u8); *_lhs }; let _lhs = &mut scf[1]; *_lhs = _rhs; *_lhs }; } pub(crate) fn l3_ldexp_q2(mut y: f32, mut exp_q2: i32) -> f32 { static G_EXPFRAC: [f32; 4] = [ 9.31322575e-10, 7.83145814e-10, 6.58544508e-10, 5.53767716e-10, ]; let mut e: i32; loop { e = if 30 * 4 > exp_q2 { exp_q2 } else { 30 * 4 }; y = y * (G_EXPFRAC[(e & 3) as usize] * (1 << 30 >> (e >> 2)) as f32); if !({ exp_q2 = exp_q2 - e; exp_q2 } > 0) { break; } } y } pub(crate) fn l3_decode_scalefactors( hdr: &[u8], ist_pos: &mut [u8], bs: &mut Bs, gr: &L3GrInfo, scf: &mut [f32], ch: i32, ) { static G_SCF_PARTITIONS: [[u8; 28]; 3] = [ [ 6, 5, 5, 5, 6, 5, 5, 5, 6, 5, 7, 3, 11, 10, 0, 0, 7, 7, 7, 0, 6, 6, 6, 3, 8, 8, 5, 0, ], [ 8, 9, 6, 12, 6, 9, 9, 9, 6, 9, 12, 6, 15, 18, 0, 0, 6, 15, 12, 0, 6, 12, 9, 6, 6, 18, 9, 0, ], [ 9, 9, 6, 12, 9, 9, 9, 9, 9, 9, 12, 6, 18, 18, 0, 0, 12, 12, 12, 0, 12, 9, 9, 6, 15, 12, 9, 0, ], ]; let scf_partition = G_SCF_PARTITIONS [(!((*gr).n_short_sfb == 0) as (i32) + ((*gr).n_long_sfb == 0) as (i32)) as usize]; let mut scf_size: [u8; 4] = [0; 4]; let mut iscf: [u8; 40] = [0; 40]; let mut i: i32; let scf_shift: i32 = (*gr).scalefac_scale as (i32) + 1; let gain_exp: i32; let mut scfsi: i32 = (*gr).scfsi as (i32); let gain: f32; if hdr[1] as (i32) & 0x8 != 0 { static G_SCFC_DECODE: [u8; 16] = [0, 1, 2, 3, 12, 5, 6, 7, 9, 10, 11, 13, 14, 15, 18, 19]; let part: i32 = G_SCFC_DECODE[(*gr).scalefac_compress as usize] as (i32); scf_size[1] = { let _rhs = (part >> 2) as (u8); let _lhs = &mut scf_size[0]; *_lhs = _rhs; *_lhs }; scf_size[3] = { let _rhs = (part & 3) as (u8); let _lhs = &mut scf_size[2]; *_lhs = _rhs; *_lhs }; } else { static G_MOD: [u8; 24] = [ 5, 5, 4, 4, 5, 5, 4, 1, 4, 3, 1, 1, 5, 6, 6, 1, 4, 4, 4, 1, 4, 3, 1, 1, ]; let mut k: i32; let mut modprod: i32; let mut sfc: i32; let ist: i32 = (hdr[3] as (i32) & 0x10 != 0 && (ch != 0)) as (i32); sfc = (*gr).scalefac_compress as (i32) >> ist; k = ist * 3 * 4; loop { if !(sfc >= 0) { break; } modprod = 1; i = 3; loop { if !(i >= 0) { break; } scf_size[i as usize] = (sfc / modprod % G_MOD[(k + i) as usize] as (i32)) as (u8); modprod = modprod * G_MOD[(k + i) as usize] as (i32); i = i - 1; } sfc = sfc - modprod; k = k + 4; } // scf_partition = scf_partition.offset(k as isize); increment_by(&mut &scf_partition[..], k as usize); scfsi = -16; } l3_read_scalefactors( &mut iscf[..], ist_pos, &scf_size[..], &scf_partition, &mut *bs, scfsi, ); if (*gr).n_short_sfb != 0 { let sh: i32 = 3 - scf_shift; i = 0; loop { if !(i < (*gr).n_short_sfb as (i32)) { break; } { let _rhs = (*gr).subblock_gain[0] as (i32) << sh; let _lhs = &mut iscf[((*gr).n_long_sfb as (i32) + i + 0) as usize]; *_lhs = (*_lhs as (i32) + _rhs) as (u8); } { let _rhs = (*gr).subblock_gain[1] as (i32) << sh; let _lhs = &mut iscf[((*gr).n_long_sfb as (i32) + i + 1) as usize]; *_lhs = (*_lhs as (i32) + _rhs) as (u8); } { let _rhs = (*gr).subblock_gain[2] as (i32) << sh; let _lhs = &mut iscf[((*gr).n_long_sfb as (i32) + i + 2) as usize]; *_lhs = (*_lhs as (i32) + _rhs) as (u8); } i = i + 3; } } else if (*gr).preflag != 0 { static G_PREAMP: [u8; 10] = [1, 1, 1, 1, 2, 2, 3, 3, 3, 2]; i = 0; loop { if !(i < 10) { break; } let _rhs = G_PREAMP[i as usize]; let _lhs = &mut iscf[(11 + i) as usize]; *_lhs = (*_lhs as (i32) + _rhs as (i32)) as (u8); i = i + 1; } } gain_exp = (*gr).global_gain as (i32) + -1 * 4 - 210 - if hdr[3] as (i32) & 0xe0 == 0x60 { 2 } else { 0 }; gain = l3_ldexp_q2( (1 << (255 + -1 * 4 - 210 + 3 & !3) / 4) as f32, (255 + -1 * 4 - 210 + 3 & !3) - gain_exp, ); i = 0; loop { if !(i < (*gr).n_long_sfb as (i32) + (*gr).n_short_sfb as (i32)) { break; } scf[i as usize] = l3_ldexp_q2(gain, iscf[i as usize] as (i32) << scf_shift); i = i + 1; } } pub(crate) fn l3_pow_43(mut x: i32) -> f32 { let frac: f32; let sign: i32; let mut mult: i32 = 256; if x < 129 { GPOW43[(16 + x) as usize] } else { if x < 1024 { mult = 16; x = x << 3; } sign = 2 * x & 64; frac = ((x & 63) - sign) as f32 / ((x & !63) + sign) as f32; GPOW43[(16 + (x + sign >> 6)) as usize] * (1.0 + frac * (4.0 / 3.0 + frac * (2.0 / 9.0))) * mult as f32 } } pub(crate) unsafe fn l3_huffman( mut dst: &mut [f32], bs: &mut Bs, gr_info: &L3GrInfo, mut scf: &[f32], layer3gr_limit: i32, ) { static TABS: [i16; 512] = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 785, 785, 785, 785, 784, 784, 784, 784, 513, 513, 513, 513, 513, 513, 513, 513, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, -255, 1313, 1298, 1282, 785, 785, 785, 785, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 290, 288, -255, 1313, 1298, 1282, 769, 769, 769, 769, 529, 529, 529, 529, 529, 529, 529, 529, 528, 528, 528, 528, 528, 528, 528, 528, 512, 512, 512, 512, 512, 512, 512, 512, 290, 288, -253, -318, -351, -367, 785, 785, 785, 785, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 819, 818, 547, 547, 275, 275, 275, 275, 561, 560, 515, 546, 289, 274, 288, 258, -254, -287, 1329, 1299, 1314, 1312, 1057, 1057, 1042, 1042, 1026, 1026, 784, 784, 784, 784, 529, 529, 529, 529, 529, 529, 529, 529, 769, 769, 769, 769, 768, 768, 768, 768, 563, 560, 306, 306, 291, 259, -252, -413, -477, -542, 1298, -575, 1041, 1041, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, -383, -399, 1107, 1092, 1106, 1061, 849, 849, 789, 789, 1104, 1091, 773, 773, 1076, 1075, 341, 340, 325, 309, 834, 804, 577, 577, 532, 532, 516, 516, 832, 818, 803, 816, 561, 561, 531, 531, 515, 546, 289, 289, 288, 258, -252, -429, -493, -559, 1057, 1057, 1042, 1042, 529, 529, 529, 529, 529, 529, 529, 529, 784, 784, 784, 784, 769, 769, 769, 769, 512, 512, 512, 512, 512, 512, 512, 512, -382, 1077, -415, 1106, 1061, 1104, 849, 849, 789, 789, 1091, 1076, 1029, 1075, 834, 834, 597, 581, 340, 340, 339, 324, 804, 833, 532, 532, 832, 772, 818, 803, 817, 787, 816, 771, 290, 290, 290, 290, 288, 258, -253, -349, -414, -447, -463, 1329, 1299, -479, 1314, 1312, 1057, 1057, 1042, 1042, 1026, 1026, 785, 785, 785, 785, 784, 784, 784, 784, 769, 769, 769, 769, 768, 768, 768, 768, -319, 851, 821, -335, 836, 850, 805, 849, 341, 340, 325, 336, 533, 533, 579, 579, 564, 564, 773, 832, 578, 548, 563, 516, 321, 276, 306, 291, 304, 259, -251, -572, -733, -830, -863, -879, 1041, 1041, 784, 784, 784, 784, 769, 769, 769, 769, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, -511, -527, -543, 1396, 1351, 1381, 1366, 1395, 1335, 1380, -559, 1334, 1138, 1138, 1063, 1063, 1350, 1392, 1031, 1031, 1062, 1062, 1364, 1363, 1120, 1120, 1333, 1348, 881, 881, 881, 881, 375, 374, 359, 373, 343, 358, 341, 325, 791, 791, 1123, 1122, -703, 1105, 1045, -719, 865, 865, 790, 790, 774, 774, ]; static TAB32: [u8; 28] = [ 130, 162, 193, 209, 44, 28, 76, 140, 9, 9, 9, 9, 9, 9, 9, 9, 190, 254, 222, 238, 126, 94, 157, 157, 109, 61, 173, 205, ]; static TAB33: [u8; 16] = [ 252, 236, 220, 204, 188, 172, 156, 140, 124, 108, 92, 76, 60, 44, 28, 12, ]; static TABINDEX: [i16; 32] = [ 0, 32, 64, 98, 0, 132, 180, 218, 292, 364, 426, 538, 648, 746, 0, 1126, 1460, 1460, 1460, 1460, 1460, 1460, 1460, 1460, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842, ]; static G_LINBITS: [u8; 32] = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 8, 10, 13, 4, 5, 6, 7, 8, 9, 11, 13, ]; let mut one: f32 = 0.0; let mut ireg: i32 = 0; let mut big_val_cnt: i32 = (*gr_info).big_values as (i32); let mut sfb: &[u8] = (*gr_info).sfbtab; let mut bs_next_ptr: *const u8 = (*bs).buf.as_ptr().offset(((*bs).pos / 8) as isize); let mut bs_cache: u32 = (*bs_next_ptr.offset(0) as (u32)) .wrapping_mul(256) .wrapping_add(*bs_next_ptr.offset(1) as (u32)) .wrapping_mul(256) .wrapping_add(*bs_next_ptr.offset(2) as (u32)) .wrapping_mul(256) .wrapping_add(*bs_next_ptr.offset(3) as (u32)) << ((*bs).pos & 7); let mut pairs_to_decode: i32; let mut np: i32; let mut bs_sh: i32 = ((*bs).pos & 7) - 8; bs_next_ptr = bs_next_ptr.offset(4); loop { if !(big_val_cnt > 0) { break; } let tab_num: i32 = (*gr_info).table_select[ireg as usize] as (i32); let mut sfb_cnt: i32 = (*gr_info).region_count[{ let _old = ireg; ireg = ireg + 1; _old } as usize] as (i32); let codebook: *const i16 = TABS.as_ptr().offset(TABINDEX[tab_num as usize] as isize); let linbits: i32 = G_LINBITS[tab_num as usize] as (i32); loop { np = { let _old = sfb; // sfb = sfb.offset(1); increment_by(&mut sfb, 1); _old[0] } as (i32) / 2; pairs_to_decode = if big_val_cnt > np { np } else { big_val_cnt }; // one = *{ // let _old = scf; // scf = scf.offset(1); // _old // }; one = scf[0]; increment_by(&mut scf, 1); loop { let mut j: i32; let mut w: i32 = 5; let mut leaf: i32 = *codebook.offset((bs_cache >> 32 - w) as isize) as (i32); loop { if !(leaf < 0) { break; } bs_cache = bs_cache << w; bs_sh = bs_sh + w; w = leaf & 7; // TODO: Check that this shouldn't be `wrapping_shr(32) - w, though that doesn't seem sensible. leaf = *codebook.offset( (bs_cache.wrapping_shr((32 - w) as u32)).wrapping_sub((leaf >> 3) as (u32)) as isize, ) as (i32); } // bs_cache = bs_cache << (leaf >> 8); bs_cache = bs_cache.wrapping_shl((leaf >> 8) as u32); bs_sh = bs_sh + (leaf >> 8); j = 0; loop { if !(j < 2) { break; } let mut lsb: i32 = leaf & 0xfi32; if lsb == 15 && (linbits != 0) { lsb = (lsb as (u32)).wrapping_add(bs_cache >> 32 - linbits) as (i32); bs_cache = bs_cache << linbits; bs_sh = bs_sh + linbits; loop { if !(bs_sh >= 0) { break; } bs_cache = bs_cache | *{ let _old = bs_next_ptr; bs_next_ptr = bs_next_ptr.offset(1); _old } as (u32) << bs_sh; bs_sh = bs_sh - 8; } dst[0] = one * l3_pow_43(lsb) * if bs_cache as (i32) < 0 { -1 } else { 1 } as f32; } else { dst[0] = GPOW43[((16 + lsb) as (u32)) .wrapping_sub(16u32.wrapping_mul(bs_cache >> 31)) as usize] * one; } bs_cache = bs_cache << if lsb != 0 { 1 } else { 0 }; bs_sh = bs_sh + if lsb != 0 { 1 } else { 0 }; j = j + 1; // dst = dst.offset(1); increment_by_mut(&mut dst, 1); leaf = leaf >> 4; } loop { if !(bs_sh >= 0) { break; } bs_cache = (bs_cache | *{ let _old = bs_next_ptr; bs_next_ptr = bs_next_ptr.offset(1); _old } as (u32)) .wrapping_shl(bs_sh as u32); bs_sh = bs_sh - 8; } if { pairs_to_decode = pairs_to_decode - 1; pairs_to_decode } == 0 { break; } } if !({ big_val_cnt = big_val_cnt - np; big_val_cnt } > 0 && ({ sfb_cnt = sfb_cnt - 1; sfb_cnt } >= 0)) { break; } } } np = 1 - big_val_cnt; loop { let codebook_count1: *const u8 = if (*gr_info).count1_table != 0 { TAB33.as_ptr() } else { TAB32.as_ptr() }; let mut leaf: i32 = *codebook_count1.offset((bs_cache >> 32 - 4) as isize) as (i32); if leaf & 8 == 0 { leaf = *codebook_count1.offset( ((leaf >> 3) as (u32)).wrapping_add(bs_cache << 4 >> 32 - (leaf & 3)) as isize, ) as (i32); } bs_cache = bs_cache << (leaf & 7); bs_sh = bs_sh + (leaf & 7); if (bs_next_ptr as isize).wrapping_sub((*bs).buf.as_ptr() as isize) / ::std::mem::size_of::<u8>() as isize * 8 - 24 + bs_sh as isize > layer3gr_limit as isize { break; } if { np = np - 1; np } == 0 { np = { let _old = sfb[0]; increment_by(&mut sfb, 1); _old } as (i32) / 2; if np == 0 { break; } // one = *{ // let _old = scf; // scf = scf.offset(1); // _old // }; one = scf[0]; increment_by(&mut scf, 1); } if leaf & 128 >> 0 != 0 { dst[0] = if bs_cache as (i32) < 0 { -one } else { one }; bs_cache = bs_cache << 1; bs_sh = bs_sh + 1; } if leaf & 128 >> 1 != 0 { dst[1] = if bs_cache as (i32) < 0 { -one } else { one }; bs_cache = bs_cache << 1; bs_sh = bs_sh + 1; } if { np = np - 1; np } == 0 { np = { let _old = sfb[0]; increment_by(&mut sfb, 1); _old } as (i32) / 2; if np == 0 { break; } // one = *{ // let _old = scf; // scf = scf.offset(1); // _old // }; one = scf[0]; increment_by(&mut scf, 1); } if leaf & 128 >> 2 != 0 { dst[2] = if bs_cache as (i32) < 0 { -one } else { one }; bs_cache = bs_cache << 1; bs_sh = bs_sh + 1; } if leaf & 128 >> 3 != 0 { dst[3] = if bs_cache as (i32) < 0 { -one } else { one }; bs_cache = bs_cache << 1; bs_sh = bs_sh + 1; } loop { if !(bs_sh >= 0) { break; } bs_cache = bs_cache | *{ let _old = bs_next_ptr; bs_next_ptr = bs_next_ptr.offset(1); _old } as (u32) << bs_sh; bs_sh = bs_sh - 8; } // dst = dst.offset(4); increment_by_mut(&mut dst, 4); } (*bs).pos = layer3gr_limit; } pub(crate) fn l3_midside_stereo(left: &mut [f32], n: i32) { let mut i: usize = 0; println!("LEN: {}", left.len()); // let right = &mut left[576..]; let (left, right) = left.split_at_mut(576); loop { if !(i < (n as usize)) { break; } let a: f32 = left[i]; let b: f32 = right[i]; left[i] = a + b; right[i] = a - b; i = i + 1; } } /// This is sometimes passed a `float[2][576]` and is sometimes, /// it seems, passed a float array of length >= 1152. We now /// have two different functions for the different cases of this. /// TODO: Can we get rid of the previous version of this? pub(crate) fn l3_midside_stereo_b(left: &mut [f32], right: &mut [f32], n: i32) { let mut i: usize = 0; loop { if !(i < (n as usize)) { break; } let a: f32 = left[i]; let b: f32 = right[i]; left[i] = a + b; right[i] = a - b; i = i + 1; } } pub(crate) fn l3_stereo_top_band(mut right: &[f32], sfb: &[u8], nbands: i32, max_band: &mut [i32]) { let mut current_block; let mut i: usize; let mut k: usize; // TODO: Clean up horrible increment operations. max_band[0] = { let _rhs = { let _rhs = -1; let _lhs = &mut max_band[2]; *_lhs = _rhs; *_lhs }; let _lhs = &mut max_band[1]; *_lhs = _rhs; *_lhs }; i = 0; loop { if !(i < nbands as usize) { break; } k = 0; loop { if !(k < sfb[i] as usize) { current_block = 8; break; } if right[k] != 0.0 || right[k + 1] != 0.0 { current_block = 7; break; } k = k + 2; } if current_block == 7 { max_band[(i % 3)] = i as i32; } increment_by(&mut right, sfb[i] as usize); i = i + 1; } } pub(crate) fn l3_intensity_stereo_band(left: &mut [f32], n: i32, kl: f32, kr: f32) { let mut i: usize; i = 0; loop { if !(i < (n as usize)) { break; } left[i + 576] = left[i] * kr; left[i] = left[i] * kl; i = i + 1; } } pub(crate) fn l3_stereo_process( mut left: &mut [f32], ist_pos: &[u8], sfb: &[u8], hdr: &[u8], max_band: &mut [i32], mpeg2_sh: i32, ) { static L_PAN: [f32; 14] = [ 0.0, 1.0, 0.21132487, 0.78867513, 0.36602540, 0.63397460, 0.5, 0.5, 0.63397460, 0.36602540, 0.78867513, 0.21132487, 1.0, 0.0, ]; let mut i: usize; let max_pos: u32 = (if hdr[1] as (i32) & 0x8 != 0 { 7 } else { 64 }) as (u32); i = 0; loop { if sfb[i] == 0 { break; } let ipos: u32 = ist_pos[i] as u32; if i as (i32) > max_band[i.wrapping_rem(3)] && (ipos < max_pos) { let mut kl: f32; let mut kr: f32; let s: f32 = if hdr[3] as (i32) & 0x20 != 0 { 1.41421356 } else { 1.0 }; if hdr[1] as (i32) & 0x8 != 0 { kl = L_PAN[2u32.wrapping_mul(ipos) as usize]; kr = L_PAN[2u32.wrapping_mul(ipos).wrapping_add(1u32) as usize]; } else { kl = 1.0; kr = l3_ldexp_q2(1.0, (ipos.wrapping_add(1) >> 1 << mpeg2_sh) as (i32)); if ipos & 1 != 0 { kl = kr; kr = 1.0; } } l3_intensity_stereo_band(left, sfb[i] as (i32), kl * s, kr * s); } else if hdr[3] as (i32) & 0x20 != 0 { l3_midside_stereo(left, sfb[i] as i32); } increment_by_mut(&mut left, sfb[i] as usize); i = i.wrapping_add(1); } } pub(crate) fn l3_intensity_stereo( left: &mut [f32], ist_pos: &mut [u8], gr: &[L3GrInfo], hdr: &[u8], ) { let mut max_band: [i32; 3] = [0; 3]; let n_sfb: i32 = gr[0].n_long_sfb as (i32) + gr[0].n_short_sfb as (i32); let mut i: i32; let max_blocks: i32 = if gr[0].n_short_sfb != 0 { 3 } else { 1 }; l3_stereo_top_band(&left[576..], gr[0].sfbtab, n_sfb, &mut max_band); if gr[0].n_long_sfb != 0 { // TODO: This can be drastically cleaned up, // see https://github.com/lieff/minimp3/blob/master/minimp3.h#L926 max_band[0] = { let _rhs = { let _rhs = if if max_band[0] < max_band[1] { max_band[1] } else { max_band[0] } < max_band[2] { max_band[2] } else if max_band[0] < max_band[1] { max_band[1] } else { max_band[0] }; let _lhs = &mut max_band[2]; *_lhs = _rhs; *_lhs }; let _lhs = &mut max_band[1]; *_lhs = _rhs; *_lhs }; } i = 0; loop { if !(i < max_blocks) { break; } let default_pos: i32 = if hdr[1] as (i32) & 0x8 != 0 { 3 } else { 0 }; let itop: i32 = n_sfb - max_blocks + i; let prev: i32 = itop - max_blocks; ist_pos[itop as usize] = if max_band[i as usize] >= prev { default_pos as u8 } else { ist_pos[prev as usize] }; i = i + 1; } l3_stereo_process( left, ist_pos, gr[0].sfbtab, hdr, &mut max_band, gr[1].scalefac_compress as (i32) & 1, ); } pub(crate) fn l3_reorder(mut grbuf: &mut [f32], scratch: &mut [f32], mut sfb: &[u8]) { // TODO: This is a horrible C-ish mess of pointers that Rust profoundly // dislikes, and so has been rewritten. Needs verification and testing // against the original. let mut src = 0; let mut dst = 0; while sfb[0] != 0 { let len = sfb[0] as usize; println!( "LEN: {}, grbuf: {}, scratch: {}", len, grbuf.len(), scratch.len() ); for _ in 0..len { scratch[dst] = grbuf[src + (0 * len)]; dst += 1; scratch[dst] = grbuf[src + (1 * len)]; dst += 1; scratch[dst] = grbuf[src + (2 * len)]; dst += 1; src += 1; } increment_by(&mut sfb, 3); increment_by_mut(&mut grbuf, 2 * len as usize); } let l = scratch.len(); grbuf[..l].copy_from_slice(scratch); /* let mut i: usize; let mut len: usize; { let mut src = &&grbuf; let mut dst = &*scratch; loop { if !(0 != { len = sfb[0] as usize; len }) { break; } i = 0; loop { if !(i < len) { break; } // TODO: Ugh, postincrement operators. // Double-check all this crap. // https://github.com/lieff/minimp3/blob/master/minimp3.h#L938 // *{ // let _old = dst; // dst = dst.offset(1); // _old // } = *src.offset((0 * len) as isize); dst[0] = src[0 * len]; increment_by_mut(&mut dst, 1); // *{ // let _old = dst; // dst = dst.offset(1); // _old // } = *src.offset((1 * len) as isize); dst[1] = src[1 * len]; increment_by_mut(&mut dst, 1); // *{ // let _old = dst; // dst = dst.offset(1); // _old // } = *src.offset((2 * len) as isize); // src = src.offset(1); dst[2] = src[2 * len]; increment_by_mut(&mut dst, 1); increment_by_mut(&mut src, 1); i = i + 1; } // sfb = sfb.offset(3); increment_by(&mut sfb, 3); // src = src.offset((2 * len) as isize); increment_by_mut(&mut src, 2 * len); } } // All this for // memcpy(grbuf, scratch, (dst - scratch)*sizeof(float)); // But the implicit fucking assumption here is that dst and // scratch are pointers into the same array. // Yikes. // memcpy( // grbuf as (*mut ::std::os::raw::c_void), // scratch as (*const ::std::os::raw::c_void), // (((dst as isize).wrapping_sub(scratch as isize) / ::std::mem::size_of::<f32>() as isize) // as usize) // .wrapping_mul(::std::mem::size_of::<f32>()), // ); // let idx = (((dst as isize).wrapping_sub(scratch as isize) // / ::std::mem::size_of::<f32>() as isize) as usize) // .wrapping_mul(::std::mem::size_of::<f32>()); let len = scratch.len(); grbuf[..len].copy_from_slice(scratch); */ } pub(crate) fn l3_antialias(mut grbuf: &mut [f32], mut nbands: i32) { static G_AA: [[f32; 8]; 2] = [ [ 0.85749293, 0.88174200, 0.94962865, 0.98331459, 0.99551782, 0.99916056, 0.99989920, 0.99999316, ], [ 0.51449576, 0.47173197, 0.31337745, 0.18191320, 0.09457419, 0.04096558, 0.01419856, 0.00369997, ], ]; loop { if !(nbands > 0) { break; } let mut i: usize = 0; loop { if !(i < 8) { break; } let u: f32 = grbuf[18 + i]; let d: f32 = grbuf[17 - i]; grbuf[18 + i] = u * G_AA[0][i] - d * G_AA[1][i]; grbuf[17 - i] = u * G_AA[1][i] + d * G_AA[0][i]; i = i + 1; } nbands = nbands - 1; increment_by_mut(&mut grbuf, 18); } } /// Y is apparently an [f32;9] ? pub(crate) fn l3_dct3_9(y: &mut [f32; 9]) { let mut s0: f32; let mut s1: f32; let mut s2: f32; let mut s3: f32; let mut s4: f32; let mut s5: f32; let mut s6: f32; let mut s7: f32; let mut s8: f32; let mut t0: f32; let mut t2: f32; let mut t4: f32; s0 = y[0]; s2 = y[2]; s4 = y[4]; s6 = y[6]; s8 = y[8]; t0 = s0 + s6 * 0.5; s0 = s0 - s6; t4 = (s4 + s2) * 0.93969262; t2 = (s8 + s2) * 0.76604444; s6 = (s4 - s8) * 0.17364818; s4 = s4 + (s8 - s2); s2 = s0 - s4 * 0.5; y[4] = s4 + s0; s8 = t0 - t2 + s6; s0 = t0 - t4 + t2; s4 = t0 + t4 - s6; s1 = y[1]; s3 = y[3]; s5 = y[5]; s7 = y[7]; s3 = s3 * 0.86602540; t0 = (s5 + s1) * 0.98480775; t4 = (s5 - s7) * 0.34202014; t2 = (s1 + s7) * 0.64278761; s1 = (s1 - s5 - s7) * 0.86602540; s5 = t0 - s3 - t2; s7 = t4 - s3 - t0; s3 = t4 + s3 - t2; y[0] = s4 - s7; y[1] = s2 + s1; y[2] = s0 - s3; y[3] = s8 + s5; y[5] = s8 - s5; y[6] = s0 + s3; y[7] = s2 - s1; y[8] = s4 + s7; } pub(crate) fn l3_imdct36( mut grbuf: &mut [f32], mut overlap: &mut [f32], window: &[f32], nbands: i32, ) { let mut i: usize; let mut j: i32; static G_TWID9: [f32; 18] = [ 0.73727734, 0.79335334, 0.84339145, 0.88701083, 0.92387953, 0.95371695, 0.97629601, 0.99144486, 0.99904822, 0.67559021, 0.60876143, 0.53729961, 0.46174861, 0.38268343, 0.30070580, 0.21643961, 0.13052619, 0.04361938, ]; j = 0; loop { if !(j < nbands) { break; } let mut co: [f32; 9] = [0.0; 9]; let mut si: [f32; 9] = [0.0; 9]; co[0] = -grbuf[0]; si[0] = grbuf[17]; i = 0; loop { if !(i < 4) { break; } si[(8 - 2 * i)] = grbuf[(4 * i + 1)] - grbuf[(4 * i + 2)]; co[(1 + 2 * i)] = grbuf[(4 * i + 1)] + grbuf[(4 * i + 2)]; si[(7 - 2 * i)] = grbuf[(4 * i + 4)] - grbuf[(4 * i + 3)]; co[(2 + 2 * i)] = -(grbuf[(4 * i + 3)] + grbuf[(4 * i + 4)]); i = i + 1; } l3_dct3_9(&mut co); l3_dct3_9(&mut si); si[1] = -si[1]; si[3] = -si[3]; si[5] = -si[5]; si[7] = -si[7]; i = 0; loop { if !(i < 9) { break; } let ovl: f32 = overlap[i]; let sum: f32 = co[i] * G_TWID9[(9 + i)] + si[i] * G_TWID9[(0 + i)]; overlap[i] = co[i] * G_TWID9[(0 + i)] - si[i] * G_TWID9[(9 + i)]; grbuf[i] = ovl * window[(0 + i)] - sum * window[(9 + i)]; grbuf[(17 - i)] = ovl * window[(9 + i)] + sum * window[(0 + i)]; i = i + 1; } j = j + 1; increment_by_mut(&mut grbuf, 18); increment_by_mut(&mut overlap, 9); } } pub(crate) fn l3_idct3(x0: f32, x1: f32, x2: f32, dst: &mut [f32; 3]) { let m1: f32 = x1 * 0.86602540; let a1: f32 = x0 - x2 * 0.5; dst[1] = x0 + x2; dst[0] = a1 + m1; dst[2] = a1 - m1; } pub(crate) fn l3_imdct12(x: &mut [f32], dst: &mut [f32], overlap: &mut [f32]) { static G_TWID3: [f32; 6] = [ 0.79335334, 0.92387953, 0.99144486, 0.60876143, 0.38268343, 0.13052619, ]; let mut co: [f32; 3] = [0.0; 3]; let mut si: [f32; 3] = [0.0; 3]; let mut i: usize; l3_idct3(-x[0], x[6] + x[3], x[12] + x[9], &mut co); l3_idct3(x[15], x[12] - x[9], x[6] - x[3], &mut si); si[1] = -si[1]; i = 0; loop { if !(i < 3) { break; } let ovl: f32 = overlap[i]; let sum: f32 = co[i] * G_TWID3[(3 + i)] + si[i] * G_TWID3[(0 + i)]; overlap[i] = co[i] * G_TWID3[(0 + i)] - si[i] * G_TWID3[(3 + i)]; dst[i] = ovl * G_TWID3[(2 - i)] - sum * G_TWID3[(5 - i)]; dst[5 - i] = ovl * G_TWID3[(5 - i)] + sum * G_TWID3[(2 - i)]; i = i + 1; } } pub(crate) fn l3_imdct_short(mut grbuf: &mut [f32], mut overlap: &mut [f32], mut nbands: i32) { loop { if !(nbands > 0) { break; } let mut tmp: [f32; 18] = [0.0; 18]; // memcpy( // tmp.as_mut_ptr() as (*mut ::std::os::raw::c_void), // grbuf.as_ptr() as (*const ::std::os::raw::c_void), // ::std::mem::size_of::<[f32; 18]>(), // ); tmp.copy_from_slice(&grbuf[..18]); // memcpy( // grbuf.as_mut_ptr() as (*mut ::std::os::raw::c_void), // overlap.as_ptr() as (*const ::std::os::raw::c_void), // 6_usize.wrapping_mul(::std::mem::size_of::<f32>()), // ); grbuf.copy_from_slice(&overlap[..6]); l3_imdct12(&mut tmp[..], &mut grbuf[6..], &mut overlap[6..]); l3_imdct12(&mut tmp[1..], &mut grbuf[12..], &mut overlap[6..]); { let (a, b) = overlap.split_at_mut(6); l3_imdct12(&mut tmp[2..], a, b); } nbands = nbands - 1; increment_by_mut(&mut overlap, 9); increment_by_mut(&mut grbuf, 18); } } pub(crate) fn l3_imdct_gr( mut grbuf: &mut [f32], mut overlap: &mut [f32], block_type: u32, n_long_bands: u32, ) { static G_MDCT_WINDOW: [[f32; 18]; 2] = [ [ 0.99904822, 0.99144486, 0.97629601, 0.95371695, 0.92387953, 0.88701083, 0.84339145, 0.79335334, 0.73727734, 0.04361938, 0.13052619, 0.21643961, 0.30070580, 0.38268343, 0.46174861, 0.53729961, 0.60876143, 0.67559021, ], [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.99144486, 0.92387953, 0.79335334, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.13052619, 0.38268343, 0.60876143, ], ]; if n_long_bands != 0 { l3_imdct36(grbuf, overlap, &G_MDCT_WINDOW[0], n_long_bands as (i32)); increment_by_mut(&mut grbuf, 18u32.wrapping_mul(n_long_bands) as usize); increment_by_mut(&mut overlap, 9u32.wrapping_mul(n_long_bands) as usize); } if block_type == 2u32 { l3_imdct_short(grbuf, overlap, 32u32.wrapping_sub(n_long_bands) as (i32)); } else { l3_imdct36( grbuf, overlap, &G_MDCT_WINDOW[(block_type == 3u32) as usize], 32u32.wrapping_sub(n_long_bands) as (i32), ); } } /// I am rather confused about why this function uses two /// nested loops instead of one. pub(crate) fn l3_change_sign(mut grbuf: &mut [f32]) { // let mut b: i32; // let mut i: usize; // b = 0; // increment_by_mut(&mut grbuf, 18); // loop { // if !(b < 32) { // break; // } // i = 1; // loop { // if !(i < 18) { // break; // } // grbuf[i] = -grbuf[i]; // i = i + 2; // } // b = b + 2; // increment_by_mut(&mut grbuf, 36); // } let mut b = 0; increment_by_mut(&mut grbuf, 18); while b < 32 { let mut i = 0; while i < 18 { grbuf[i] = -grbuf[i]; i += 2; } b = b + 2; if grbuf.len() >= 36 { increment_by_mut(&mut grbuf, 36); } } } pub(crate) fn l3_decode( h: &mut Mp3Dec, s: &mut Mp3DecScratch, mut gr_info: &mut [L3GrInfo], nch: i32, ) { let mut ch: i32; ch = 0; loop { if !(ch < nch) { break; } let layer3gr_limit: i32 = (*s).bs.pos + (gr_info[ch as usize]).part_23_length as (i32); l3_decode_scalefactors( &h.header, &mut s.ist_pos[ch as usize], &mut (*s).bs, &gr_info[ch as usize], &mut s.scf, ch, ); unsafe { l3_huffman( &mut s.grbuf[ch as usize], &mut (*s).bs, &gr_info[ch as usize], &s.scf, layer3gr_limit, ); } ch = ch + 1; } if (*h).header[3] as (i32) & 0x10 != 0 { l3_intensity_stereo(&mut s.grbuf[0], &mut s.ist_pos[1], gr_info, &h.header); } else if (*h).header[3] as (i32) & 0xe0 == 0x60 { let (left, right) = s.grbuf.split_at_mut(1); l3_midside_stereo_b(&mut left[0], &mut right[0], 576); } ch = 0; loop { if !(ch < nch) { break; } let mut aa_bands: i32 = 31; let n_long_bands: i32 = (if gr_info[0].mixed_block_flag != 0 { 2 } else { 0 }) << (((*h).header[2] as (i32) >> 2 & 3) + (((*h).header[1] as (i32) >> 3 & 1) + ((*h).header[1] as (i32) >> 4 & 1)) * 3 == 2) as (i32); if gr_info[0].n_short_sfb != 0 { aa_bands = n_long_bands - 1; l3_reorder( &mut s.grbuf[ch as usize][..(n_long_bands * 18) as usize], &mut s.syn[0][..], &gr_info[0].sfbtab[gr_info[0].n_long_sfb as usize..], ); } l3_antialias(&mut s.grbuf[ch as usize][..], aa_bands); l3_imdct_gr( &mut s.grbuf[ch as usize][..], &mut h.mdct_overlap[ch as usize][..], gr_info[0].block_type as (u32), n_long_bands as (u32), ); l3_change_sign(&mut s.grbuf[ch as usize]); ch = ch + 1; // gr_info = gr_info.offset(1); increment_by_mut(&mut gr_info, 1); } } pub(crate) fn l3_save_reservoir(h: &mut Mp3Dec, s: &mut Mp3DecScratch) { let mut pos: i32 = (((*s).bs.pos + 7) as (u32)).wrapping_div(8) as (i32); let mut remains: i32 = ((*s).bs.limit as (u32)) .wrapping_div(8) .wrapping_sub(pos as (u32)) as (i32); // TODO: remains can probably be way simpler. if remains > 511 { pos = pos + (remains - 511); remains = 511; } if remains > 0 { // memmove( // (*h).reserv_buf.as_mut_ptr() as (*mut ::std::os::raw::c_void), // (*s).maindata.as_mut_ptr().offset(pos as isize) as (*const ::std::os::raw::c_void), // remains as usize, // ); let slice_end = (pos + remains) as usize; let from_slice = &s.maindata[pos as usize..slice_end]; h.reserv_buf[..from_slice.len()].copy_from_slice(from_slice); } (*h).reserv = remains; } /// Returns usize but I think the max length an ID3 /// tag can have is 32 bits? pub fn mp3dec_skip_id3v2_slice(buf: &[u8]) -> usize { if buf.len() > 10 && buf[..3] == b"ID3\0"[..3] { (((buf[6] & 0x7F) as usize) << 21 | ((buf[7] & 0x7F) as usize) << 14 | ((buf[8] & 0x7F) as usize) << 7 | ((buf[9] & 0x7F) as usize) + 10) } else { 0 } } pub fn mp3dec_decode_frame( dec: &mut Mp3Dec, mp3: &[u8], mut pcm: &mut [i16], info: &mut FrameInfo, ) -> i32 { let mp3_bytes = mp3.len() as i32; let current_block; let mut i: i32 = 0; let mut igr: i32; let mut frame_size: i32 = 0; let mut success = true; let hdr: &[u8]; let mut bs_frame: Bs = Bs::new(&[], 0); let mut scratch: Mp3DecScratch = Mp3DecScratch { bs: bs_frame, maindata: [0; 2815], gr_info: [L3GrInfo::default(); 4], grbuf: [[0.0; 576]; 2], scf: [0.0; 40], syn: [[0.0; 64]; 33], ist_pos: [[0; 39]; 2], }; if mp3_bytes > 4 && ((*dec).header[0] as (i32) == 0xff) && (hdr_compare(&dec.header, mp3) != 0) { frame_size = hdr_frame_bytes(mp3, (*dec).free_format_bytes) + hdr_padding(mp3); if frame_size != mp3_bytes && (frame_size + 4 > mp3_bytes || hdr_compare(mp3, &mp3[frame_size as usize..]) == 0) { frame_size = 0; } } if frame_size == 0 { // memset( // dec as (*mut ::std::os::raw::c_void), // 0, // ::std::mem::size_of::<Mp3Dec>(), // ); *dec = Mp3Dec::new(); i = mp3d_find_frame( mp3, mp3_bytes, &mut (*dec).free_format_bytes, &mut frame_size, ); if frame_size == 0 || i + frame_size > mp3_bytes { (*info).frame_bytes = i; return 0; } } hdr = &mp3[i as usize..]; // memcpy( // (*dec).header.as_mut_ptr() as (*mut ::std::os::raw::c_void), // hdr.as_mut_ptr() as (*const ::std::os::raw::c_void), // 4, // ); dec.header[0..4].copy_from_slice(&hdr[0..4]); (*info).frame_bytes = i + frame_size; (*info).channels = if hdr[3] & 0xc0 == 0xc0 { 1 } else { 2 }; (*info).hz = hdr_sample_rate_hz(hdr) as (i32); (*info).layer = 4 - (hdr[1] as (i32) >> 1 & 3); (*info).bitrate_kbps = hdr_bitrate_kbps(hdr) as (i32); // This was pcm.is_null()... does this work? if pcm.len() == 0 { hdr_frame_samples(hdr) as (i32) } else { bs_frame = Bs::new(&hdr[4..], frame_size - 4); if hdr[1] as (i32) & 1 == 0 { get_bits(&mut bs_frame, 16); } if (*info).layer == 3 { let main_data_begin: i32 = l3_read_side_info(&mut bs_frame, &mut scratch.gr_info[..], hdr); if main_data_begin < 0 || bs_frame.pos > bs_frame.limit { *dec = Mp3Dec::new(); return 0; } else { unsafe { success = l3_restore_reservoir( &mut *dec, &mut bs_frame, // BUGGO: Defeat borrow checker &mut *(&mut scratch as *mut Mp3DecScratch), main_data_begin, ); } if success { igr = 0; loop { if !(igr < if hdr[1] as (i32) & 0x8 != 0 { 2 } else { 1 }) { break; } // memset( // scratch.grbuf[0].as_mut_ptr() as (*mut ::std::os::raw::c_void), // 0, // ((576 * 2) as usize).wrapping_mul(::std::mem::size_of::<f32>()), // ); scratch.clear_grbuf(); let gr_offset = (igr * (*info).channels) as usize; unsafe { l3_decode( &mut *dec, // BUGGO: Defeat borrow checker &mut *(&mut scratch as *mut Mp3DecScratch), &mut scratch.gr_info[gr_offset..], (*info).channels, ); } mp3d_synth_granule( &mut dec.qmf_state, &mut scratch.grbuf[0][..], 18, (*info).channels, pcm, &mut scratch.syn[0], ); igr = igr + 1; // pcm = pcm.offset((576 * (*info).channels) as isize); // let pcm_lifetime_hack = unsafe { // let pcm_ptr = pcm.as_mut_ptr(); // ::std::slice::from_raw_parts_mut(pcm_ptr, pcm.len()) // }; // pcm = &mut pcm_lifetime_hack[(576 * info.channels) as usize..]; increment_by_mut(&mut pcm, (576 * info.channels) as usize); } } l3_save_reservoir(&mut *dec, &mut scratch); } } else { let mut sci: L12ScaleInfo = L12ScaleInfo::default(); l12_read_scale_info(hdr, &mut bs_frame, &mut sci); // memset( // scratch.grbuf[0].as_mut_ptr() as (*mut ::std::os::raw::c_void), // 0, // ((576 * 2) as usize).wrapping_mul(::std::mem::size_of::<f32>()), // ); scratch.clear_grbuf(); i = 0; igr = 0; loop { if !(igr < 3) { current_block = 21; break; } if 12 == { println!( "ARGS: {:?}, {:?}, {}", &mut scratch.grbuf[0][i as usize..].len(), &mut sci.total_bands, (*info).layer | 1, ); i = i + l12_dequantize_granule( &mut scratch.grbuf[0][i as usize..], &mut bs_frame, &mut sci, (*info).layer | 1, ); i } { i = 0; // BUGGO Gotta defeat the borrow checker here; // borrowing both sci and sci.scf unsafe { l12_apply_scf_384( &mut *(&mut sci as *mut L12ScaleInfo), &mut sci.scf[igr as usize..], &mut scratch.grbuf[0], ); } mp3d_synth_granule( &mut dec.qmf_state, &mut scratch.grbuf[0][..], 12, (*info).channels, pcm, &mut scratch.syn[0], ); // memset( // scratch.grbuf[0].as_mut_ptr() as (*mut ::std::os::raw::c_void), // 0, // ((576 * 2) as usize).wrapping_mul(::std::mem::size_of::<f32>()), // ); scratch.clear_grbuf(); // pcm = pcm.offset((384 * (*info).channels) as isize); // BUGGO: Borrow checker defeat here. // let pcm_lifetime_hack = unsafe { // let pcm_ptr = pcm.as_mut_ptr(); // ::std::slice::from_raw_parts_mut(pcm_ptr, pcm.len()) // }; // pcm = &mut pcm_lifetime_hack[(384 * info.channels) as usize..] increment_by_mut(&mut pcm, (384 * info.channels) as usize); } if bs_frame.pos > bs_frame.limit { current_block = 15; break; } igr = igr + 1; } if current_block == 21 { } else { *dec = Mp3Dec::new(); return 0; } } (success as (u32)).wrapping_mul(hdr_frame_samples(&dec.header)) as (i32) } }
{ current_block = 2; break; }
post_service.go
package service import ( "context" "time" "github.com/Zucke/social_prove/pkg/logger" "github.com/Zucke/social_prove/pkg/post" "github.com/Zucke/social_prove/pkg/post/repository" "github.com/Zucke/social_prove/pkg/response" "github.com/Zucke/social_prove/pkg/user" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" ) const waitTime = 10 // PostService the post service. type PostService struct { repository post.Repository log logger.Logger } // Create create a new post. func (ps *PostService) Create(ctx context.Context, p *post.Post) error { ctx, cancel := context.WithTimeout(ctx, waitTime*time.Second) defer cancel() if p.ID.IsZero() { p.ID = primitive.NewObjectID() } p.CreatedAt = time.Now() p.UpdatedAt = time.Now() if err := ps.repository.Create(ctx, p); err != nil { ps.log.Error(err) return response.ErrCouldNotInsert } return nil } // GetByID returns a post by ID. func (ps *PostService) GetByID(ctx context.Context, id string) (post.Post, error) { ctx, cancel := context.WithTimeout(ctx, waitTime*time.Second) defer cancel() objectID, err := primitive.ObjectIDFromHex(id) if err != nil { ps.log.Error(err) return post.Post{}, response.ErrInvalidID } p, err := ps.repository.GetByID(ctx, objectID) if err != nil { ps.log.Error(err) return post.Post{}, err } return p, nil } // GetAllForUser return all post of a user. func (ps *PostService) GetAllForUser(ctx context.Context, userID string) ([]post.Post, error) { ctx, cancel := context.WithTimeout(ctx, waitTime*time.Second) defer cancel() objectUserID, err := primitive.ObjectIDFromHex(userID) if err != nil { ps.log.Error(err) return nil, response.ErrInvalidID } posts, err := ps.repository.GetAllForUser(ctx, objectUserID) if err != nil { ps.log.Error(err) return nil, err } return posts, nil } // GetAll returns all stored posts. func (ps *PostService) GetAll(ctx context.Context) ([]post.Post, error) { ctx, cancel := context.WithTimeout(ctx, waitTime*time.Second) defer cancel() posts, err := ps.repository.GetAll(ctx) if err != nil { ps.log.Error(err) return nil, err } return posts, nil } // Update post by ID. func (ps *PostService) Update(ctx context.Context, toUpdateID string, currendUserID string, role user.Role, p *post.Post) (post.Post, error) { ctx, cancel := context.WithTimeout(ctx, waitTime*time.Second) defer cancel() objectID, err := primitive.ObjectIDFromHex(toUpdateID) if err != nil { ps.log.Error(err) return post.Post{}, response.ErrInvalidID } if role == user.Client { vPost, err := ps.GetByID(ctx, toUpdateID) if err != nil { ps.log.Error(err) return post.Post{}, err } if currendUserID != vPost.UserID.Hex() { return post.Post{}, response.ErrorUnauthorized } } err = ps.repository.Update(ctx, objectID, p) if err != nil { ps.log.Error(err) return post.Post{}, response.ErrorInternalServerError } updatedPost, err := ps.GetByID(ctx, toUpdateID) if err != nil { ps.log.Error(err) return post.Post{}, err } return updatedPost, nil } // Delete remove a post by ID. func (ps *PostService) Delete(ctx context.Context, toDeleteID string, currendUserID string, role user.Role) error { ctx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() objectID, err := primitive.ObjectIDFromHex(toDeleteID) if err != nil { ps.log.Error(err) return response.ErrInvalidID } if role == user.Client { vPost, err := ps.GetByID(ctx, toDeleteID) if err != nil { ps.log.Error(err) return err } if currendUserID != vPost.UserID.Hex() { return response.ErrorUnauthorized } } err = ps.repository.Delete(ctx, objectID) if err != nil { ps.log.Error(err) return err } return nil } // AddLike add a like to user. func (ps *PostService) AddLike(ctx context.Context, fanID, postID string) (post.Post, error) { ctx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() objectFanID, err := primitive.ObjectIDFromHex(fanID) if err != nil { ps.log.Error(err) return post.Post{}, response.ErrInvalidID } objectPostID, err := primitive.ObjectIDFromHex(postID) if err != nil { ps.log.Error(err) return post.Post{}, response.ErrInvalidID } err = ps.repository.AddLike(ctx, objectFanID, objectPostID) if err != nil { ps.log.Error(err) return post.Post{}, err } updatedPost, err := ps.GetByID(ctx, postID) if err != nil { ps.log.Error(err) return post.Post{}, err } return updatedPost, nil } // DeleteLike delete a like from user. func (ps *PostService) DeleteLike(ctx context.Context, fanID, postID string) (post.Post, error) { ctx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() objectFanID, err := primitive.ObjectIDFromHex(fanID) if err != nil { ps.log.Error(err) return post.Post{}, response.ErrInvalidID } objectPostID, err := primitive.ObjectIDFromHex(postID) if err != nil { ps.log.Error(err) return post.Post{}, response.ErrInvalidID } err = ps.repository.DeleteLike(ctx, objectFanID, objectPostID) if err != nil { ps.log.Error(err) return post.Post{}, err } updatedPost, err := ps.GetByID(ctx, postID) if err != nil { ps.log.Error(err) return post.Post{}, err } return updatedPost, nil } // WithPagination returns users with a pagination limit. func (ps *PostService) WithPagination(p []post.Post, page int, limit int) ([]post.Post, int) { if limit < 0 { limit = 0 } if page < 0 { page = 0 } total := len(p) if limit > total { limit = total } start := (page - 1) * limit if start > total { start = total } end := start + limit if end > total { end = total } newUsers := p[start:end] return newUsers, total } // New create and configure user services. func
(coll *mongo.Collection, log logger.Logger) post.Service { return &PostService{ repository: repository.Mongo(coll, log), log: log, } }
New
services.go
package framework import ( "fmt" "github.com/onsi/ginkgo" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ) const ( TestAppLabel = "test-app" ) func (f *Framework) CreateTCPService(cluster ClusterIndex, selectorName string, port int) *corev1.Service { tcpService := corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("test-svc-%s", selectorName), }, Spec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{{ Port: int32(port), TargetPort: intstr.FromInt(port), Protocol: corev1.ProtocolTCP, }}, Selector: map[string]string{ TestAppLabel: selectorName, }, }, } services := KubeClients[cluster].CoreV1().Services(f.Namespace) return AwaitUntil("create service", func() (interface{}, error) { service, err := services.Create(&tcpService) if errors.IsAlreadyExists(err)
return service, err }, NoopCheckResult).(*corev1.Service) } func (f *Framework) NewNginxService(cluster ClusterIndex) *corev1.Service { var port int32 = 80 nginxService := corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: "nginx-demo", Labels: map[string]string{ "app": "nginx-demo", }, }, Spec: corev1.ServiceSpec{ Type: "ClusterIP", Ports: []corev1.ServicePort{ { Port: port, Protocol: corev1.ProtocolTCP, TargetPort: intstr.IntOrString{ Type: intstr.Int, IntVal: 80, }, }, }, Selector: map[string]string{ "app": "nginx-demo", }, }, } sc := KubeClients[cluster].CoreV1().Services(f.Namespace) service := AwaitUntil("create service", func() (interface{}, error) { return sc.Create(&nginxService) }, NoopCheckResult).(*corev1.Service) return service } func (f *Framework) DeleteService(cluster ClusterIndex, serviceName string) { ginkgo.By(fmt.Sprintf("Deleting service %q on %q", serviceName, TestContext.ClusterIDs[cluster])) AwaitUntil("delete service", func() (interface{}, error) { return nil, KubeClients[cluster].CoreV1().Services(f.Namespace).Delete(serviceName, &metav1.DeleteOptions{}) }, NoopCheckResult) } // AwaitServiceByAnnotation queries the service and looks for the presence of annotation. func (f *Framework) AwaitServiceByAnnotation(cluster ClusterIndex, annotation string, svcName string, namespace string) *v1.Service { return AwaitUntil("get"+annotation+" annotation for service "+svcName, func() (interface{}, error) { service, err := KubeClients[cluster].CoreV1().Services(namespace).Get(svcName, metav1.GetOptions{}) if apierrors.IsNotFound(err) { return nil, nil } return service, err }, func(result interface{}) (bool, string, error) { if result == nil { return false, "No Service found", nil } service := result.(*v1.Service) if service.GetAnnotations()[annotation] == "" { return false, fmt.Sprintf("Service %q does not have annotation %q yet", svcName, annotation), nil } return true, "", nil }).(*corev1.Service) }
{ err = services.Delete(tcpService.Name, &metav1.DeleteOptions{}) if err != nil { return nil, err } service, err = services.Create(&tcpService) }
relation_behaviour_provider.rs
use std::sync::Arc; use async_trait::async_trait; use indradb::EdgeKey; use log::debug; use waiter_di::*; use crate::behaviour::relation::connector::Connector; use crate::behaviour::relation::connector::CONNECTORS; use crate::model::ReactiveRelationInstance; use crate::plugins::RelationBehaviourProvider; #[wrapper] pub struct ConnectorStorage( std::sync::RwLock<std::collections::HashMap<EdgeKey, std::sync::Arc<Connector>>>, ); #[waiter_di::provides] fn
() -> ConnectorStorage { ConnectorStorage(std::sync::RwLock::new(std::collections::HashMap::new())) } #[async_trait] pub trait ConnectorRelationBehaviourProvider: RelationBehaviourProvider + Send + Sync { fn create_connector(&self, relation_instance: Arc<ReactiveRelationInstance>); fn remove_connector(&self, relation_instance: Arc<ReactiveRelationInstance>); fn remove_by_key(&self, edge_key: EdgeKey); } // #[derive(Clone)] pub struct ConnectorRelationBehaviourProviderImpl { connectors: ConnectorStorage, } interfaces!(ConnectorRelationBehaviourProviderImpl: dyn RelationBehaviourProvider); #[component] impl ConnectorRelationBehaviourProviderImpl { #[provides] fn new() -> Self { Self { connectors: create_connector_storage(), } } } #[async_trait] #[provides] impl ConnectorRelationBehaviourProvider for ConnectorRelationBehaviourProviderImpl { fn create_connector(&self, relation_instance: Arc<ReactiveRelationInstance>) { let edge_key = relation_instance.get_key(); if edge_key.is_none() { return; } let edge_key = edge_key.unwrap(); let mut type_name = relation_instance.type_name.clone(); // TODO: remove debug!("relation type name {}", relation_instance.type_name.clone()); let mut function = CONNECTORS.get(type_name.as_str()); if function.is_none() { let connector_type_name = CONNECTORS .keys() .into_iter() .find(|connector_type_name| type_name.starts_with(*connector_type_name)); if connector_type_name.is_some() { // TODO: remove debug!( "Detected relation type name starts with {}", connector_type_name.unwrap() ); function = CONNECTORS.get(connector_type_name.unwrap()); type_name = String::from(*connector_type_name.unwrap()); } } let connector = match function { Some(function) => Some(Arc::new(Connector::from_relation( relation_instance.clone(), *function, ))), None => None, }; if connector.is_some() { self.connectors .0 .write() .unwrap() .insert(edge_key.clone(), connector.unwrap()); debug!( "Added behaviour {} to relation instance {:?}", type_name, edge_key ); } } fn remove_connector(&self, relation_instance: Arc<ReactiveRelationInstance>) { let edge_key = relation_instance.get_key(); if edge_key.is_none() { return; } let edge_key = edge_key.unwrap(); self.connectors.0.write().unwrap().remove(&edge_key); debug!( "Removed behaviour connector to relation instance {:?}", edge_key ); } fn remove_by_key(&self, edge_key: EdgeKey) { if self.connectors.0.write().unwrap().contains_key(&edge_key) { self.connectors.0.write().unwrap().remove(&edge_key); debug!( "Removed behaviour connector to relation instance {:?}", edge_key ); } } } impl RelationBehaviourProvider for ConnectorRelationBehaviourProviderImpl { fn add_behaviours(&self, relation_instance: Arc<ReactiveRelationInstance>) { self.create_connector(relation_instance.clone()); } fn remove_behaviours(&self, relation_instance: Arc<ReactiveRelationInstance>) { self.remove_connector(relation_instance.clone()); } fn remove_behaviours_by_key(&self, edge_key: EdgeKey) { self.remove_by_key(edge_key); } }
create_connector_storage
inputSanitize.ts
import { PadPrmSpdTags } from '../renderer/store/types/types'; export const range = (value: number, min: number, max: number) => { return Math.min(Math.max(value, min), max); }; // Tempo: (v: number) => range(Number(v), 200, 4000) export const inputSanitize: { [key: string]: (input: string | number) => number; } = { Tempo: (v: any) => range(Number(v), 200, 4000), Level: (v: any) => range(Number(v), 0, 100), Pan: (v: any) => range(Number(v), 0, 30), PlayMode: (v: any) => range(Number(v), -1, 1) // ???? // OutAssign:
};
rule.go
// Copyright (c) The Thanos Authors. // Licensed under the Apache License 2.0. package main import ( "context" "math/rand" "net/http" "net/url" "os" "path/filepath" "strconv" "strings" "time" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/oklog/run" "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/common/model" "github.com/prometheus/common/route" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/rules" "github.com/prometheus/prometheus/tsdb" tsdberrors "github.com/prometheus/prometheus/tsdb/errors" "github.com/prometheus/prometheus/util/strutil" "github.com/thanos-io/thanos/pkg/extkingpin" "github.com/thanos-io/thanos/pkg/alert" v1 "github.com/thanos-io/thanos/pkg/api/rule" "github.com/thanos-io/thanos/pkg/block/metadata" "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/discovery/dns" "github.com/thanos-io/thanos/pkg/extflag" "github.com/thanos-io/thanos/pkg/extprom" extpromhttp "github.com/thanos-io/thanos/pkg/extprom/http" http_util "github.com/thanos-io/thanos/pkg/http" "github.com/thanos-io/thanos/pkg/logging" "github.com/thanos-io/thanos/pkg/objstore/client" "github.com/thanos-io/thanos/pkg/prober" "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/query" thanosrules "github.com/thanos-io/thanos/pkg/rules" "github.com/thanos-io/thanos/pkg/runutil" grpcserver "github.com/thanos-io/thanos/pkg/server/grpc" httpserver "github.com/thanos-io/thanos/pkg/server/http" "github.com/thanos-io/thanos/pkg/shipper" "github.com/thanos-io/thanos/pkg/store" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/tls" "github.com/thanos-io/thanos/pkg/tracing" "github.com/thanos-io/thanos/pkg/ui" ) // registerRule registers a rule command. func registerRule(app *extkingpin.App) { comp := component.Rule cmd := app.Command(comp.String(), "ruler evaluating Prometheus rules against given Query nodes, exposing Store API and storing old blocks in bucket") httpBindAddr, httpGracePeriod := extkingpin.RegisterHTTPFlags(cmd) grpcBindAddr, grpcGracePeriod, grpcCert, grpcKey, grpcClientCA := extkingpin.RegisterGRPCFlags(cmd) labelStrs := cmd.Flag("label", "Labels to be applied to all generated metrics (repeated). Similar to external labels for Prometheus, used to identify ruler and its blocks as unique source."). PlaceHolder("<name>=\"<value>\"").Strings() dataDir := cmd.Flag("data-dir", "data directory").Default("data/").String() ruleFiles := cmd.Flag("rule-file", "Rule files that should be used by rule manager. Can be in glob format (repeated)."). Default("rules/").Strings() resendDelay := extkingpin.ModelDuration(cmd.Flag("resend-delay", "Minimum amount of time to wait before resending an alert to Alertmanager."). Default("1m")) evalInterval := extkingpin.ModelDuration(cmd.Flag("eval-interval", "The default evaluation interval to use."). Default("30s")) tsdbBlockDuration := extkingpin.ModelDuration(cmd.Flag("tsdb.block-duration", "Block duration for TSDB block."). Default("2h")) tsdbRetention := extkingpin.ModelDuration(cmd.Flag("tsdb.retention", "Block retention time on local disk."). Default("48h")) noLockFile := cmd.Flag("tsdb.no-lockfile", "Do not create lockfile in TSDB data directory. In any case, the lockfiles will be deleted on next startup.").Default("false").Bool() walCompression := cmd.Flag("tsdb.wal-compression", "Compress the tsdb WAL.").Default("true").Bool() alertmgrs := cmd.Flag("alertmanagers.url", "Alertmanager replica URLs to push firing alerts. Ruler claims success if push to at least one alertmanager from discovered succeeds. The scheme should not be empty e.g `http` might be used. The scheme may be prefixed with 'dns+' or 'dnssrv+' to detect Alertmanager IPs through respective DNS lookups. The port defaults to 9093 or the SRV record's value. The URL path is used as a prefix for the regular Alertmanager API path."). Strings() alertmgrsTimeout := cmd.Flag("alertmanagers.send-timeout", "Timeout for sending alerts to Alertmanager").Default("10s").Duration() alertmgrsConfig := extflag.RegisterPathOrContent(cmd, "alertmanagers.config", "YAML file that contains alerting configuration. See format details: https://thanos.io/tip/components/rule.md/#configuration. If defined, it takes precedence over the '--alertmanagers.url' and '--alertmanagers.send-timeout' flags.", false) alertmgrsDNSSDInterval := extkingpin.ModelDuration(cmd.Flag("alertmanagers.sd-dns-interval", "Interval between DNS resolutions of Alertmanager hosts."). Default("30s")) alertQueryURL := cmd.Flag("alert.query-url", "The external Thanos Query URL that would be set in all alerts 'Source' field").String() alertExcludeLabels := cmd.Flag("alert.label-drop", "Labels by name to drop before sending to alertmanager. This allows alert to be deduplicated on replica label (repeated). Similar Prometheus alert relabelling"). Strings() webRoutePrefix := cmd.Flag("web.route-prefix", "Prefix for API and UI endpoints. This allows thanos UI to be served on a sub-path. This option is analogous to --web.route-prefix of Promethus.").Default("").String() webExternalPrefix := cmd.Flag("web.external-prefix", "Static prefix for all HTML links and redirect URLs in the UI query web interface. Actual endpoints are still served on / or the web.route-prefix. This allows thanos UI to be served behind a reverse proxy that strips a URL sub-path.").Default("").String() webPrefixHeaderName := cmd.Flag("web.prefix-header", "Name of HTTP request header used for dynamic prefixing of UI links and redirects. This option is ignored if web.external-prefix argument is set. Security risk: enable this option only if a reverse proxy in front of thanos is resetting the header. The --web.prefix-header=X-Forwarded-Prefix option can be useful, for example, if Thanos UI is served via Traefik reverse proxy with PathPrefixStrip option enabled, which sends the stripped prefix value in X-Forwarded-Prefix header. This allows thanos UI to be served on a sub-path.").Default("").String() requestLoggingDecision := cmd.Flag("log.request.decision", "Request Logging for logging the start and end of requests. LogFinishCall is enabled by default. LogFinishCall : Logs the finish call of the requests. LogStartAndFinishCall : Logs the start and finish call of the requests. NoLogCall : Disable request logging.").Default("LogFinishCall").Enum("NoLogCall", "LogFinishCall", "LogStartAndFinishCall") objStoreConfig := extkingpin.RegisterCommonObjStoreFlags(cmd, "", false) queries := cmd.Flag("query", "Addresses of statically configured query API servers (repeatable). The scheme may be prefixed with 'dns+' or 'dnssrv+' to detect query API servers through respective DNS lookups."). PlaceHolder("<query>").Strings() queryConfig := extflag.RegisterPathOrContent(cmd, "query.config", "YAML file that contains query API servers configuration. See format details: https://thanos.io/tip/components/rule.md/#configuration. If defined, it takes precedence over the '--query' and '--query.sd-files' flags.", false) fileSDFiles := cmd.Flag("query.sd-files", "Path to file that contains addresses of query API servers. The path can be a glob pattern (repeatable)."). PlaceHolder("<path>").Strings() fileSDInterval := extkingpin.ModelDuration(cmd.Flag("query.sd-interval", "Refresh interval to re-read file SD files. (used as a fallback)"). Default("5m")) dnsSDInterval := extkingpin.ModelDuration(cmd.Flag("query.sd-dns-interval", "Interval between DNS resolutions."). Default("30s")) dnsSDResolver := cmd.Flag("query.sd-dns-resolver", "Resolver to use. Possible options: [golang, miekgdns]"). Default("golang").Hidden().String() allowOutOfOrderUpload := cmd.Flag("shipper.allow-out-of-order-uploads", "If true, shipper will skip failed block uploads in the given iteration and retry later. This means that some newer blocks might be uploaded sooner than older blocks."+ "This can trigger compaction without those blocks and as a result will create an overlap situation. Set it to true if you have vertical compaction enabled and wish to upload blocks as soon as possible without caring"+ "about order."). Default("false").Hidden().Bool() cmd.Setup(func(g *run.Group, logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, reload <-chan struct{}, _ bool) error { lset, err := parseFlagLabels(*labelStrs) if err != nil { return errors.Wrap(err, "parse labels") } alertQueryURL, err := url.Parse(*alertQueryURL) if err != nil { return errors.Wrap(err, "parse alert query url") } tsdbOpts := &tsdb.Options{ MinBlockDuration: int64(time.Duration(*tsdbBlockDuration) / time.Millisecond), MaxBlockDuration: int64(time.Duration(*tsdbBlockDuration) / time.Millisecond), RetentionDuration: int64(time.Duration(*tsdbRetention) / time.Millisecond), NoLockfile: *noLockFile, WALCompression: *walCompression, } // Parse and check query configuration. lookupQueries := map[string]struct{}{} for _, q := range *queries { if _, ok := lookupQueries[q]; ok { return errors.Errorf("Address %s is duplicated for --query flag.", q) } lookupQueries[q] = struct{}{} } queryConfigYAML, err := queryConfig.Content() if err != nil { return err } if len(*fileSDFiles) == 0 && len(*queries) == 0 && len(queryConfigYAML) == 0 { return errors.New("no --query parameter was given") } if (len(*fileSDFiles) != 0 || len(*queries) != 0) && len(queryConfigYAML) != 0 { return errors.New("--query/--query.sd-files and --query.config* parameters cannot be defined at the same time") } // Parse and check alerting configuration. alertmgrsConfigYAML, err := alertmgrsConfig.Content() if err != nil { return err } if len(alertmgrsConfigYAML) != 0 && len(*alertmgrs) != 0 { return errors.New("--alertmanagers.url and --alertmanagers.config* parameters cannot be defined at the same time") } return runRule(g, logger, reg, tracer, *requestLoggingDecision, reload, lset, *alertmgrs, *alertmgrsTimeout, alertmgrsConfigYAML, time.Duration(*alertmgrsDNSSDInterval), *grpcBindAddr, time.Duration(*grpcGracePeriod), *grpcCert, *grpcKey, *grpcClientCA, *httpBindAddr, time.Duration(*httpGracePeriod), *webRoutePrefix, *webExternalPrefix, *webPrefixHeaderName, time.Duration(*resendDelay), time.Duration(*evalInterval), *dataDir, *ruleFiles, objStoreConfig, tsdbOpts, alertQueryURL, *alertExcludeLabels, *queries, *fileSDFiles, time.Duration(*fileSDInterval), queryConfigYAML, time.Duration(*dnsSDInterval), *dnsSDResolver, comp, *allowOutOfOrderUpload, getFlagsMap(cmd.Flags()), ) }) } // RuleMetrics defines thanos rule metrics. type RuleMetrics struct { configSuccess prometheus.Gauge configSuccessTime prometheus.Gauge duplicatedQuery prometheus.Counter rulesLoaded *prometheus.GaugeVec ruleEvalWarnings *prometheus.CounterVec } func newRuleMetrics(reg *prometheus.Registry) *RuleMetrics { m := new(RuleMetrics) factory := promauto.With(reg) m.configSuccess = factory.NewGauge(prometheus.GaugeOpts{ Name: "thanos_rule_config_last_reload_successful", Help: "Whether the last configuration reload attempt was successful.", }) m.configSuccessTime = factory.NewGauge(prometheus.GaugeOpts{ Name: "thanos_rule_config_last_reload_success_timestamp_seconds", Help: "Timestamp of the last successful configuration reload.", }) m.duplicatedQuery = factory.NewCounter(prometheus.CounterOpts{ Name: "thanos_rule_duplicated_query_addresses_total", Help: "The number of times a duplicated query addresses is detected from the different configs in rule.", }) m.rulesLoaded = factory.NewGaugeVec( prometheus.GaugeOpts{ Name: "thanos_rule_loaded_rules", Help: "Loaded rules partitioned by file and group.", }, []string{"strategy", "file", "group"}, ) m.ruleEvalWarnings = factory.NewCounterVec( prometheus.CounterOpts{ Name: "thanos_rule_evaluation_with_warnings_total", Help: "The total number of rule evaluation that were successful but had warnings which can indicate partial error.", }, []string{"strategy"}, ) m.ruleEvalWarnings.WithLabelValues(strings.ToLower(storepb.PartialResponseStrategy_ABORT.String())) m.ruleEvalWarnings.WithLabelValues(strings.ToLower(storepb.PartialResponseStrategy_WARN.String())) return m } // runRule runs a rule evaluation component that continuously evaluates alerting and recording // rules. It sends alert notifications and writes TSDB data for results like a regular Prometheus server. func runRule( g *run.Group, logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, requestLoggingDecision string, reloadSignal <-chan struct{}, lset labels.Labels, alertmgrURLs []string, alertmgrsTimeout time.Duration, alertmgrsConfigYAML []byte, alertmgrsDNSSDInterval time.Duration, grpcBindAddr string, grpcGracePeriod time.Duration, grpcCert string, grpcKey string, grpcClientCA string, httpBindAddr string, httpGracePeriod time.Duration, webRoutePrefix string, webExternalPrefix string, webPrefixHeaderName string, resendDelay time.Duration, evalInterval time.Duration, dataDir string, ruleFiles []string, objStoreConfig *extflag.PathOrContent, tsdbOpts *tsdb.Options, alertQueryURL *url.URL, alertExcludeLabels []string, queryAddrs []string, querySDFiles []string, querySDInterval time.Duration, queryConfigYAML []byte, dnsSDInterval time.Duration, dnsSDResolver string, comp component.Component, allowOutOfOrderUpload bool, flagsMap map[string]string, ) error { metrics := newRuleMetrics(reg) var queryCfg []query.Config var err error if len(queryConfigYAML) > 0 { queryCfg, err = query.LoadConfigs(queryConfigYAML) if err != nil { return err } } else { queryCfg, err = query.BuildQueryConfig(queryAddrs) if err != nil { return err } // Build the query configuration from the legacy query flags. var fileSDConfigs []http_util.FileSDConfig if len(querySDFiles) > 0 { fileSDConfigs = append(fileSDConfigs, http_util.FileSDConfig{ Files: querySDFiles, RefreshInterval: model.Duration(querySDInterval), }) queryCfg = append(queryCfg, query.Config{ EndpointsConfig: http_util.EndpointsConfig{ Scheme: "http", FileSDConfigs: fileSDConfigs, }, }, ) } } queryProvider := dns.NewProvider( logger, extprom.WrapRegistererWithPrefix("thanos_ruler_query_apis_", reg), dns.ResolverType(dnsSDResolver), ) var queryClients []*http_util.Client for _, cfg := range queryCfg { c, err := http_util.NewHTTPClient(cfg.HTTPClientConfig, "query") if err != nil { return err } c.Transport = tracing.HTTPTripperware(logger, c.Transport) queryClient, err := http_util.NewClient(logger, cfg.EndpointsConfig, c, queryProvider.Clone()) if err != nil { return err } queryClients = append(queryClients, queryClient) // Discover and resolve query addresses. addDiscoveryGroups(g, queryClient, dnsSDInterval) } db, err := tsdb.Open(dataDir, log.With(logger, "component", "tsdb"), reg, tsdbOpts) if err != nil { return errors.Wrap(err, "open TSDB") } level.Debug(logger).Log("msg", "removing storage lock file if any") if err := removeLockfileIfAny(logger, dataDir); err != nil { return errors.Wrap(err, "remove storage lock files") } { done := make(chan struct{}) g.Add(func() error { <-done return db.Close() }, func(error) { close(done) }) } // Build the Alertmanager clients. var alertingCfg alert.AlertingConfig if len(alertmgrsConfigYAML) > 0 { alertingCfg, err = alert.LoadAlertingConfig(alertmgrsConfigYAML) if err != nil { return err } } else { // Build the Alertmanager configuration from the legacy flags. for _, addr := range alertmgrURLs { cfg, err := alert.BuildAlertmanagerConfig(addr, alertmgrsTimeout) if err != nil { return err } alertingCfg.Alertmanagers = append(alertingCfg.Alertmanagers, cfg) } } if len(alertingCfg.Alertmanagers) == 0 { level.Warn(logger).Log("msg", "no alertmanager configured") } amProvider := dns.NewProvider( logger, extprom.WrapRegistererWithPrefix("thanos_ruler_alertmanagers_", reg), dns.ResolverType(dnsSDResolver), ) var alertmgrs []*alert.Alertmanager for _, cfg := range alertingCfg.Alertmanagers { c, err := http_util.NewHTTPClient(cfg.HTTPClientConfig, "alertmanager") if err != nil { return err } c.Transport = tracing.HTTPTripperware(logger, c.Transport) // Each Alertmanager client has a different list of targets thus each needs its own DNS provider. amClient, err := http_util.NewClient(logger, cfg.EndpointsConfig, c, amProvider.Clone()) if err != nil { return err } // Discover and resolve Alertmanager addresses. addDiscoveryGroups(g, amClient, alertmgrsDNSSDInterval) alertmgrs = append(alertmgrs, alert.NewAlertmanager(logger, amClient, time.Duration(cfg.Timeout), cfg.APIVersion)) } var ( ruleMgr *thanosrules.Manager alertQ = alert.NewQueue(logger, reg, 10000, 100, labelsTSDBToProm(lset), alertExcludeLabels) ) { // Run rule evaluation and alert notifications. notifyFunc := func(ctx context.Context, expr string, alerts ...*rules.Alert) { res := make([]*alert.Alert, 0, len(alerts)) for _, alrt := range alerts { // Only send actually firing alerts. if alrt.State == rules.StatePending { continue } a := &alert.Alert{ StartsAt: alrt.FiredAt, Labels: alrt.Labels, Annotations: alrt.Annotations, GeneratorURL: alertQueryURL.String() + strutil.TableLinkForExpression(expr), } if !alrt.ResolvedAt.IsZero() { a.EndsAt = alrt.ResolvedAt } else { a.EndsAt = alrt.ValidUntil } res = append(res, a) } alertQ.Push(res) } ctx, cancel := context.WithCancel(context.Background()) logger = log.With(logger, "component", "rules") ruleMgr = thanosrules.NewManager( tracing.ContextWithTracer(ctx, tracer), reg, dataDir, rules.ManagerOptions{ NotifyFunc: notifyFunc, Logger: logger, Appendable: db, ExternalURL: nil, Queryable: db, ResendDelay: resendDelay, }, queryFuncCreator(logger, queryClients, metrics.duplicatedQuery, metrics.ruleEvalWarnings), lset, ) // Schedule rule manager that evaluates rules. g.Add(func() error { ruleMgr.Run() <-ctx.Done() return nil }, func(err error) { cancel() ruleMgr.Stop() }) } // Run the alert sender. { sdr := alert.NewSender(logger, reg, alertmgrs) ctx, cancel := context.WithCancel(context.Background()) ctx = tracing.ContextWithTracer(ctx, tracer) g.Add(func() error { for { tracing.DoInSpan(ctx, "/send_alerts", func(ctx context.Context) { sdr.Send(ctx, alertQ.Pop(ctx.Done())) }) select { case <-ctx.Done(): return ctx.Err() default: } } }, func(error) { cancel() }) } // Handle reload and termination interrupts. reloadWebhandler := make(chan chan error) { ctx, cancel := context.WithCancel(context.Background()) g.Add(func() error { // Initialize rules. if err := reloadRules(logger, ruleFiles, ruleMgr, evalInterval, metrics); err != nil { level.Error(logger).Log("msg", "initialize rules failed", "err", err) return err } for { select { case <-reloadSignal: if err := reloadRules(logger, ruleFiles, ruleMgr, evalInterval, metrics); err != nil { level.Error(logger).Log("msg", "reload rules by sighup failed", "err", err) } case reloadMsg := <-reloadWebhandler: err := reloadRules(logger, ruleFiles, ruleMgr, evalInterval, metrics) if err != nil { level.Error(logger).Log("msg", "reload rules by webhandler failed", "err", err) } reloadMsg <- err case <-ctx.Done(): return ctx.Err() } } }, func(error) { cancel() }) } grpcProbe := prober.NewGRPC() httpProbe := prober.NewHTTP() statusProber := prober.Combine( httpProbe, grpcProbe, prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) // Start gRPC server. { tsdbStore := store.NewTSDBStore(logger, reg, db, component.Rule, lset) tlsCfg, err := tls.NewServerConfig(log.With(logger, "protocol", "gRPC"), grpcCert, grpcKey, grpcClientCA) if err != nil { return errors.Wrap(err, "setup gRPC server") } // TODO: Add rules API implementation when ready. s := grpcserver.New(logger, reg, tracer, comp, grpcProbe, grpcserver.WithServer(store.RegisterStoreServer(tsdbStore)), grpcserver.WithServer(thanosrules.RegisterRulesServer(ruleMgr)), grpcserver.WithListen(grpcBindAddr), grpcserver.WithGracePeriod(grpcGracePeriod), grpcserver.WithTLSConfig(tlsCfg), ) g.Add(func() error { statusProber.Ready() return s.ListenAndServe() }, func(err error) { statusProber.NotReady(err) s.Shutdown(err) }) } // Start UI & metrics HTTP server. { router := route.New() // RoutePrefix must always start with '/'. webRoutePrefix = "/" + strings.Trim(webRoutePrefix, "/") // Redirect from / to /webRoutePrefix. if webRoutePrefix != "/" { router.Get("/", func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, webRoutePrefix, http.StatusFound) }) router = router.WithPrefix(webRoutePrefix) } router.Post("/-/reload", func(w http.ResponseWriter, r *http.Request) { reloadMsg := make(chan error) reloadWebhandler <- reloadMsg if err := <-reloadMsg; err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } }) ins := extpromhttp.NewInstrumentationMiddleware(reg) // Configure Request Logging for HTTP calls. opts := []logging.Option{logging.WithDecider(func() logging.Decision { return logging.LogDecision[requestLoggingDecision] })} logMiddleware := logging.NewHTTPServerMiddleware(logger, opts...) // TODO(bplotka in PR #513 review): pass all flags, not only the flags needed by prefix rewriting. ui.NewRuleUI(logger, reg, ruleMgr, alertQueryURL.String(), webExternalPrefix, webPrefixHeaderName).Register(router, ins) api := v1.NewRuleAPI(logger, reg, thanosrules.NewGRPCClient(ruleMgr), ruleMgr, flagsMap) api.Register(router.WithPrefix("/api/v1"), tracer, logger, ins, logMiddleware) srv := httpserver.New(logger, reg, comp, httpProbe, httpserver.WithListen(httpBindAddr), httpserver.WithGracePeriod(httpGracePeriod), ) srv.Handle("/", router) g.Add(func() error { statusProber.Healthy() return srv.ListenAndServe() }, func(err error) { statusProber.NotReady(err) defer statusProber.NotHealthy(err) srv.Shutdown(err) }) } confContentYaml, err := objStoreConfig.Content() if err != nil { return err } if len(confContentYaml) > 0 { // The background shipper continuously scans the data directory and uploads // new blocks to Google Cloud Storage or an S3-compatible storage service. bkt, err := client.NewBucket(logger, confContentYaml, reg, component.Rule.String()) if err != nil { return err } // Ensure we close up everything properly. defer func() { if err != nil { runutil.CloseWithLogOnErr(logger, bkt, "bucket client") } }() s := shipper.New(logger, reg, dataDir, bkt, func() labels.Labels { return lset }, metadata.RulerSource, false, allowOutOfOrderUpload) ctx, cancel := context.WithCancel(context.Background()) g.Add(func() error { defer runutil.CloseWithLogOnErr(logger, bkt, "bucket client") return runutil.Repeat(30*time.Second, ctx.Done(), func() error { if _, err := s.Sync(ctx); err != nil { level.Warn(logger).Log("err", err) } return nil }) }, func(error) { cancel() }) } else { level.Info(logger).Log("msg", "no supported bucket was configured, uploads will be disabled") } level.Info(logger).Log("msg", "starting rule node") return nil } func removeLockfileIfAny(logger log.Logger, dataDir string) error { absdir, err := filepath.Abs(dataDir) if err != nil { return err } if err := os.Remove(filepath.Join(absdir, "lock")); err != nil { if os.IsNotExist(err) { return nil } return err } level.Info(logger).Log("msg", "a leftover lockfile found and removed") return nil } func parseFlagLabels(s []string) (labels.Labels, error) { var lset labels.Labels for _, l := range s { parts := strings.SplitN(l, "=", 2) if len(parts) != 2 { return nil, errors.Errorf("unrecognized label %q", l) } if !model.LabelName.IsValid(model.LabelName(string(parts[0]))) { return nil, errors.Errorf("unsupported format for label %s", l) } val, err := strconv.Unquote(parts[1]) if err != nil { return nil, errors.Wrap(err, "unquote label value") } lset = append(lset, labels.Label{Name: parts[0], Value: val}) } return lset, nil } func labelsTSDBToProm(lset labels.Labels) (res labels.Labels) { for _, l := range lset { res = append(res, labels.Label{ Name: l.Name, Value: l.Value, }) } return res } func removeDuplicateQueryEndpoints(logger log.Logger, duplicatedQueriers prometheus.Counter, urls []*url.URL) []*url.URL
func queryFuncCreator( logger log.Logger, queriers []*http_util.Client, duplicatedQuery prometheus.Counter, ruleEvalWarnings *prometheus.CounterVec, ) func(partialResponseStrategy storepb.PartialResponseStrategy) rules.QueryFunc { // queryFunc returns query function that hits the HTTP query API of query peers in randomized order until we get a result // back or the context get canceled. return func(partialResponseStrategy storepb.PartialResponseStrategy) rules.QueryFunc { var spanID string switch partialResponseStrategy { case storepb.PartialResponseStrategy_WARN: spanID = "/rule_instant_query HTTP[client]" case storepb.PartialResponseStrategy_ABORT: spanID = "/rule_instant_query_part_resp_abort HTTP[client]" default: // Programming error will be caught by tests. panic(errors.Errorf("unknown partial response strategy %v", partialResponseStrategy).Error()) } promClients := make([]*promclient.Client, 0, len(queriers)) for _, q := range queriers { promClients = append(promClients, promclient.NewClient(q, logger, "thanos-rule")) } return func(ctx context.Context, q string, t time.Time) (promql.Vector, error) { for _, i := range rand.Perm(len(queriers)) { promClient := promClients[i] endpoints := removeDuplicateQueryEndpoints(logger, duplicatedQuery, queriers[i].Endpoints()) for _, i := range rand.Perm(len(endpoints)) { span, ctx := tracing.StartSpan(ctx, spanID) v, warns, err := promClient.PromqlQueryInstant(ctx, endpoints[i], q, t, promclient.QueryOptions{ Deduplicate: true, PartialResponseStrategy: partialResponseStrategy, }) span.Finish() if err != nil { level.Error(logger).Log("err", err, "query", q) continue } if len(warns) > 0 { ruleEvalWarnings.WithLabelValues(strings.ToLower(partialResponseStrategy.String())).Inc() // TODO(bwplotka): Propagate those to UI, probably requires changing rule manager code ): level.Warn(logger).Log("warnings", strings.Join(warns, ", "), "query", q) } return v, nil } } return nil, errors.Errorf("no query API server reachable") } } } func addDiscoveryGroups(g *run.Group, c *http_util.Client, interval time.Duration) { ctx, cancel := context.WithCancel(context.Background()) g.Add(func() error { c.Discover(ctx) return nil }, func(error) { cancel() }) g.Add(func() error { return runutil.Repeat(interval, ctx.Done(), func() error { return c.Resolve(ctx) }) }, func(error) { cancel() }) } func reloadRules(logger log.Logger, ruleFiles []string, ruleMgr *thanosrules.Manager, evalInterval time.Duration, metrics *RuleMetrics) error { level.Debug(logger).Log("msg", "configured rule files", "files", strings.Join(ruleFiles, ",")) var ( errs tsdberrors.MultiError files []string seenFiles = make(map[string]struct{}) ) for _, pat := range ruleFiles { fs, err := filepath.Glob(pat) if err != nil { // The only error can be a bad pattern. errs.Add(errors.Wrapf(err, "retrieving rule files failed. Ignoring file. pattern %s", pat)) continue } for _, fp := range fs { if _, ok := seenFiles[fp]; ok { continue } files = append(files, fp) seenFiles[fp] = struct{}{} } } level.Info(logger).Log("msg", "reload rule files", "numFiles", len(files)) if err := ruleMgr.Update(evalInterval, files); err != nil { metrics.configSuccess.Set(0) errs.Add(errors.Wrap(err, "reloading rules failed")) return errs.Err() } metrics.configSuccess.Set(1) metrics.configSuccessTime.Set(float64(time.Now().UnixNano()) / 1e9) metrics.rulesLoaded.Reset() for _, group := range ruleMgr.RuleGroups() { metrics.rulesLoaded.WithLabelValues(group.PartialResponseStrategy.String(), group.OriginalFile, group.Name()).Set(float64(len(group.Rules()))) } return errs.Err() }
{ set := make(map[string]struct{}) deduplicated := make([]*url.URL, 0, len(urls)) for _, u := range urls { if _, ok := set[u.String()]; ok { level.Warn(logger).Log("msg", "duplicate query address is provided - %v", u.String()) duplicatedQueriers.Inc() continue } deduplicated = append(deduplicated, u) set[u.String()] = struct{}{} } return deduplicated }
expected.tsx
///<reference types="svelte" /> <></>;function render() { let a = document.querySelector('#id') as HTMLInputElement; ; () => (<></>); return { props: {}, slots: {}, getters: {}, events: {} }} export default class
extends createSvelte2TsxComponent(__sveltets_partial_ts(__sveltets_with_any_event(render))) { }
Input__SvelteComponent_
day_3.rs
use std::collections::HashMap; use util::cardinal::Cardinal; pub fn main() { println!("-- Running Day 3 --"); let input = 347991u32; let (x, y) = determine_coords(input as f32); let taxicab_distance = (0 - x).abs() + (0 - y).abs(); println!("Taxicab distance is {}", taxicab_distance); println!("Spiral Larger is {}", larger_than_input_spiral(input)); } fn determine_coords(position: f32) -> (i32, i32) { let n = position as f32; let k = ((n.sqrt() - 1f32) / 2f32).ceil(); let t = (2f32 * k) + 1f32; let mut m = t.powi(2); let t = t - 1f32; if n > (m - t) { return ((k - (m - n)).ceil() as i32, (-k).ceil() as i32); } else { m = m - t; } if n > (m - t) { return ((-k).ceil() as i32, (-k + (m - n)).ceil() as i32); } else { m = m - t; } if n > (m - t) { return ((-k + (m - n)).ceil() as i32, k.ceil() as i32); } else { return (k.ceil() as i32, (k - (m - n - t)).ceil() as i32); } } fn
(input: u32) -> u32 { //Prime the "map" let mut map: HashMap<(i32, i32), u32> = HashMap::new(); map.insert((0i32, 0i32), 1u32); //Prime the "pointer" let mut location = (0i32, 0i32); let mut direction = Cardinal::East; while *map.get(&location).unwrap() <= input { //Move let offset = direction.calc_offset(); location = (location.0 + offset.0, location.1 + offset.1); //Calculate Local Sum let local_sum = calc_local_sum(&map, location); map.insert(location, local_sum); //Figure out next direction to move direction = calc_next_direction(&map, location, direction); } *map.get(&location).unwrap() } fn calc_local_sum(map: &HashMap<(i32, i32), u32>, location: (i32, i32)) -> u32 { let mut sum = 0u32; for x_offset in -1i32..2i32 { //In the future will probably be able to utilize the inclusive range syntax (ex: ..= or ...) when language feature becomes stable. for y_offset in -1i32..2i32 { let offset_location = (location.0 + x_offset, location.1 + y_offset); if let Some(n) = map.get(&offset_location) { sum = sum + n; } } } sum } fn calc_next_direction(map: &HashMap<(i32, i32), u32>, location: (i32, i32), direction: Cardinal) -> Cardinal { let my_left = direction.turn_left(); let offset = my_left.calc_offset(); let left_location = (location.0 + offset.0, location.1 + offset.1); match map.get(&left_location) { Some(_) => direction, None => my_left } }
larger_than_input_spiral
scrape_nominate_movie.py
import re import sys import json import requests from bs4 import BeautifulSoup def scrape_nominate_movie(year): film_index = "https://eiga.com/movie/" re_time = re.compile(r"/\d*分/") re_production_studio = re.compile(r"配給:[^<]*") re_title = re.compile(r"映画「[^」]*」") re_date = re.compile(r"\d*年\d*月\d*日") year_film_data = [] # title aligns with eiga.com best_prize_title = [ '万引き家族', '三度目の殺人', 'シン・ゴジラ', '海街diary', '永遠の0', '舟を編む', '桐島、部活やめるってよ', '八日目の蟬', '告白', '沈まぬ太陽', 'おくりびと', '東京タワー オカンとボクと、時々、オトン', 'フラガール', 'ALWAYS 三丁目の夕日', '半落ち', '壬生義士伝', 'たそがれ清兵衛', '千と千尋の神隠し', '雨あがる', '鉄道員(ぽっぽや)', '愛を乞うひと', 'もののけ姫', 'Shall we ダンス?', '午後の遺言状', '忠臣蔵外伝 四谷怪談', '学校', 'シコふんじゃった。', '息子', '少年時代', '黒い雨', '敦煌', 'マルサの女', '火宅の人', '花いちもんめ', 'お葬式', '楢山節考', '蒲田行進曲', '駅 STATION', 'ツィゴイネルワイゼン', '復讐するは我にあり', '事件', '幸福の黄色いハンカチ', ] with open("nominate_id/" + str(year) + ".txt", "r") as f: for line in f.readlines(): film_id = line.strip() film_data = {} film_data["director"] = [] film_data["scriptwriter"] = [] film_data["performers"] = [] film_data["screen_time"] = -1 film_data["production_studio"] = "" film_data["title"] = "" film_data["year"] = year if len(year_film_data) == 0 and year != 2020: film_data["prize"] = 1 else: film_data["prize"] = 0 # fetch top-1 movie result information content = requests.get(film_index + film_id).content soup = BeautifulSoup(content, features="lxml") # filter out screen time and production studio html_text = soup.prettify() production_studio = re_production_studio.search(html_text) screen_time = re_time.search(html_text) title = re_title.search(html_text) date = re_date.search(html_text) if production_studio: film_data["production_studio"] = ( production_studio.group(0)[3:].strip()) if screen_time: film_data["screen_time"] = int(screen_time.group(0)[1:-2]) if title: film_data["title"] = title.group(0)[3:-1] if film_data["title"] in best_prize_title: film_data["prize"] = 1 else: print(film_id) if date: date_str = date.group(0) film_data["year"] = date_str[0:date_str.find("年")] film_data["month"] = ( date_str[date_str.find("年") + 1:date_str.find("月")]) film_data["day"] = ( date_str[date_str.find("月") + 1:date_str.find("日")]) # filter out informative data staff_cast = soup.find(id="staff-cast") if staff_cast is not None: for div in staff_cast.find_all(): # When calling div["class"], return type is list[string] if div.name == "dl" and div.has_attr("class") and div["class"][0] == "movie-staff": # movie staff column data_type = "" for p in div.find_all(): if p.name == "dt": if p.get_text().find("監督") != -1: data_type = "director" elif p.get_text().find("脚本") != -1: data_type = "scriptwriter" else: data_type = "" # new meta data type can be added here elif p.name == "dd" and len(data_type) > 0: film_data[data_type].append(p.get_text().strip()) elif div.name == "ul" and div.has_attr("class") and div["class"][0] == "movie-cast": # movie cast column for p in div.find_all(): if p.name == "span": film_data["performers"].append(p.get_text().strip())
return year_film_data def main(): start_year = 1978 end_year = 2020 years_dict = {} unique_id = 10 for i in range(start_year, end_year + 1): years_dict[i] = scrape_nominate_movie(i) for j in range(len(years_dict[i])): years_dict[i][j]["id"] = unique_id unique_id += 1 with open("nominate_movie_meta_data.json", "w") as f: f.write(json.dumps(years_dict, ensure_ascii=False)) f.write("\n") if __name__ == "__main__": main()
# print(film_data) year_film_data.append(film_data) sys.stdout.flush()
framed_impl.rs
use crate::client::ReadBuf; use crate::{AsyncRead, AsyncWrite}; use bytes::{Buf, BufMut, BytesMut}; use core::borrow::{Borrow, BorrowMut}; use core::mem::MaybeUninit; use core::pin::Pin; use core::task::{Context, Poll}; use futures::stream::FusedStream; use futures::{Sink, Stream}; use log::debug; use nrq_engine::{RQError, RQResult}; use tracing::trace; use super::decoder::Decoder; use super::encoder::Encoder; use futures::ready; use pin_project_lite::pin_project; pin_project! { #[derive(Debug)] pub struct FramedImpl<T,U,State> { #[pin] pub inner:T, pub state:State, pub codec:U, } } const INITIAL_CAPACITY: usize = 8 * 1024; const BACKPRESSURE_BOUNDARY: usize = INITIAL_CAPACITY; #[derive(Debug)] pub struct ReadFrame { pub eof: bool, pub is_readable: bool, pub buffer: BytesMut, pub has_errored: bool, } pub struct WriteFrame { pub buffer: BytesMut, } #[derive(Default)] pub struct RWFrames { pub read: ReadFrame, pub write: WriteFrame, } impl Default for ReadFrame { fn default() -> Self { Self { eof: false, is_readable: false, buffer: BytesMut::with_capacity(INITIAL_CAPACITY), has_errored: false, } } } impl Default for WriteFrame { fn default() -> Self { Self { buffer: BytesMut::with_capacity(INITIAL_CAPACITY), } } } impl From<BytesMut> for ReadFrame { fn from(mut buffer: BytesMut) -> Self { let size = buffer.capacity(); if size < INITIAL_CAPACITY { buffer.reserve(INITIAL_CAPACITY - size); } Self { buffer, is_readable: size > 0, eof: false, has_errored: false, } } } impl From<BytesMut> for WriteFrame { fn from(mut buffer: BytesMut) -> Self { let size = buffer.capacity(); if size < INITIAL_CAPACITY { buffer.reserve(INITIAL_CAPACITY - size); } Self { buffer } } } impl Borrow<ReadFrame> for RWFrames { fn borrow(&self) -> &ReadFrame { &self.read } } impl BorrowMut<ReadFrame> for RWFrames { fn borrow_mut(&mut self) -> &mut ReadFrame { &mut self.read } } impl Borrow<WriteFrame> for RWFrames { fn borrow(&self) -> &WriteFrame { &self.write } } impl BorrowMut<WriteFrame> for RWFrames { fn borrow_mut(&mut self) -> &mut WriteFrame { &mut self.write } } impl<T, U, R> Stream for FramedImpl<T, U, R> where T: AsyncRead, U: Decoder, R: BorrowMut<ReadFrame>, { type Item = Result<U::Item, U::Error>; fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> { let mut pinned = self.project(); let state: &mut ReadFrame = pinned.state.borrow_mut(); loop { if state.has_errored { // preparing has_errored -> paused // tracing::trace!("Returning None and setting paused"); log::debug!("Returning None and setting paused"); state.is_readable = false; state.has_errored = false; return Poll::Ready(None); } if state.is_readable { // pausing or framing if state.eof { // pausing let frame = pinned.codec.decode_eof(&mut state.buffer).map_err(|err| { debug!("Got an error, going to errored state"); state.has_errored = true; err })?; if frame.is_none() { state.is_readable = false; // prepare pausing -> paused } // implicit pausing -> pausing or pausing -> paused return Poll::Ready(frame.map(Ok)); } // framing debug!("attempting to decode a frame"); if let Some(frame) = pinned.codec.decode(&mut state.buffer).map_err(|op| { debug!("Got an error, going to errored state"); state.has_errored = true; op })? { debug!("frame decoded from buffer"); // implicit framing -> framing return Poll::Ready(Some(Ok(frame))); } // framing -> reading state.is_readable = false; } // reading or paused // If we can't build a frame yet, try to read more data and try again. // Make sure we've got room for at least one byte to read to ensure // that we don't get a spurious 0 that looks like EOF. state.buffer.reserve(1); let bytect = match poll_read_buf(pinned.inner.as_mut(), cx, &mut state.buffer).map_err( |err| { debug!("Got an error, going to errored state"); state.has_errored = true; err }, )? { Poll::Ready(ct) => ct, // implicit reading -> reading or implicit paused -> paused Poll::Pending => return Poll::Pending, }; if bytect == 0 { if state.eof { // We're already at an EOF, and since we've reached this path // we're also not readable. This implies that we've already finished // our `decode_eof` handling, so we can simply return `None`. // implicit paused -> paused return Poll::Ready(None); } // prepare reading -> paused state.eof = true; } else { // prepare paused -> framing or noop reading -> framing state.eof = false; } // paused -> framing or reading -> framing or reading -> pausing state.is_readable = true; } } } impl<T, U, R> FusedStream for FramedImpl<T, U, R> where T: AsyncRead, U: Decoder, R: BorrowMut<ReadFrame>, { fn is_terminated(&self) -> bool { // let state: &ReadFrame = self.state.borrow(); // state.eof || !state.is_readable false } } impl<T, I, U, W> Sink<I> for FramedImpl<T, U, W> where T: AsyncWrite, U: Encoder<I>, W: BorrowMut<WriteFrame>, { type Error = U::Error; fn poll_ready(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { if self.state.borrow().buffer.len() >= BACKPRESSURE_BOUNDARY
else { Poll::Ready(Ok(())) } } fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error> { let pinned = self.project(); pinned .codec .encode(item, &mut pinned.state.borrow_mut().buffer)?; Ok(()) } fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { // use crate::util::poll_write_buf; // tracing::trace!("flushing framed transport"); log::debug!("flushing framed transport"); let mut pinned = self.project(); while !pinned.state.borrow_mut().buffer.is_empty() { let WriteFrame { buffer } = pinned.state.borrow_mut(); // tracing::trace!("writing; remaining={}", buffer.len()); log::debug!("writing; remaining={}", buffer.len()); let n = ready!(poll_write_buf(pinned.inner.as_mut(), cx, buffer))?; if n == 0 { // return Poll::Ready(Err(io::Error::new( // io::ErrorKind::WriteZero, // "failed to \ // write frame to transport", // ) // .into())); return Poll::Ready(Err(RQError::IO( "failed to \ write frame to transport" .into(), ) .into())); } } // // Try flushing the underlying IO ready!(pinned.inner.poll_flush(cx)).map_err(|e| RQError::IO(alloc::format!("{:?}", e)))?; // tracing::trace!("framed transport flushed"); log::debug!("framed transport flushed"); Poll::Ready(Ok(())) } fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { ready!(self.as_mut().poll_flush(cx))?; // TODO: 暂时写不出来bounds,先直接转换 // ready!(self.project().inner.poll_shutdown(cx))?; ready!(self.project().inner.poll_shutdown(cx)) .map_err(|e| RQError::IO(alloc::format!("{:?}", e).into()))?; Poll::Ready(Ok(())) } } pub fn poll_write_buf<T: AsyncWrite, B: Buf>( io: Pin<&mut T>, cx: &mut Context<'_>, buf: &mut B, ) -> Poll<RQResult<usize>> { if !buf.has_remaining() { return Poll::Ready(Ok(0)); } let n = ready!(io.poll_write(cx, buf.chunk())) .map_err(|e| RQError::IO(alloc::format!("{:?}", e)))?; buf.advance(n); Poll::Ready(Ok(n)) } pub fn poll_read_buf<T: AsyncRead, B: BufMut>( io: Pin<&mut T>, cx: &mut Context<'_>, buf: &mut B, ) -> Poll<RQResult<usize>> { if !buf.has_remaining_mut() { return Poll::Ready(Ok(0)); } let n = { let dst = buf.chunk_mut(); let dst = unsafe { &mut *(dst as *mut _ as *mut [MaybeUninit<u8>]) }; let mut buf = ReadBuf::uninit(dst); let ptr = buf.filled().as_ptr(); log::debug!("call poll_read"); ready!(io.poll_read(cx, &mut buf)).map_err(|e| RQError::IO(alloc::format!("{:?}", e)))?; log::debug!("poll_read success"); // Ensure the pointer does not change from under us assert_eq!(ptr, buf.filled().as_ptr()); log::debug!("assert success"); buf.filled().len() }; // Safety: This is guaranteed to be the number of initialized (and read) // bytes due to the invariants provided by `ReadBuf::filled`. log::debug!("advance_mut"); unsafe { buf.advance_mut(n); } log::debug!("poll_read_buf() done"); Poll::Ready(Ok(n)) }
{ self.as_mut().poll_flush(cx) }
multi_objective.py
#! /usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Multi-objective optimization benchmark problems. References .. [Deb2005dtlz] K. Deb, L. Thiele, M. Laumanns, E. Zitzler, A. Abraham, L. Jain, R. Goldberg. "Scalable test problems for evolutionary multi-objective optimization" in Evolutionary Multiobjective Optimization, London, U.K.: Springer-Verlag, pp. 105-145, 2005. .. [GarridoMerchan2020] E. C. Garrido-Merch ́an and D. Hern ́andez-Lobato. Parallel Predictive Entropy Search for Multi-objective Bayesian Optimization with Constraints. arXiv e-prints, arXiv:2004.00601, Apr. 2020. .. [Gelbart2014] Michael A. Gelbart, Jasper Snoek, and Ryan P. Adams. 2014. Bayesian optimization with unknown constraints. In Proceedings of the Thirtieth Conference on Uncertainty in Artificial Intelligence (UAI’14). AUAI Press, Arlington, Virginia, USA, 250–259. .. [Oszycka1995] A. Osyczka, S. Kundu. 1995. A new method to solve generalized multicriteria optimization problems using the simple genetic algorithm. In Structural Optimization 10. 94–99. .. [Tanabe2020] Ryoji Tanabe, Hisao Ishibuchi, An easy-to-use real-world multi-objective optimization problem suite, Applied Soft Computing,Volume 89, 2020. .. [Yang2019a] K. Yang, M. Emmerich, A. Deutz, and T. Bäck. 2019. "Multi-Objective Bayesian Global Optimization using expected hypervolume improvement gradient" in Swarm and evolutionary computation 44, pp. 945--956, 2019. .. [Zitzler2000] E. Zitzler, K. Deb, and L. Thiele, “Comparison of multiobjective evolutionary algorithms: Empirical results,” Evol. Comput., vol. 8, no. 2, pp. 173–195, 2000. """ from __future__ import annotations import math from typing import Optional import torch from botorch.test_functions.base import ( ConstrainedBaseTestProblem, MultiObjectiveTestProblem, ) from botorch.test_functions.synthetic import Branin from botorch.utils.sampling import sample_hypersphere, sample_simplex from botorch.utils.transforms import unnormalize from scipy.special import gamma from torch import Tensor class BraninCurrin(MultiObjectiveTestProblem): r"""Two objective problem composed of the Branin and Currin functions. Branin (rescaled): f(x) = ( 15*x_1 - 5.1 * (15 * x_0 - 5) ** 2 / (4 * pi ** 2) + 5 * (15 * x_0 - 5) / pi - 5 ) ** 2 + (10 - 10 / (8 * pi)) * cos(15 * x_0 - 5)) Currin: f(x) = (1 - exp(-1 / (2 * x_1))) * ( 2300 * x_0 ** 3 + 1900 * x_0 ** 2 + 2092 * x_0 + 60 ) / 100 * x_0 ** 3 + 500 * x_0 ** 2 + 4 * x_0 + 20 """ dim = 2 num_objectives = 2 _bounds = [(0.0, 1.0), (0.0, 1.0)] _ref_point = [18.0, 6.0] _max_hv = 59.36011874867746 # this is approximated using NSGA-II def __init__(self, noise_std: Optional[float] = None, negate: bool = False) -> None: r"""Constructor for Branin-Currin. Args: noise_std: Standard deviation of the observation noise. negate: If True, negate the objectives. """ super().__init__(noise_std=noise_std, negate=negate) self._branin = Branin() def _rescaled_branin(self, X: Tensor) -> Tensor: # return to Branin bounds x_0 = 15 * X[..., 0] - 5 x_1 = 15 * X[..., 1] return self._branin(torch.stack([x_0, x_1], dim=-1)) @staticmethod def _currin(X: Tensor) -> Tensor: x_0 = X[..., 0] x_1 = X[..., 1] factor1 = 1 - torch.exp(-1 / (2 * x_1)) numer = 2300 * x_0.pow(3) + 1900 * x_0.pow(2) + 2092 * x_0 + 60 denom = 100 * x_0.pow(3) + 500 * x_0.pow(2) + 4 * x_0 + 20 return factor1 * numer / denom def evaluate_true(self, X: Tensor) -> Tensor: # branin rescaled with inputsto [0,1]^2 branin = self._rescaled_branin(X=X) currin = self._currin(X=X) return torch.stack([branin, currin], dim=-1) class DTLZ(MultiObjectiveTestProblem): r"""Base class for DTLZ problems. See [Deb2005dtlz]_ for more details on DTLZ. """ def __init__( self, dim: int, num_objectives: int = 2, noise_std: Optional[float] = None, negate: bool = False, ) -> None: if dim <= num_objectives: raise ValueError( f"dim must be > num_objectives, but got {dim} and {num_objectives}" ) self.num_objectives = num_objectives self.dim = dim self.k = self.dim - self.num_objectives + 1 self._bounds = [(0.0, 1.0) for _ in range(self.dim)] self._ref_point = [self._ref_val for _ in range(num_objectives)] super().__init__(noise_std=noise_std, negate=negate) class DTLZ1(DTLZ): r"""DLTZ1 test problem. d-dimensional problem evaluated on `[0, 1]^d`: f_0(x) = 0.5 * x_0 * (1 + g(x)) f_1(x) = 0.5 * (1 - x_0) * (1 + g(x)) g(x) = 100 * \sum_{i=m}^{n-1} ( k + (x_i - 0.5)^2 - cos(20 * pi * (x_i - 0.5)) ) where k = n - m + 1. The pareto front is given by the line (or hyperplane) \sum_i f_i(x) = 0.5. The goal is to minimize both objectives. The reference point comes from [Yang2019]_. """ _ref_val = 400.0 @property def _max_hv(self) -> float: return self._ref_val ** self.num_objectives - 1 / 2 ** self.num_objectives def evaluate_true(self, X: Tensor) -> Tensor: X_m = X[..., -self.k :] X_m_minus_half = X_m - 0.5 sum_term = ( X_m_minus_half.pow(2) - torch.cos(20 * math.pi * X_m_minus_half) ).sum(dim=-1) g_X_m = 100 * (self.k + sum_term) g_X_m_term = 0.5 * (1 + g_X_m) fs = [] for i in range(self.num_objectives): idx = self.num_objectives - 1 - i f_i = g_X_m_term * X[..., :idx].prod(dim=-1) if i > 0: f_i *= 1 - X[..., idx] fs.append(f_i) return torch.stack(fs, dim=-1) def gen_pareto_front(self, n: int) -> Tensor: r"""Generate `n` pareto optimal points. The pareto points randomly sampled from the hyperplane sum_i f(x_i) = 0.5. """ f_X = 0.5 * sample_simplex( n=n, d=self.num_objectives, qmc=True, dtype=self.ref_point.dtype, device=self.ref_point.device, ) if self.negate: f_X *= -1 return f_X class DTLZ2(DTLZ): r"""DLTZ2 test problem. d-dimensional problem evaluated on `[0, 1]^d`: f_0(x) = (1 + g(x)) * cos(x_0 * pi / 2) f_1(x) = (1 + g(x)) * sin(x_0 * pi / 2) g(x) = \sum_{i=m}^{n-1} (x_i - 0.5)^2 The pareto front is given by the unit hypersphere \sum{i} f_i^2 = 1. Note: the pareto front is completely concave. The goal is to minimize both objectives. """ _ref_val = 1.1 @property def _max_hv(self) -> float: # hypercube - volume of hypersphere in R^n such that all coordinates are # positive hypercube_vol = self._ref_val ** self.num_objectives pos_hypersphere_vol = ( math.pi ** (self.num_objectives / 2) / gamma(self.num_objectives / 2 + 1) / 2 ** self.num_objectives ) return hypercube_vol - pos_hypersphere_vol def evaluate_true(self, X: Tensor) -> Tensor: X_m = X[..., -self.k :] g_X = (X_m - 0.5).pow(2).sum(dim=-1) g_X_plus1 = 1 + g_X fs = [] pi_over_2 = math.pi / 2 for i in range(self.num_objectives): idx = self.num_objectives - 1 - i f_i = g_X_plus1.clone() f_i *= torch.cos(X[..., :idx] * pi_over_2).prod(dim=-1) if i > 0: f_i *= torch.sin(X[..., idx] * pi_over_2) fs.append(f_i) return torch.stack(fs, dim=-1) def gen_pareto_front(self, n: int) -> Tensor: r"""Generate `n` pareto optimal points. The pareto points are randomly sampled from the hypersphere's positive section. """ f_X = sample_hypersphere( n=n, d=self.num_objectives, dtype=self.ref_point.dtype, device=self.ref_point.device, qmc=True, ).abs() if self.negate: f_X *= -1 return f_X class VehicleSafety(MultiObjectiveTestProblem): r"""Optimize Vehicle crash-worthiness. See [Tanabe2020]_ for details. The reference point is 1.1 * the nadir point from approximate front provided by [Tanabe2020]_. The maximum hypervolume is computed using the approximate pareto front from [Tanabe2020]_. """ _ref_point = [1864.72022, 11.81993945, 0.2903999384] _max_hv = 246.81607081187002 _bounds = [(1.0, 3.0)] * 5 dim = 5 num_objectives = 3 def evaluate_true(self, X: Tensor) -> Tensor: X1, X2, X3, X4, X5 = torch.split(X, 1, -1) f1 = ( 1640.2823 + 2.3573285 * X1 + 2.3220035 * X2 + 4.5688768 * X3 + 7.7213633 * X4 + 4.4559504 * X5 ) f2 = ( 6.5856 + 1.15 * X1 - 1.0427 * X2 + 0.9738 * X3 + 0.8364 * X4 - 0.3695 * X1 * X4 + 0.0861 * X1 * X5 + 0.3628 * X2 * X4 - 0.1106 * X1.pow(2) - 0.3437 * X3.pow(2) + 0.1764 * X4.pow(2) ) f3 = ( -0.0551 + 0.0181 * X1 + 0.1024 * X2 + 0.0421 * X3 - 0.0073 * X1 * X2 + 0.024 * X2 * X3 - 0.0118 * X2 * X4 - 0.0204 * X3 * X4 - 0.008 * X3 * X5 - 0.0241 * X2.pow(2) + 0.0109 * X4.pow(2) ) f_X = torch.cat([f1, f2, f3], dim=-1) return f_X class ZDT(MultiObjectiveTestProblem): r"""Base class for ZDT problems. See [Zitzler2000]_ for more details on ZDT. """ _ref_point = [11.0, 11.0] def __init__( self, dim: int, num_objectives: int = 2, noise_std: Optional[float] = None, negate: bool = False, ) -> None: if num_objectives != 2: raise NotImplementedError( f"{type(self).__name__} currently only supports 2 objectives." ) if dim < num_objectives: raise ValueError( f"dim must be >= num_objectives, but got {dim} and {num_objectives}" ) self.num_objectives = num_objectives self.dim = dim self._bounds = [(0.0, 1.0) for _ in range(self.dim)] super().__init__(noise_std=noise_std, negate=negate) @staticmethod def _g(X: Tensor) -> Tensor: return 1 + 9 * X[..., 1:].mean(dim=-1) class ZDT1(ZDT): r"""ZDT1 test problem. d-dimensional problem evaluated on `[0, 1]^d`: f_0(x) = x_0 f_1(x) = g(x) * (1 - sqrt(x_0 / g(x)) g(x) = 1 + 9 / (d - 1) * \sum_{i=1}^{d-1} x_i The reference point comes from [Yang2019a]_. The pareto front is convex. """ _max_hv = 120 + 2 / 3 def evaluate_true(self, X: Tensor) -> Tensor: f_0 = X[..., 0] g = self._g(X=X) f_1 = g * (1 - (f_0 / g).sqrt()) return torch.stack([f_0, f_1], dim=-1) def gen_pareto_front(self, n: int) -> Tensor: f_0 = torch.linspace( 0, 1, n, dtype=self.bounds.dtype, device=self.bounds.device ) f_1 = 1 - f_0.sqrt() f_X = torch.stack([f_0, f_1], dim=-1) if self.negate: f_X *= -1 return f_X class ZDT2(ZDT): r"""ZDT2 test problem. d-dimensional problem evaluated on `[0, 1]^d`: f_0(x) = x_0 f_1(x) = g(x) * (1 - (x_0 / g(x))^2) g(x) = 1 + 9 / (d - 1) * \sum_{i=1}^{d-1} x_i The reference point comes from [Yang2019a]_. The pareto front is concave. """ _max_hv = 120 + 1 / 3 def evaluate_true(self, X: Tensor) -> Tensor: f_0 = X[..., 0] g = self._g(X=X) f_1 = g * (1 - (f_0 / g).pow(2)) return torch.stack([f_0, f_1], dim=-1) def gen_pareto_front(self, n: int) -> Tensor: f_0 = torch.linspace( 0, 1, n, dtype=self.bounds.dtype, device=self.bounds.device ) f_1 = 1 - f_0.pow(2) f_X = torch.stack([f_0, f_1], dim=-1) if self.negate: f_X *= -1 return f_X class ZDT3(ZDT): r"""ZDT3 test problem. d-dimensional problem evaluated on `[0, 1]^d`: f_0(x) = x_0 f_1(x) = 1 - sqrt(x_0 / g(x)) - x_0 / g * sin(10 * pi * x_0) g(x) = 1 + 9 / (d - 1) * \sum_{i=1}^{d-1} x_i The reference point comes from [Yang2019a]_. The pareto front consists of several discontinuous convex parts. """ _max_hv = 128.77811613069076060 _parts = [ # this interval includes both end points [0, 0.0830015349], # this interval includes only the right end points [0.1822287280, 0.2577623634], [0.4093136748, 0.4538821041], [0.6183967944, 0.6525117038], [0.8233317983, 0.8518328654], ] # nugget to make sure linspace returns elements within the specified range _eps = 1e-6 def evaluate_true(self, X: Tensor) -> Tensor: f_0 = X[..., 0] g = self._g(X=X) f_1 = 1 - (f_0 / g).sqrt() - f_0 / g * torch.sin(10 * math.pi * f_0) return torch.stack([f_0, f_1], dim=-1) def gen_pareto_front(self, n: int) -> Tensor: n_parts = len(self._parts) n_per_part = torch.full( torch.Size([n_parts]), n // n_parts, dtype=torch.long, device=self.bounds.device, ) left_over = n % n_parts n_per_part[:left_over] += 1 f_0s = [] for i, p in enumerate(self._parts): left, right = p f_0s.append( torch.linspace( left + self._eps, right - self._eps, n_per_part[i], dtype=self.bounds.dtype, device=self.bounds.device, ) ) f_0 = torch.cat(f_0s, dim=0) f_1 = 1 - f_0.sqrt() - f_0 * torch.sin(10 * math.pi * f_0) f_X = torch.stack([f_0, f_1], dim=-1) if self.negate: f_X *= -1 return f_X # ------ Constrained Multi-Objective Test Problems ----- # class BNH(MultiObjectiveTestProblem, ConstrainedBaseTestProblem): r"""The constrained BNH problem. See [GarridoMerchan2020]_ for more details on this problem. Note that this is a minimization problem. """ dim = 2 num_objectives = 2 num_constraints = 2 _bounds = [(0.0, 5.0), (0.0, 3.0)] _ref_point = [0.0, 0.0] # TODO: Determine proper reference point def evaluate_true(self, X: Tensor) -> Tensor: return torch.stack( [4.0 * (X ** 2).sum(dim=-1), ((X - 5.0) ** 2).sum(dim=-1)], dim=-1 ) def evaluate_slack_true(self, X: Tensor) -> Tensor: c1 = 25.0 - (X[..., 0] - 5.0) ** 2 - X[..., 1] ** 2 c2 = (X[..., 0] - 8.0) ** 2 + (X[..., 1] + 3.0) ** 2 - 7.7 return torch.stack([c1, c2], dim=-1) class SRN(MultiObjectiveTestProblem, ConstrainedBaseTestProblem): r"""The constrained SRN problem. See [GarridoMerchan2020]_ for more details on this problem. Note that this is a minimization problem. """ dim = 2 num_objectives = 2 num_constraints = 2 _bounds = [(-20.0, 20.0), (-20.0, 20.0)] _ref_point = [0.0, 0.0] # TODO: Determine proper reference point def evaluate_true(self, X: Tensor) -> Tensor: obj1 = 2.0 + ((X - 2.0) ** 2).sum(dim=-1) obj2 = 9.0 * X[..., 0] - (X[..., 1] - 1.0) ** 2 return torch.stack([obj1, obj2], dim=-1) def evaluate_slack_true(self, X: Tensor) -> Tensor: c1 = 225.0 - ((X ** 2) ** 2).sum(dim=-1) c2 = -10.0 - X[..., 0] + 3 * X[..., 1] return torch.stack([c1, c2], dim=-1) class CONSTR(MultiObjectiveTestProblem, ConstrainedBaseTestProblem): r"""The constrained CONSTR problem. See [GarridoMerchan2020]_ for more details on this problem. Note that this is a minimization problem. """ dim = 2 num_objectives = 2 num_constraints = 2 _bounds = [(0.1, 10.0), (0.0, 5.0)] _ref_point = [10.0, 10.0] def evaluate_true(self, X: Tensor) -> Tensor: obj1 = X[..., 0] obj2 = (1.0 + X[..., 1]) / X[..., 0] return torch.stack([obj1, obj2], dim=-1) def evaluate_slack_true(self, X: Tensor) -> Tensor: c1 = 9.0 * X[..., 0] + X[..., 1] - 6.0 c2 = 9.0 * X[..., 0] - X[..., 1] - 1.0 return torch.stack([c1, c2], dim=-1) class ConstrainedBraninCurrin(BraninCurrin, ConstrainedBaseTestProblem): r"""Constrained
2(DTLZ2, ConstrainedBaseTestProblem): num_constraints = 1 _r = 0.2 # approximate from nsga-ii, TODO: replace with analytic _max_hv = 0.3996406303723544 def evaluate_slack_true(self, X: Tensor) -> Tensor: if X.ndim > 2: raise NotImplementedError("Batch X is not supported.") f_X = self.evaluate_true(X) term1 = (f_X - 1).pow(2) mask = ~(torch.eye(f_X.shape[-1], device=f_X.device).bool()) indices = torch.arange(f_X.shape[1], device=f_X.device).repeat(f_X.shape[1], 1) indexer = indices[mask].view(f_X.shape[1], f_X.shape[-1] - 1) term2_inner = ( f_X.unsqueeze(1) .expand(f_X.shape[0], f_X.shape[-1], f_X.shape[-1]) .gather(dim=-1, index=indexer.repeat(f_X.shape[0], 1, 1)) ) term2 = (term2_inner.pow(2) - self._r ** 2).sum(dim=-1) min1 = (term1 + term2).min(dim=-1).values min2 = ((f_X - 1 / math.sqrt(f_X.shape[-1])).pow(2) - self._r ** 2).sum(dim=-1) return -torch.min(min1, min2).unsqueeze(-1) class OSY(MultiObjectiveTestProblem, ConstrainedBaseTestProblem): r""" The OSY test problem from [Oszycka1995]_. Implementation from https://github.com/msu-coinlab/pymoo/blob/master/pymoo/problems/multi/osy.py Note that this implementation assumes minimization, so please choose negate=True. """ dim = 6 num_constraints = 6 num_objectives = 2 _bounds = [ (0.0, 10.0), (0.0, 10.0), (1.0, 5.0), (0.0, 6.0), (1.0, 5.0), (0.0, 10.0), ] _ref_point = [-75.0, 75.0] def evaluate_true(self, X: Tensor) -> Tensor: f1 = -( 25 * (X[..., 0] - 2) ** 2 + (X[..., 1] - 2) ** 2 + (X[..., 2] - 1) ** 2 + (X[..., 3] - 4) ** 2 + (X[..., 4] - 1) ** 2 ) f2 = (X ** 2).sum(-1) return torch.stack([f1, f2], dim=-1) def evaluate_slack_true(self, X: Tensor) -> Tensor: g1 = X[..., 0] + X[..., 1] - 2.0 g2 = 6.0 - X[..., 0] - X[..., 1] g3 = 2.0 - X[..., 1] + X[..., 0] g4 = 2.0 - X[..., 0] + 3.0 * X[..., 1] g5 = 4.0 - (X[..., 2] - 3.0) ** 2 - X[..., 3] g6 = (X[..., 4] - 3.0) ** 2 + X[..., 5] - 4.0 return torch.stack([g1, g2, g3, g4, g5, g6], dim=-1)
Branin Currin Function. This uses the disk constraint from [Gelbart2014]_. """ dim = 2 num_objectives = 2 num_constraints = 1 _bounds = [(0.0, 1.0), (0.0, 1.0)] _con_bounds = [(-5.0, 10.0), (0.0, 15.0)] _ref_point = [80.0, 12.0] _max_hv = 608.4004237022673 # from NSGA-II with 90k evaluations def __init__(self, noise_std: Optional[float] = None, negate: bool = False) -> None: super().__init__(noise_std=noise_std, negate=negate) con_bounds = torch.tensor(self._con_bounds, dtype=torch.float).transpose(-1, -2) self.register_buffer("con_bounds", con_bounds) def evaluate_slack_true(self, X: Tensor) -> Tensor: X_tf = unnormalize(X, self.con_bounds) return 50 - (X_tf[..., 0:1] - 2.5).pow(2) - (X_tf[..., 1:2] - 7.5).pow(2) class C2DTLZ
atomic-compare_exchange.rs
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(extended_compare_and_swap)] use std::sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT}; use std::sync::atomic::Ordering::*; static ATOMIC: AtomicIsize = ATOMIC_ISIZE_INIT; fn
() { // Make sure trans can emit all the intrinsics correctly ATOMIC.compare_exchange(0, 1, Relaxed, Relaxed); ATOMIC.compare_exchange(0, 1, Acquire, Relaxed); ATOMIC.compare_exchange(0, 1, Release, Relaxed); ATOMIC.compare_exchange(0, 1, AcqRel, Relaxed); ATOMIC.compare_exchange(0, 1, SeqCst, Relaxed); ATOMIC.compare_exchange(0, 1, Acquire, Acquire); ATOMIC.compare_exchange(0, 1, AcqRel, Acquire); ATOMIC.compare_exchange(0, 1, SeqCst, Acquire); ATOMIC.compare_exchange(0, 1, SeqCst, SeqCst); ATOMIC.compare_exchange_weak(0, 1, Relaxed, Relaxed); ATOMIC.compare_exchange_weak(0, 1, Acquire, Relaxed); ATOMIC.compare_exchange_weak(0, 1, Release, Relaxed); ATOMIC.compare_exchange_weak(0, 1, AcqRel, Relaxed); ATOMIC.compare_exchange_weak(0, 1, SeqCst, Relaxed); ATOMIC.compare_exchange_weak(0, 1, Acquire, Acquire); ATOMIC.compare_exchange_weak(0, 1, AcqRel, Acquire); ATOMIC.compare_exchange_weak(0, 1, SeqCst, Acquire); ATOMIC.compare_exchange_weak(0, 1, SeqCst, SeqCst); }
main
test_eos_acls.py
# # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible_collections.arista.eos.tests.unit.compat.mock import patch from ansible_collections.arista.eos.plugins.modules import eos_acls from ansible_collections.arista.eos.plugins.module_utils.network.eos.config.acls.acls import ( add_commands, ) from ansible_collections.arista.eos.tests.unit.modules.utils import ( set_module_args, ) from .eos_module import TestEosModule, load_fixture import itertools class TestEosAclsModule(TestEosModule): module = eos_acls def setUp(self): super(TestEosAclsModule, self).setUp() self.mock_get_config = patch( "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.network.Config.get_config" ) self.get_config = self.mock_get_config.start() self.mock_load_config = patch( "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.network.Config.load_config" ) self.load_config = self.mock_load_config.start() self.mock_get_resource_connection_config = patch( "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.cfg.base.get_resource_connection" ) self.get_resource_connection_config = ( self.mock_get_resource_connection_config.start() ) self.mock_get_resource_connection_facts = patch( "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.facts.facts.get_resource_connection" ) self.get_resource_connection_facts = ( self.mock_get_resource_connection_facts.start() ) self.mock_edit_config = patch( "ansible_collections.arista.eos.plugins.module_utils.network.eos.providers.providers.CliProvider.edit_config" ) self.edit_config = self.mock_edit_config.start() self.mock_execute_show_command = patch( "ansible_collections.arista.eos.plugins.module_utils.network.eos.facts.acls.acls.AclsFacts.get_device_data" ) self.execute_show_command = self.mock_execute_show_command.start() def tearDown(self): super(TestEosAclsModule, self).tearDown() self.mock_get_resource_connection_config.stop() self.mock_get_resource_connection_facts.stop() self.mock_edit_config.stop() self.mock_get_config.stop() self.mock_load_config.stop() self.mock_execute_show_command.stop() def load_fixtures(self, commands=None, transport="cli", filename=None): if filename is None: filename = "eos_acls_config.cfg" def load_from_file(*args, **kwargs): output = load_fixture(filename) return output self.execute_show_command.side_effect = load_from_file def test_eos_acls_merged(self): set_module_args( dict( config=[ dict( afi="ipv6", acls=[ dict( name="test2", standard="true", aces=[ dict( sequence="10", grant="permit", protocol="tcp", protocol_options=dict( tcp=dict( flags=dict(established="yes") ) ), source=dict( subnet_address="30.2.0.0/8" ), destination=dict(any="true"), log="true", ) ], ) ], ) ], state="merged", ) ) commands = [ "ipv6 access-list standard test2", "10 permit tcp 30.2.0.0/8 any established log", ] self.execute_module(changed=True, commands=commands) def test_eos_acls_merged_idempotent(self): set_module_args( dict( config=[ dict( afi="ipv4", acls=[ dict( name="test1", aces=[ dict( sequence="35", grant="deny", protocol="tcp", source=dict( subnet_address="20.0.0.0/8" ), destination=dict(any="true"), log="true", ), dict( grant="permit", source=dict(any="true"), destination=dict(any="true"), protocol=6, ), ], ) ], ) ], state="merged", ) ) self.execute_module(changed=False, commands=[]) def test_eos_acls_replaced(self): set_module_args( dict( config=[ dict( afi="ipv4", acls=[ dict( name="test1", aces=[ dict( sequence="10", grant="permit", protocol="ospf", source=dict( subnet_address="30.2.0.0/8" ), destination=dict(any="true"), log="true", ) ], ) ], ) ], state="replaced", ) ) commands = [ "ip access-list test1", "no 35", "no 45", "10 permit ospf 30.2.0.0/8 any log", ] self.execute_module(changed=True, commands=commands) def test_eos_acls_replaced_idempotent(self):
def test_eos_acls_overridden(self): set_module_args( dict( config=[ dict( afi="ipv4", acls=[ dict( name="test1", aces=[ dict( sequence="10", grant="permit", protocol="ospf", source=dict( subnet_address="30.2.0.0/8" ), destination=dict(any="true"), log="true", ) ], ) ], ) ], state="overridden", ) ) commands = [ "ip access-list test1", "no 35", "no 45", "10 permit ospf 30.2.0.0/8 any log", ] self.execute_module(changed=True, commands=commands) def test_eos_acls_overridden_idempotent(self): set_module_args( dict( config=[ dict( afi="ipv4", acls=[ dict( name="test1", aces=[ dict( sequence="35", grant="deny", protocol="tcp", source=dict( subnet_address="20.0.0.0/8" ), destination=dict(any="true"), log="true", ), dict( grant="permit", source=dict(any="true"), destination=dict(any="true"), sequence="45", protocol="tcp", ), ], ) ], ) ], state="overridden", ) ) self.execute_module(changed=False, commands=[]) def test_eos_acls_deletedacls(self): set_module_args( dict( config=[dict(afi="ipv4", acls=[dict(name="test1")])], state="deleted", ) ) commands = ["no ip access-list test1"] self.execute_module(changed=True, commands=commands) def test_eos_acls_deletedafis(self): set_module_args(dict(config=[dict(afi="ipv4")], state="deleted")) commands = ["no ip access-list test1"] self.execute_module(changed=True, commands=commands) def test_eos_acls_gathered(self): set_module_args(dict(config=[], state="gathered")) result = self.execute_module( changed=False, filename="eos_acls_config.cfg" ) commands = [] for gathered_cmds in result["gathered"]: cfg = add_commands(gathered_cmds) commands.append(cfg) commands = list(itertools.chain(*commands)) config_commands = [ "ip access-list test1", "35 deny tcp 20.0.0.0/8 any log", "45 permit tcp any any", ] self.assertEqual( sorted(config_commands), sorted(commands), result["gathered"] ) def test_eos_acls_rendered(self): set_module_args( dict( config=[ dict( afi="ipv4", acls=[ dict( name="test1", aces=[ dict( grant="permit", sequence="45", source=dict(any="true"), destination=dict(any="true"), protocol=6, ) ], ) ], ) ], state="rendered", ) ) commands = ["ip access-list test1", "45 permit tcp any any"] result = self.execute_module(changed=False) self.assertEqual( sorted(result["rendered"]), sorted(commands), result["rendered"] ) def test_eos_acls_parsed(self): set_module_args( dict( running_config="ipv6 access-list test2\n 10 permit icmpv6 host 10.2.33.1 any ttl eq 25", state="parsed", ) ) commands = [ "ipv6 access-list test2", "10 permit icmpv6 host 10.2.33.1 any ttl eq 25", ] result = self.execute_module(changed=False) parsed_commands = [] for cmds in result["parsed"]: cfg = add_commands(cmds) parsed_commands.append(cfg) parsed_commands = list(itertools.chain(*parsed_commands)) self.assertEqual( sorted(parsed_commands), sorted(commands), result["parsed"] )
set_module_args( dict( config=[ dict( afi="ipv4", acls=[ dict( name="test1", aces=[ dict( sequence="35", grant="deny", protocol="tcp", source=dict( subnet_address="20.0.0.0/8" ), destination=dict(any="true"), log="true", ), dict( grant="permit", source=dict(any="true"), destination=dict(any="true"), sequence="45", protocol="tcp", ), ], ) ], ) ], state="replaced", ) ) self.execute_module(changed=False, commands=[])
top_test.go
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package top import ( "bytes" "encoding/json" "io"
"time" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/cli-runtime/pkg/genericclioptions" cmdtesting "k8s.io/kubectl/pkg/cmd/testing" metricsv1beta1api "k8s.io/metrics/pkg/apis/metrics/v1beta1" ) func TestTopSubcommandsExist(t *testing.T) { cmdtesting.InitTestErrorHandler(t) f := cmdtesting.NewTestFactory() defer f.Cleanup() cmd := NewCmdTop(f, genericclioptions.NewTestIOStreamsDiscard()) if !cmd.HasSubCommands() { t.Error("top command should have subcommands") } } func marshallBody(metrics interface{}) (io.ReadCloser, error) { result, err := json.Marshal(metrics) if err != nil { return nil, err } return ioutil.NopCloser(bytes.NewReader(result)), nil } func testNodeV1beta1MetricsData() (*metricsv1beta1api.NodeMetricsList, *v1.NodeList) { metrics := &metricsv1beta1api.NodeMetricsList{ ListMeta: metav1.ListMeta{ ResourceVersion: "1", }, Items: []metricsv1beta1api.NodeMetrics{ { ObjectMeta: metav1.ObjectMeta{Name: "node1", ResourceVersion: "10", Labels: map[string]string{"key": "value"}}, Window: metav1.Duration{Duration: time.Minute}, Usage: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(1, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(2*(1024*1024), resource.DecimalSI), v1.ResourceStorage: *resource.NewQuantity(3*(1024*1024), resource.DecimalSI), }, }, { ObjectMeta: metav1.ObjectMeta{Name: "node2", ResourceVersion: "11"}, Window: metav1.Duration{Duration: time.Minute}, Usage: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(5, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(6*(1024*1024), resource.DecimalSI), v1.ResourceStorage: *resource.NewQuantity(7*(1024*1024), resource.DecimalSI), }, }, { ObjectMeta: metav1.ObjectMeta{Name: "node3", ResourceVersion: "11"}, Window: metav1.Duration{Duration: time.Minute}, Usage: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(3, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(4*(1024*1024), resource.DecimalSI), v1.ResourceStorage: *resource.NewQuantity(5*(1024*1024), resource.DecimalSI), }, }, }, } nodes := &v1.NodeList{ ListMeta: metav1.ListMeta{ ResourceVersion: "15", }, Items: []v1.Node{ { ObjectMeta: metav1.ObjectMeta{Name: "node1", ResourceVersion: "10"}, Status: v1.NodeStatus{ Allocatable: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(10, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(20*(1024*1024), resource.DecimalSI), v1.ResourceStorage: *resource.NewQuantity(30*(1024*1024), resource.DecimalSI), }, }, }, { ObjectMeta: metav1.ObjectMeta{Name: "node2", ResourceVersion: "11"}, Status: v1.NodeStatus{ Allocatable: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(50, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(60*(1024*1024), resource.DecimalSI), v1.ResourceStorage: *resource.NewQuantity(70*(1024*1024), resource.DecimalSI), }, }, }, { ObjectMeta: metav1.ObjectMeta{Name: "node3", ResourceVersion: "11"}, Status: v1.NodeStatus{ Allocatable: v1.ResourceList{ v1.ResourceCPU: *resource.NewMilliQuantity(30, resource.DecimalSI), v1.ResourceMemory: *resource.NewQuantity(40*(1024*1024), resource.DecimalSI), v1.ResourceStorage: *resource.NewQuantity(50*(1024*1024), resource.DecimalSI), }, }, }, }, } return metrics, nodes }
"io/ioutil" "testing"