Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
7
99.5k
meta
dict
/// /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// /// Auto-generated by Stone, do not modify. /// #import <Foundation/Foundation.h> #import "DBSerializableProtocol.h" @class DBTEAMPOLICIESSharedFolderJoinPolicy; NS_ASSUME_NONNULL_BEGIN #pragma mark - API Object /// /// The `SharedFolderJoinPolicy` union. /// /// Policy governing which shared folders a team member can join. /// /// This class implements the `DBSerializable` protocol (serialize and /// deserialize instance methods), which is required for all Obj-C SDK API route /// objects. /// @interface DBTEAMPOLICIESSharedFolderJoinPolicy : NSObject <DBSerializable, NSCopying> #pragma mark - Instance fields /// The `DBTEAMPOLICIESSharedFolderJoinPolicyTag` enum type represents the /// possible tag states with which the `DBTEAMPOLICIESSharedFolderJoinPolicy` /// union can exist. typedef NS_CLOSED_ENUM(NSInteger, DBTEAMPOLICIESSharedFolderJoinPolicyTag){ /// Team members can only join folders shared by teammates. DBTEAMPOLICIESSharedFolderJoinPolicyFromTeamOnly, /// Team members can join any shared folder, including those shared by users /// outside the team. DBTEAMPOLICIESSharedFolderJoinPolicyFromAnyone, /// (no description). DBTEAMPOLICIESSharedFolderJoinPolicyOther, }; /// Represents the union's current tag state. @property (nonatomic, readonly) DBTEAMPOLICIESSharedFolderJoinPolicyTag tag; #pragma mark - Constructors /// /// Initializes union class with tag state of "from_team_only". /// /// Description of the "from_team_only" tag state: Team members can only join /// folders shared by teammates. /// /// @return An initialized instance. /// - (instancetype)initWithFromTeamOnly; /// /// Initializes union class with tag state of "from_anyone". /// /// Description of the "from_anyone" tag state: Team members can join any shared /// folder, including those shared by users outside the team. /// /// @return An initialized instance. /// - (instancetype)initWithFromAnyone; /// /// Initializes union class with tag state of "other". /// /// @return An initialized instance. /// - (instancetype)initWithOther; - (instancetype)init NS_UNAVAILABLE; #pragma mark - Tag state methods /// /// Retrieves whether the union's current tag state has value "from_team_only". /// /// @return Whether the union's current tag state has value "from_team_only". /// - (BOOL)isFromTeamOnly; /// /// Retrieves whether the union's current tag state has value "from_anyone". /// /// @return Whether the union's current tag state has value "from_anyone". /// - (BOOL)isFromAnyone; /// /// Retrieves whether the union's current tag state has value "other". /// /// @return Whether the union's current tag state has value "other". /// - (BOOL)isOther; /// /// Retrieves string value of union's current tag state. /// /// @return A human-readable string representing the union's current tag state. /// - (NSString *)tagName; @end #pragma mark - Serializer Object /// /// The serialization class for the `DBTEAMPOLICIESSharedFolderJoinPolicy` /// union. /// @interface DBTEAMPOLICIESSharedFolderJoinPolicySerializer : NSObject /// /// Serializes `DBTEAMPOLICIESSharedFolderJoinPolicy` instances. /// /// @param instance An instance of the `DBTEAMPOLICIESSharedFolderJoinPolicy` /// API object. /// /// @return A json-compatible dictionary representation of the /// `DBTEAMPOLICIESSharedFolderJoinPolicy` API object. /// + (nullable NSDictionary<NSString *, id> *)serialize:(DBTEAMPOLICIESSharedFolderJoinPolicy *)instance; /// /// Deserializes `DBTEAMPOLICIESSharedFolderJoinPolicy` instances. /// /// @param dict A json-compatible dictionary representation of the /// `DBTEAMPOLICIESSharedFolderJoinPolicy` API object. /// /// @return An instantiation of the `DBTEAMPOLICIESSharedFolderJoinPolicy` /// object. /// + (DBTEAMPOLICIESSharedFolderJoinPolicy *)deserialize:(NSDictionary<NSString *, id> *)dict; @end NS_ASSUME_NONNULL_END
{ "pile_set_name": "Github" }
/*********************************************************************** !!!!!! DO NOT MODIFY !!!!!! GacGen.exe Resource.xml This file is generated by Workflow compiler https://github.com/vczh-libraries ***********************************************************************/ #ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION #define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION #include "Demo.h" #ifndef VCZH_DEBUG_NO_REFLECTION #include "GacUIReflection.h" #endif #if defined( _MSC_VER) #pragma warning(push) #pragma warning(disable:4250) #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wparentheses-equality" #elif defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wparentheses-equality" #endif /*********************************************************************** Reflection ***********************************************************************/ namespace vl { namespace reflection { namespace description { #ifndef VCZH_DEBUG_NO_REFLECTION DECL_TYPE_INFO(::demo::MainWindow) DECL_TYPE_INFO(::demo::MainWindowConstructor) #endif extern bool LoadDemoTypes(); } } } #if defined( _MSC_VER) #pragma warning(pop) #elif defined(__GNUC__) #pragma GCC diagnostic pop #elif defined(__clang__) #pragma clang diagnostic pop #endif #endif
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF 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. */ package org.apache.stanbol.entityhub.web.reader; import java.io.IOException; import java.io.InputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import javax.servlet.ServletContext; import javax.ws.rs.Consumes; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.ext.MessageBodyReader; import javax.ws.rs.ext.Provider; import org.apache.clerezza.commons.rdf.Graph; import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; import org.apache.clerezza.commons.rdf.Triple; import org.apache.clerezza.commons.rdf.IRI; import org.apache.clerezza.rdf.core.serializedform.Parser; import org.apache.clerezza.rdf.core.serializedform.SupportedFormat; import org.apache.clerezza.rdf.core.serializedform.UnsupportedParsingFormatException; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Property; import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.Service; import org.apache.stanbol.commons.indexedgraph.IndexedGraph; import org.apache.stanbol.entityhub.jersey.utils.JerseyUtils; import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils; import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils.RequestData; import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory; import org.apache.stanbol.entityhub.servicesapi.model.Representation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Provides support for reading Representation form Requests. This implementation * supports all RDF supports as well as {@link MediaType#APPLICATION_FORM_URLENCODED} * - in case the data are sent from an HTML form - and * {@link MediaType#MULTIPART_FORM_DATA} - mime encoded data. * In case of an HTML form the encoding need to be specified by the parameter * "encoding" for the entity data the parameters "entity" or "content" can be * used. * @author Rupert Westenthaler * */ @Component @Service(Object.class) @Property(name="javax.ws.rs", boolValue=true) @Provider @Consumes({ //First the data types directly supported for parsing representations MediaType.APPLICATION_JSON, SupportedFormat.N3, SupportedFormat.N_TRIPLE, SupportedFormat.RDF_XML, SupportedFormat.TURTLE, SupportedFormat.X_TURTLE, SupportedFormat.RDF_JSON, //finally this also supports sending the data as form and mime multipart MediaType.APPLICATION_FORM_URLENCODED, MediaType.MULTIPART_FORM_DATA}) public class RepresentationReader implements MessageBodyReader<Map<String,Representation>> { private static final Logger log = LoggerFactory.getLogger(RepresentationReader.class); public static final Set<String> supportedMediaTypes; private static final MediaType DEFAULT_ACCEPTED_MEDIA_TYPE = MediaType.TEXT_PLAIN_TYPE; static { Set<String> types = new HashSet<String>(); //ensure everything is lower case types.add(MediaType.APPLICATION_JSON.toLowerCase()); types.add(SupportedFormat.N3.toLowerCase()); types.add(SupportedFormat.N_TRIPLE.toLowerCase()); types.add(SupportedFormat.RDF_JSON.toLowerCase()); types.add(SupportedFormat.RDF_XML.toLowerCase()); types.add(SupportedFormat.TURTLE.toLowerCase()); types.add(SupportedFormat.X_TURTLE.toLowerCase()); supportedMediaTypes = Collections.unmodifiableSet(types); } @Reference private Parser parser; @Override public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { String mediaTypeWithoutParameter = mediaType.getType().toLowerCase()+'/'+ mediaType.getSubtype().toLowerCase(); log.debug("isreadable: [genericType: {}| mediaType {}]", genericType,mediaTypeWithoutParameter); //second the media type boolean mediaTypeOK = (//the MimeTypes of Representations supportedMediaTypes.contains(mediaTypeWithoutParameter) || //as well as URL encoded MediaType.APPLICATION_FORM_URLENCODED.equals(mediaTypeWithoutParameter) || //and mime multipart MediaType.MULTIPART_FORM_DATA.equals(mediaTypeWithoutParameter)); boolean typeOk = JerseyUtils.testParameterizedType(Map.class, new Class[]{String.class,Representation.class}, genericType); log.debug("type is {} for {} against Map<String,Representation>", typeOk ? "compatible" : "incompatible" ,genericType); return typeOk && mediaTypeOK; } @Override public Map<String,Representation> readFrom(Class<Map<String,Representation>> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { log.info("Read Representations from Request Data"); long start = System.currentTimeMillis(); //(1) get the charset and the acceptedMediaType String charset = "UTF-8"; if(mediaType.getParameters().containsKey("charset")){ charset = mediaType.getParameters().get("charset"); } MediaType acceptedMediaType = getAcceptedMediaType(httpHeaders); log.info("readFrom: mediaType {} | accepted {} | charset {}", new Object[]{mediaType,acceptedMediaType,charset}); // (2) read the Content from the request (this needs to deal with // MediaType.APPLICATION_FORM_URLENCODED_TYPE and // MediaType.MULTIPART_FORM_DATA_TYPE requests! RequestData content; if(mediaType.isCompatible(MediaType.APPLICATION_FORM_URLENCODED_TYPE)) { try { content = MessageBodyReaderUtils.formForm(entityStream, charset, "encoding",Arrays.asList("entity","content")); } catch (IllegalArgumentException e) { log.info("Bad Request: {}",e); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(e.toString()). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(content.getMediaType() == null){ String message = String.format( "Missing parameter %s used to specify the media type" + "(supported values: %s", "encoding",supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(!isSupported(content.getMediaType())){ String message = String.format( "Unsupported Content-Type specified by parameter " + "encoding=%s (supported: %s)", content.getMediaType().toString(),supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } } else if(mediaType.isCompatible(MediaType.MULTIPART_FORM_DATA_TYPE)){ log.info("read from MimeMultipart"); List<RequestData> contents; try { contents = MessageBodyReaderUtils.fromMultipart(entityStream, mediaType); } catch (IllegalArgumentException e) { log.info("Bad Request: {}",e.toString()); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(e.toString()). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(contents.isEmpty()){ String message = "Request does not contain any Mime BodyParts."; log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } else if(contents.size()>1){ //print warnings about ignored parts log.warn("{} Request contains more than one Parts: others than " + "the first will be ignored", MediaType.MULTIPART_FORM_DATA_TYPE); for(int i=1;i<contents.size();i++){ RequestData ignored = contents.get(i); log.warn(" ignore Content {}: Name {}| MediaType {}", new Object[] {i+1,ignored.getName(),ignored.getMediaType()}); } } content = contents.get(0); if(content.getMediaType() == null){ String message = String.format( "MediaType not specified for mime body part for file %s. " + "The media type must be one of the supported values: %s", content.getName(), supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(!isSupported(content.getMediaType())){ String message = String.format( "Unsupported Content-Type %s specified for mime body part " + "for file %s (supported: %s)", content.getMediaType(),content.getName(),supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } } else { content = new RequestData(mediaType, null, entityStream); } long readingCompleted = System.currentTimeMillis(); log.info(" ... reading request data {}ms",readingCompleted-start); Map<String,Representation> parsed = parseFromContent(content,acceptedMediaType); long parsingCompleted = System.currentTimeMillis(); log.info(" ... parsing data {}ms",parsingCompleted-readingCompleted); return parsed; } public Map<String,Representation> parseFromContent(RequestData content, MediaType acceptedMediaType){ // (3) Parse the Representtion(s) form the entity stream if(content.getMediaType().isCompatible(MediaType.APPLICATION_JSON_TYPE)){ //parse from json throw new UnsupportedOperationException("Parsing of JSON not yet implemented :("); } else if(isSupported(content.getMediaType())){ //from RDF serialisation RdfValueFactory valueFactory = RdfValueFactory.getInstance(); Map<String,Representation> representations = new HashMap<String,Representation>(); Set<BlankNodeOrIRI> processed = new HashSet<BlankNodeOrIRI>(); Graph graph = new IndexedGraph(); try { parser.parse(graph,content.getEntityStream(), content.getMediaType().toString()); } catch (UnsupportedParsingFormatException e) { //String acceptedMediaType = httpHeaders.getFirst("Accept"); //throw an internal server Error, because we check in //isReadable(..) for supported types and still we get here a //unsupported format -> therefore it looks like an configuration //error the server (e.g. a missing Bundle with the required bundle) String message = "Unable to create the Parser for the supported format" +content.getMediaType()+" ("+e+")"; log.error(message,e); throw new WebApplicationException( Response.status(Status.INTERNAL_SERVER_ERROR). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } catch (RuntimeException e){ //NOTE: Clerezza seams not to provide specific exceptions on // parsing errors. Hence the catch for all RuntimeException String message = "Unable to parse the provided RDF data (format: " +content.getMediaType()+", message: "+e.getMessage()+")"; log.error(message,e); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } for(Iterator<Triple> st = graph.iterator();st.hasNext();){ BlankNodeOrIRI resource = st.next().getSubject(); if(resource instanceof IRI && processed.add(resource)){ //build a new representation representations.put(((IRI)resource).getUnicodeString(), valueFactory.createRdfRepresentation((IRI)resource, graph)); } } return representations; } else { //unsupported media type String message = String.format( "Parsed Content-Type '%s' is not one of the supported %s", content.getMediaType(),supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } } /** * Internally used to get the accepted media type used when returning * {@link WebApplicationException}s. * @param httpHeaders * @param acceptedMediaType * @return */ private static MediaType getAcceptedMediaType(MultivaluedMap<String,String> httpHeaders) { MediaType acceptedMediaType; String acceptedMediaTypeString = httpHeaders.getFirst("Accept"); if(acceptedMediaTypeString != null){ try { acceptedMediaType = MediaType.valueOf(acceptedMediaTypeString); if(acceptedMediaType.isWildcardType()){ acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE; } } catch (IllegalArgumentException e) { acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE; } } else { acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE; } return acceptedMediaType; } /** * Converts the type and the subtype of the parsed media type to the * string representation as stored in {@link #supportedMediaTypes} and than * checks if the parsed media type is contained in this list. * @param mediaType the MediaType instance to check * @return <code>true</code> if the parsed media type is not * <code>null</code> and supported. */ private boolean isSupported(MediaType mediaType){ return mediaType == null ? false : supportedMediaTypes.contains( mediaType.getType().toLowerCase()+'/'+ mediaType.getSubtype().toLowerCase()); } }
{ "pile_set_name": "Github" }
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.impl import com.intellij.ProjectTopics import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.service import com.intellij.openapi.extensions.ExtensionNotApplicableException import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleManager import com.intellij.openapi.project.ModuleListener import com.intellij.openapi.project.Project import com.intellij.openapi.project.rootManager import com.intellij.openapi.roots.ModuleRootEvent import com.intellij.openapi.roots.ModuleRootListener import com.intellij.openapi.startup.StartupActivity import com.intellij.openapi.vcs.AbstractVcs import com.intellij.openapi.vcs.ProjectLevelVcsManager import com.intellij.openapi.vcs.VcsDirectoryMapping import com.intellij.openapi.vfs.VirtualFile internal class ModuleVcsDetector(private val project: Project) { private val vcsManager by lazy(LazyThreadSafetyMode.NONE) { (ProjectLevelVcsManager.getInstance(project) as ProjectLevelVcsManagerImpl) } internal class MyPostStartUpActivity : StartupActivity.DumbAware { init { if (ApplicationManager.getApplication().isUnitTestMode) { throw ExtensionNotApplicableException.INSTANCE } } override fun runActivity(project: Project) { val vcsDetector = project.service<ModuleVcsDetector>() val listener = vcsDetector.MyModulesListener() val busConnection = project.messageBus.connect() busConnection.subscribe(ProjectTopics.MODULES, listener) busConnection.subscribe(ProjectTopics.PROJECT_ROOTS, listener) if (vcsDetector.vcsManager.needAutodetectMappings()) { vcsDetector.autoDetectVcsMappings(true) } } } private inner class MyModulesListener : ModuleRootListener, ModuleListener { private val myMappingsForRemovedModules: MutableList<VcsDirectoryMapping> = mutableListOf() override fun beforeRootsChange(event: ModuleRootEvent) { myMappingsForRemovedModules.clear() } override fun rootsChanged(event: ModuleRootEvent) { myMappingsForRemovedModules.forEach { mapping -> vcsManager.removeDirectoryMapping(mapping) } // the check calculates to true only before user has done any change to mappings, i.e. in case modules are detected/added automatically // on start etc (look inside) if (vcsManager.needAutodetectMappings()) { autoDetectVcsMappings(false) } } override fun moduleAdded(project: Project, module: Module) { myMappingsForRemovedModules.removeAll(getMappings(module)) autoDetectModuleVcsMapping(module) } override fun beforeModuleRemoved(project: Project, module: Module) { myMappingsForRemovedModules.addAll(getMappings(module)) } } private fun autoDetectVcsMappings(tryMapPieces: Boolean) { if (vcsManager.haveDefaultMapping() != null) return val usedVcses = mutableSetOf<AbstractVcs?>() val detectedRoots = mutableSetOf<Pair<VirtualFile, AbstractVcs>>() val roots = ModuleManager.getInstance(project).modules.flatMap { it.rootManager.contentRoots.asIterable() }.distinct() for (root in roots) { val moduleVcs = vcsManager.findVersioningVcs(root) if (moduleVcs != null) { detectedRoots.add(Pair(root, moduleVcs)) } usedVcses.add(moduleVcs) // put 'null' for unmapped module } val commonVcs = usedVcses.singleOrNull() if (commonVcs != null) { // Remove existing mappings that will duplicate added <Project> mapping. val rootPaths = roots.map { it.path }.toSet() val additionalMappings = vcsManager.directoryMappings.filter { it.directory !in rootPaths } vcsManager.setAutoDirectoryMappings(additionalMappings + VcsDirectoryMapping.createDefault(commonVcs.name)) } else if (tryMapPieces) { val newMappings = detectedRoots.map { (root, vcs) -> VcsDirectoryMapping(root.path, vcs.name) } vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings) } } private fun autoDetectModuleVcsMapping(module: Module) { if (vcsManager.haveDefaultMapping() != null) return val newMappings = mutableListOf<VcsDirectoryMapping>() for (file in module.rootManager.contentRoots) { val vcs = vcsManager.findVersioningVcs(file) if (vcs != null && vcs !== vcsManager.getVcsFor(file)) { newMappings.add(VcsDirectoryMapping(file.path, vcs.name)) } } if (newMappings.isNotEmpty()) { vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings) } } private fun getMappings(module: Module): List<VcsDirectoryMapping> { return module.rootManager.contentRoots .mapNotNull { root -> vcsManager.directoryMappings.firstOrNull { it.directory == root.path } } } }
{ "pile_set_name": "Github" }
/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 "SimpleDBMissingParameterException.h" @implementation SimpleDBMissingParameterException @synthesize boxUsage; -(id)initWithMessage:(NSString *)theMessage { if (self = [super initWithMessage:theMessage]) { } return self; } -(void)setPropertiesWithException:(AmazonServiceException *)theException { [super setPropertiesWithException:theException]; if ([theException.additionalFields valueForKey:@"BoxUsage"] != nil) { self.boxUsage = [AmazonSDKUtil convertStringToNumber:[theException.additionalFields valueForKey:@"BoxUsage"]]; } } -(NSString *)description { NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:256]; [buffer appendString:@"{"]; [buffer appendString:[[[NSString alloc] initWithFormat:@"BoxUsage: %@,", boxUsage] autorelease]]; [buffer appendString:[super description]]; [buffer appendString:@"}"]; return [buffer autorelease]; } -(void)dealloc { [boxUsage release]; [super dealloc]; } @end
{ "pile_set_name": "Github" }
package network // Copyright (c) Microsoft and contributors. All rights reserved. // // 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. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/tracing" "net/http" ) // VpnSitesClient is the network Client type VpnSitesClient struct { BaseClient } // NewVpnSitesClient creates an instance of the VpnSitesClient client. func NewVpnSitesClient(subscriptionID string) VpnSitesClient { return NewVpnSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewVpnSitesClientWithBaseURI creates an instance of the VpnSitesClient client. func NewVpnSitesClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesClient { return VpnSitesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. // Parameters: // resourceGroupName - the resource group name of the VpnSite. // vpnSiteName - the name of the VpnSite being created or updated. // vpnSiteParameters - parameters supplied to create or update VpnSite. func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (result VpnSitesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vpnSiteName": autorest.Encode("path", vpnSiteName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), autorest.WithJSON(vpnSiteParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future VpnSitesCreateOrUpdateFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Delete deletes a VpnSite. // Parameters: // resourceGroupName - the resource group name of the VpnSite. // vpnSiteName - the name of the VpnSite being deleted. func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSitesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Delete") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.DeletePreparer(ctx, resourceGroupName, vpnSiteName) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", result.Response(), "Failure sending request") return } return } // DeletePreparer prepares the Delete request. func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vpnSiteName": autorest.Encode("path", vpnSiteName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDeleteFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client VpnSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } // Get retrieves the details of a VPNsite. // Parameters: // resourceGroupName - the resource group name of the VpnSite. // vpnSiteName - the name of the VpnSite being retrieved. func (client VpnSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSite, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.GetPreparer(ctx, resourceGroupName, vpnSiteName) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vpnSiteName": autorest.Encode("path", vpnSiteName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client VpnSitesClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client VpnSitesClient) GetResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // List lists all the VpnSites in a subscription. func (client VpnSitesClient) List(ctx context.Context) (result ListVpnSitesResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List") defer func() { sc := -1 if result.lvsr.Response.Response != nil { sc = result.lvsr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.lvsr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure sending request") return } result.lvsr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client VpnSitesClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. func (client VpnSitesClient) ListResponder(resp *http.Response) (result ListVpnSitesResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listNextResults retrieves the next set of results, if any. func (client VpnSitesClient) listNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { req, err := lastResults.listVpnSitesResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client VpnSitesClient) ListComplete(ctx context.Context) (result ListVpnSitesResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.List(ctx) return } // ListByResourceGroup lists all the vpnSites in a resource group. // Parameters: // resourceGroupName - the resource group name of the VpnSite. func (client VpnSitesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup") defer func() { sc := -1 if result.lvsr.Response.Response != nil { sc = result.lvsr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.lvsr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure sending request") return } result.lvsr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client VpnSitesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. func (client VpnSitesClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnSitesResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listByResourceGroupNextResults retrieves the next set of results, if any. func (client VpnSitesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { req, err := lastResults.listVpnSitesResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") } result, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") } return } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. func (client VpnSitesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) return } // UpdateTags updates VpnSite tags. // Parameters: // resourceGroupName - the resource group name of the VpnSite. // vpnSiteName - the name of the VpnSite being updated. // vpnSiteParameters - parameters supplied to update VpnSite tags. func (client VpnSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (result VpnSitesUpdateTagsFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.UpdateTags") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", nil, "Failure preparing request") return } result, err = client.UpdateTagsSender(req) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", result.Response(), "Failure sending request") return } return } // UpdateTagsPreparer prepares the UpdateTags request. func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vpnSiteName": autorest.Encode("path", vpnSiteName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), autorest.WithJSON(vpnSiteParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // UpdateTagsSender sends the UpdateTags request. The method will close the // http.Response Body if it receives an error. func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (future VpnSitesUpdateTagsFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // UpdateTagsResponder handles the response to the UpdateTags request. The method always // closes the http.Response Body. func (client VpnSitesClient) UpdateTagsResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return }
{ "pile_set_name": "Github" }
// Code generated by go-swagger; DO NOT EDIT. package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // RegistrationViaAPIResponse The Response for Registration Flows via API // // swagger:model registrationViaApiResponse type RegistrationViaAPIResponse struct { // identity // Required: true Identity *Identity `json:"identity"` // session Session *Session `json:"session,omitempty"` // The Session Token // // This field is only set when the session hook is configured as a post-registration hook. // // A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization // Header: // // Authorization: bearer ${session-token} // // The session token is only issued for API flows, not for Browser flows! // Required: true SessionToken *string `json:"session_token"` } // Validate validates this registration via Api response func (m *RegistrationViaAPIResponse) Validate(formats strfmt.Registry) error { var res []error if err := m.validateIdentity(formats); err != nil { res = append(res, err) } if err := m.validateSession(formats); err != nil { res = append(res, err) } if err := m.validateSessionToken(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *RegistrationViaAPIResponse) validateIdentity(formats strfmt.Registry) error { if err := validate.Required("identity", "body", m.Identity); err != nil { return err } if m.Identity != nil { if err := m.Identity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("identity") } return err } } return nil } func (m *RegistrationViaAPIResponse) validateSession(formats strfmt.Registry) error { if swag.IsZero(m.Session) { // not required return nil } if m.Session != nil { if err := m.Session.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("session") } return err } } return nil } func (m *RegistrationViaAPIResponse) validateSessionToken(formats strfmt.Registry) error { if err := validate.Required("session_token", "body", m.SessionToken); err != nil { return err } return nil } // MarshalBinary interface implementation func (m *RegistrationViaAPIResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } return swag.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *RegistrationViaAPIResponse) UnmarshalBinary(b []byte) error { var res RegistrationViaAPIResponse if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }
{ "pile_set_name": "Github" }
/* * TupleTypeUtil.java * * This source file is part of the FoundationDB open source project * * Copyright 2015-2019 Apple Inc. and the FoundationDB project 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 com.apple.foundationdb.record.metadata; import com.apple.foundationdb.record.provider.foundationdb.FDBRecordVersion; import com.apple.foundationdb.tuple.Tuple; import com.google.protobuf.ByteString; import com.google.protobuf.Descriptors; import com.google.protobuf.ProtocolMessageEnum; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; /** * Utility class for dealing with {@link Tuple} types. In theory, these methods should live in * {@link com.apple.foundationdb.tuple.TupleHelpers TupleHelpers} except that they use some Protobuf specific things * like the {@link ByteString} class, and {@code TupleHelpers} is defined in the * <a href="https://javadoc.io/doc/org.foundationdb/fdb-extensions/">fdb-extensions</a> sub-project * which does not (and probably should not) take Protobuf as a dependency. */ class TupleTypeUtil { @Nonnull private static final BigInteger BIG_INT_MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE); @Nonnull private static final BigInteger BIG_INT_MIN_LONG = BigInteger.valueOf(Long.MIN_VALUE); /** * Normalize a list of values so that it can be checked for equality with other lists sharing * the same {@link Tuple} representation. In other words, it should be the case that: * * <pre> {@code * toTupleEquivalentValue(list1).equals(toTupleEquivalentValue) * == Arrays.equals(Tuple.fromList(toTupleAppropriateList(list1)).pack(), Tuple.fromList(toTupleAppropriateList(list2)).pack()) * }</pre> * * <p> * for any two lists {@code list1} and {@code list2}. * </p> * * @param values the list of values to normalized * @return a new list containing the normalized elements of {@code values} */ @Nonnull static List<Object> toTupleEquivalentList(@Nonnull List<?> values) { List<Object> tupleEquivalentList = new ArrayList<>(values.size()); for (Object o : values) { tupleEquivalentList.add(toTupleEquivalentValue(o)); } return tupleEquivalentList; } /** * Normalize a value so that it compares equal to anything with the same {@link Tuple} representation. * The value that is returned cannot necessarily be packed by a {@code Tuple} (for example, * a <code>byte[]</code> is returned as a {@link ByteString}), but it does implement {@link Object#equals(Object)} * and {@link Object#hashCode()}, so the value can be used in hash-based data structures like * {@link java.util.HashSet HashSet}s and {@link java.util.HashMap HashMap}s. In other words, it should * bethe case that: * * <pre> {@code * Objects.equals(toTupleEquivalentValue(value1), toTupleEquivalentValue(value2)) * == Arrays.equals(Tuple.from(value1).pack(), Tuple.from(value2).pack()) * }</pre> * * <p> * for any two values {@code value1} and {@code value2}. * </p> * * <p> * This will only return {@code null} if {@link #toTupleAppropriateValue(Object)} would return {@code null} * on the same input. If the object is already in * </p> * * @param obj the value to normalize * @return a value that has the same representation when {@link Tuple}-encoded */ @Nullable static Object toTupleEquivalentValue(@Nullable Object obj) { if (obj == null || obj instanceof Key.Evaluated.NullStandin) { return null; } else if (obj instanceof List<?>) { List<?> list = (List<?>)obj; return toTupleEquivalentList(list); } else if (obj instanceof Tuple) { return toTupleEquivalentList(((Tuple)obj).getItems()); } else if (obj instanceof byte[]) { return ByteString.copyFrom((byte[]) obj); } else if ((obj instanceof Byte) || (obj instanceof Short) || (obj instanceof Integer)) { return ((Number)obj).longValue(); } else if (obj instanceof BigInteger) { BigInteger bigInt = (BigInteger)obj; if (bigInt.compareTo(BIG_INT_MIN_LONG) > 0 && bigInt.compareTo(BIG_INT_MAX_LONG) < 0) { return bigInt.longValue(); } else { return bigInt; } } else if (obj instanceof ProtocolMessageEnum) { return (long)((ProtocolMessageEnum)obj).getNumber(); } else if (obj instanceof Descriptors.EnumValueDescriptor) { return (long)((Descriptors.EnumValueDescriptor)obj).getNumber(); } else if (obj instanceof FDBRecordVersion) { return ((FDBRecordVersion)obj).toVersionstamp(false); } else { return obj; } } /** * Convert a list of values into items that can all be stored within a {@link Tuple}. * * @param values a list of values * @return a new list with {@link Tuple}-encodable versions of the elements of {@code values} */ @Nonnull static List<Object> toTupleAppropriateList(@Nonnull List<?> values) { List<Object> tupleAppropriateList = new ArrayList<>(values.size()); for (Object o : values) { tupleAppropriateList.add(toTupleAppropriateValue(o)); } return tupleAppropriateList; } /** * Convert a value into a type that can be stored within a {@link Tuple}. * * @param obj the value to convert * @return the value converted to some {@link Tuple}-encodable type */ @Nullable static Object toTupleAppropriateValue(@Nullable Object obj) { if (obj instanceof Key.Evaluated.NullStandin) { return null; } else if (obj instanceof ByteString) { return ((ByteString) obj).toByteArray(); } else if (obj instanceof List) { return toTupleAppropriateList((List<?>) obj); // Following two are both Internal.EnumLite, so could use that, too. } else if (obj instanceof ProtocolMessageEnum) { return ((ProtocolMessageEnum) obj).getNumber(); } else if (obj instanceof Descriptors.EnumValueDescriptor) { return ((Descriptors.EnumValueDescriptor) obj).getNumber(); } else if (obj instanceof FDBRecordVersion) { return ((FDBRecordVersion) obj).toVersionstamp(false); } else { return obj; } } private TupleTypeUtil() { } }
{ "pile_set_name": "Github" }
/* Copyright 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. */ // Code generated by client-gen. DO NOT EDIT. package v1 type JobExpansion interface{}
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by AsyncGenerator. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System.Collections.Generic; using NUnit.Framework; using NHibernate.Criterion; namespace NHibernate.Test.NHSpecificTest.NH2546 { using System.Threading.Tasks; [TestFixture] public class SetCommandParameterSizesFalseFixtureAsync : BugTestCase { protected override bool AppliesTo(Dialect.Dialect dialect) { return dialect is Dialect.MsSql2008Dialect; } protected override void OnSetUp() { using (ISession session = Sfi.OpenSession()) { session.Persist(new Student() { StringTypeWithLengthDefined = "Julian Maughan" }); session.Persist(new Student() { StringTypeWithLengthDefined = "Bill Clinton" }); session.Flush(); } } protected override void OnTearDown() { using (ISession session = Sfi.OpenSession()) { session.CreateQuery("delete from Student").ExecuteUpdate(); session.Flush(); } base.OnTearDown(); } [Test] public async Task LikeExpressionWithinDefinedTypeSizeAsync() { using (ISession session = Sfi.OpenSession()) { ICriteria criteria = session .CreateCriteria<Student>() .Add(Restrictions.Like("StringTypeWithLengthDefined", "Julian%")); IList<Student> list = await (criteria.ListAsync<Student>()); Assert.That(list.Count, Is.EqualTo(1)); } } [Test] public async Task LikeExpressionExceedsDefinedTypeSizeAsync() { // In this case we are forcing the usage of LikeExpression class where the length of the associated property is ignored using (ISession session = Sfi.OpenSession()) { ICriteria criteria = session .CreateCriteria<Student>() .Add(Restrictions.Like("StringTypeWithLengthDefined", "[a-z][a-z][a-z]ian%", MatchMode.Exact, null)); IList<Student> list = await (criteria.ListAsync<Student>()); Assert.That(list.Count, Is.EqualTo(1)); } } } }
{ "pile_set_name": "Github" }
/* Copyright 2019 Google Inc. All Rights Reserved. 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. ==============================================================================*/ import {Polygon} from '/lib/math/polygon2d.js'; import * as moduleInterface from '/lib/module_interface.js'; import * as moduleTicker from '/client/modules/module_ticker.js'; import * as network from '/client/network/network.js'; import * as peerNetwork from '/client/network/peer.js'; import {easyLog} from '/lib/log.js'; import assert from '/lib/assert.js'; import asset from '/client/asset/asset.js'; import conform from '/lib/conform.js'; import inject from '/lib/inject.js'; import * as stateManager from '/client/state/state_manager.js'; import {TitleCard} from '/client/title_card.js'; import * as time from '/client/util/time.js'; import {delay} from '/lib/promise.js'; function createNewContainer(name) { var newContainer = document.createElement('div'); newContainer.className = 'container'; newContainer.id = 't-' + time.now(); newContainer.setAttribute('moduleName', name); return newContainer; } export const FadeTransition = { start(container) { if (container) { container.style.opacity = 0.001; document.querySelector('#containers').appendChild(container); } }, async perform(oldModule, newModule, deadline) { if (newModule.name == '_empty') { // Fading out.. so fade *out* the *old* container. oldModule.container.style.transition = 'opacity ' + time.until(deadline).toFixed(0) + 'ms'; oldModule.container.style.opacity = 0.0; } else { newModule.container.style.transition = 'opacity ' + time.until(deadline).toFixed(0) + 'ms'; newModule.container.style.opacity = 1.0; } // TODO(applmak): Maybe wait until css says that the transition is done? await delay(time.until(deadline)); } } export class ClientModule { constructor(name, path, config, titleCard, deadline, geo, transition) { // The module name. this.name = name; // The path to the main file of this module. this.path = path; // The module config. this.config = config; // The title card instance for this module. this.titleCard = titleCard; // Absolute time when this module is supposed to be visible. Module will // actually be faded in by deadline + 5000ms. this.deadline = deadline; // The wall geometry. this.geo = geo; // The transition to use to transition to this module. this.transition = transition; // The dom container for the module's content. this.container = null; // Module class instance. this.instance = null; // Network instance for this module. this.network = null; } // Deserializes from the json serialized form of ModuleDef in the server. static deserialize(bits) { if (bits.module.name == '_empty') { return ClientModule.newEmptyModule(bits.time); } return new ClientModule( bits.module.name, bits.module.path, bits.module.config, new TitleCard(bits.module.credit), bits.time, new Polygon(bits.geo), FadeTransition, ); } static newEmptyModule(deadline = 0, transition = FadeTransition) { return new ClientModule( '_empty', '', {}, new TitleCard({}), deadline, new Polygon([{x: 0, y:0}]), transition ); } // Extracted out for testing purposes. static async loadPath(path) { return await import(path); } async instantiate() { this.container = createNewContainer(this.name); if (!this.path) { return; } const INSTANTIATION_ID = `${this.geo.extents.serialize()}-${this.deadline}`; this.network = network.forModule(INSTANTIATION_ID); let openNetwork = this.network.open(); this.stateManager = stateManager.forModule(network, INSTANTIATION_ID); const fakeEnv = { asset, debug: easyLog('wall:module:' + this.name), game: undefined, network: openNetwork, titleCard: this.titleCard.getModuleAPI(), state: this.stateManager.open(), wallGeometry: this.geo, peerNetwork, assert, }; try { const {load} = await ClientModule.loadPath(this.path); if (!load) { throw new Error(`${this.name} did not export a 'load' function!`); } const {client} = inject(load, fakeEnv); conform(client, moduleInterface.Client); this.instance = new client(this.config); } catch (e) { // something went very wrong. Wind everything down.! this.network.close(); this.network = null; throw e; } } // Returns true if module is still OK. async willBeShownSoon() { if (!this.path) { return; } // Prep the container for transition. // TODO(applmak): Move the transition smarts out of ClientModule. this.transition.start(this.container); try { await this.instance.willBeShownSoon(this.container, this.deadline); } catch(e) { this.dispose(); throw e; } } // Returns true if module is still OK. beginTransitionIn(deadline) { if (!this.path) { return; } moduleTicker.add(this.name, this.instance); try { this.instance.beginFadeIn(deadline); } catch (e) { this.dispose(); throw e; } } finishTransitionIn() { if (!this.path) { return; } this.titleCard.enter(); this.instance.finishFadeIn(); } beginTransitionOut(deadline) { if (!this.path) { return; } this.titleCard.exit(); this.instance.beginFadeOut(deadline); } finishTransitionOut() { if (!this.path) { return; } this.instance.finishFadeOut(); } async performTransition(otherModule, transitionFinishDeadline) { await this.transition.perform(otherModule, this, transitionFinishDeadline); } dispose() { if (this.container) { this.container.remove(); this.container = null; } if (!this.path) { return; } this.titleCard.exit(); // Just in case. moduleTicker.remove(this.instance); if (this.network) { this.stateManager.close(); this.stateManager = null; this.network.close(); this.network = null; } } }
{ "pile_set_name": "Github" }
// DO NOT EDIT. // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: google/protobuf/unittest_proto3_arena.proto // // For information on using the generated types, please see the documenation: // https://github.com/apple/swift-protobuf/ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. // Please ensure that your are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } enum Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf.Enum { typealias RawValue = Int case foreignZero // = 0 case foreignFoo // = 4 case foreignBar // = 5 case foreignBaz // = 6 case UNRECOGNIZED(Int) init() { self = .foreignZero } init?(rawValue: Int) { switch rawValue { case 0: self = .foreignZero case 4: self = .foreignFoo case 5: self = .foreignBar case 6: self = .foreignBaz default: self = .UNRECOGNIZED(rawValue) } } var rawValue: Int { switch self { case .foreignZero: return 0 case .foreignFoo: return 4 case .foreignBar: return 5 case .foreignBaz: return 6 case .UNRECOGNIZED(let i): return i } } } #if swift(>=4.2) extension Proto3ArenaUnittest_ForeignEnum: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static var allCases: [Proto3ArenaUnittest_ForeignEnum] = [ .foreignZero, .foreignFoo, .foreignBar, .foreignBaz, ] } #endif // swift(>=4.2) /// This proto includes every type of field in both singular and repeated /// forms. struct Proto3ArenaUnittest_TestAllTypes { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// Singular var optionalInt32: Int32 { get {return _storage._optionalInt32} set {_uniqueStorage()._optionalInt32 = newValue} } var optionalInt64: Int64 { get {return _storage._optionalInt64} set {_uniqueStorage()._optionalInt64 = newValue} } var optionalUint32: UInt32 { get {return _storage._optionalUint32} set {_uniqueStorage()._optionalUint32 = newValue} } var optionalUint64: UInt64 { get {return _storage._optionalUint64} set {_uniqueStorage()._optionalUint64 = newValue} } var optionalSint32: Int32 { get {return _storage._optionalSint32} set {_uniqueStorage()._optionalSint32 = newValue} } var optionalSint64: Int64 { get {return _storage._optionalSint64} set {_uniqueStorage()._optionalSint64 = newValue} } var optionalFixed32: UInt32 { get {return _storage._optionalFixed32} set {_uniqueStorage()._optionalFixed32 = newValue} } var optionalFixed64: UInt64 { get {return _storage._optionalFixed64} set {_uniqueStorage()._optionalFixed64 = newValue} } var optionalSfixed32: Int32 { get {return _storage._optionalSfixed32} set {_uniqueStorage()._optionalSfixed32 = newValue} } var optionalSfixed64: Int64 { get {return _storage._optionalSfixed64} set {_uniqueStorage()._optionalSfixed64 = newValue} } var optionalFloat: Float { get {return _storage._optionalFloat} set {_uniqueStorage()._optionalFloat = newValue} } var optionalDouble: Double { get {return _storage._optionalDouble} set {_uniqueStorage()._optionalDouble = newValue} } var optionalBool: Bool { get {return _storage._optionalBool} set {_uniqueStorage()._optionalBool = newValue} } var optionalString: String { get {return _storage._optionalString} set {_uniqueStorage()._optionalString = newValue} } var optionalBytes: Data { get {return _storage._optionalBytes} set {_uniqueStorage()._optionalBytes = newValue} } var optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage { get {return _storage._optionalNestedMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()} set {_uniqueStorage()._optionalNestedMessage = newValue} } /// Returns true if `optionalNestedMessage` has been explicitly set. var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} var optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage { get {return _storage._optionalForeignMessage ?? Proto3ArenaUnittest_ForeignMessage()} set {_uniqueStorage()._optionalForeignMessage = newValue} } /// Returns true if `optionalForeignMessage` has been explicitly set. var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} var optionalImportMessage: ProtobufUnittestImport_ImportMessage { get {return _storage._optionalImportMessage ?? ProtobufUnittestImport_ImportMessage()} set {_uniqueStorage()._optionalImportMessage = newValue} } /// Returns true if `optionalImportMessage` has been explicitly set. var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil} /// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value. mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil} var optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum { get {return _storage._optionalNestedEnum} set {_uniqueStorage()._optionalNestedEnum = newValue} } var optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum { get {return _storage._optionalForeignEnum} set {_uniqueStorage()._optionalForeignEnum = newValue} } var optionalStringPiece: String { get {return _storage._optionalStringPiece} set {_uniqueStorage()._optionalStringPiece = newValue} } var optionalCord: String { get {return _storage._optionalCord} set {_uniqueStorage()._optionalCord = newValue} } /// Defined in unittest_import_public.proto var optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage { get {return _storage._optionalPublicImportMessage ?? ProtobufUnittestImport_PublicImportMessage()} set {_uniqueStorage()._optionalPublicImportMessage = newValue} } /// Returns true if `optionalPublicImportMessage` has been explicitly set. var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil} /// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value. mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil} var optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage { get {return _storage._optionalLazyMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()} set {_uniqueStorage()._optionalLazyMessage = newValue} } /// Returns true if `optionalLazyMessage` has been explicitly set. var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil} /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value. mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil} var optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage { get {return _storage._optionalLazyImportMessage ?? ProtobufUnittestImport_ImportMessage()} set {_uniqueStorage()._optionalLazyImportMessage = newValue} } /// Returns true if `optionalLazyImportMessage` has been explicitly set. var hasOptionalLazyImportMessage: Bool {return _storage._optionalLazyImportMessage != nil} /// Clears the value of `optionalLazyImportMessage`. Subsequent reads from it will return its default value. mutating func clearOptionalLazyImportMessage() {_uniqueStorage()._optionalLazyImportMessage = nil} /// Repeated var repeatedInt32: [Int32] { get {return _storage._repeatedInt32} set {_uniqueStorage()._repeatedInt32 = newValue} } var repeatedInt64: [Int64] { get {return _storage._repeatedInt64} set {_uniqueStorage()._repeatedInt64 = newValue} } var repeatedUint32: [UInt32] { get {return _storage._repeatedUint32} set {_uniqueStorage()._repeatedUint32 = newValue} } var repeatedUint64: [UInt64] { get {return _storage._repeatedUint64} set {_uniqueStorage()._repeatedUint64 = newValue} } var repeatedSint32: [Int32] { get {return _storage._repeatedSint32} set {_uniqueStorage()._repeatedSint32 = newValue} } var repeatedSint64: [Int64] { get {return _storage._repeatedSint64} set {_uniqueStorage()._repeatedSint64 = newValue} } var repeatedFixed32: [UInt32] { get {return _storage._repeatedFixed32} set {_uniqueStorage()._repeatedFixed32 = newValue} } var repeatedFixed64: [UInt64] { get {return _storage._repeatedFixed64} set {_uniqueStorage()._repeatedFixed64 = newValue} } var repeatedSfixed32: [Int32] { get {return _storage._repeatedSfixed32} set {_uniqueStorage()._repeatedSfixed32 = newValue} } var repeatedSfixed64: [Int64] { get {return _storage._repeatedSfixed64} set {_uniqueStorage()._repeatedSfixed64 = newValue} } var repeatedFloat: [Float] { get {return _storage._repeatedFloat} set {_uniqueStorage()._repeatedFloat = newValue} } var repeatedDouble: [Double] { get {return _storage._repeatedDouble} set {_uniqueStorage()._repeatedDouble = newValue} } var repeatedBool: [Bool] { get {return _storage._repeatedBool} set {_uniqueStorage()._repeatedBool = newValue} } var repeatedString: [String] { get {return _storage._repeatedString} set {_uniqueStorage()._repeatedString = newValue} } var repeatedBytes: [Data] { get {return _storage._repeatedBytes} set {_uniqueStorage()._repeatedBytes = newValue} } var repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] { get {return _storage._repeatedNestedMessage} set {_uniqueStorage()._repeatedNestedMessage = newValue} } var repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] { get {return _storage._repeatedForeignMessage} set {_uniqueStorage()._repeatedForeignMessage = newValue} } var repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] { get {return _storage._repeatedImportMessage} set {_uniqueStorage()._repeatedImportMessage = newValue} } var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] { get {return _storage._repeatedNestedEnum} set {_uniqueStorage()._repeatedNestedEnum = newValue} } var repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] { get {return _storage._repeatedForeignEnum} set {_uniqueStorage()._repeatedForeignEnum = newValue} } var repeatedStringPiece: [String] { get {return _storage._repeatedStringPiece} set {_uniqueStorage()._repeatedStringPiece = newValue} } var repeatedCord: [String] { get {return _storage._repeatedCord} set {_uniqueStorage()._repeatedCord = newValue} } var repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] { get {return _storage._repeatedLazyMessage} set {_uniqueStorage()._repeatedLazyMessage = newValue} } var oneofField: OneOf_OneofField? { get {return _storage._oneofField} set {_uniqueStorage()._oneofField = newValue} } var oneofUint32: UInt32 { get { if case .oneofUint32(let v)? = _storage._oneofField {return v} return 0 } set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} } var oneofNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage { get { if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} return Proto3ArenaUnittest_TestAllTypes.NestedMessage() } set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} } var oneofString: String { get { if case .oneofString(let v)? = _storage._oneofField {return v} return String() } set {_uniqueStorage()._oneofField = .oneofString(newValue)} } var oneofBytes: Data { get { if case .oneofBytes(let v)? = _storage._oneofField {return v} return SwiftProtobuf.Internal.emptyData } set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} } var unknownFields = SwiftProtobuf.UnknownStorage() enum OneOf_OneofField: Equatable { case oneofUint32(UInt32) case oneofNestedMessage(Proto3ArenaUnittest_TestAllTypes.NestedMessage) case oneofString(String) case oneofBytes(Data) #if !swift(>=4.1) static func ==(lhs: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField, rhs: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField) -> Bool { switch (lhs, rhs) { case (.oneofUint32(let l), .oneofUint32(let r)): return l == r case (.oneofNestedMessage(let l), .oneofNestedMessage(let r)): return l == r case (.oneofString(let l), .oneofString(let r)): return l == r case (.oneofBytes(let l), .oneofBytes(let r)): return l == r default: return false } } #endif } enum NestedEnum: SwiftProtobuf.Enum { typealias RawValue = Int case zero // = 0 case foo // = 1 case bar // = 2 case baz // = 3 /// Intentionally negative. case neg // = -1 case UNRECOGNIZED(Int) init() { self = .zero } init?(rawValue: Int) { switch rawValue { case -1: self = .neg case 0: self = .zero case 1: self = .foo case 2: self = .bar case 3: self = .baz default: self = .UNRECOGNIZED(rawValue) } } var rawValue: Int { switch self { case .neg: return -1 case .zero: return 0 case .foo: return 1 case .bar: return 2 case .baz: return 3 case .UNRECOGNIZED(let i): return i } } } struct NestedMessage { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// The field name "b" fails to compile in proto1 because it conflicts with /// a local variable named "b" in one of the generated methods. Doh. /// This file needs to compile in proto1 to test backwards-compatibility. var bb: Int32 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } init() {} fileprivate var _storage = _StorageClass.defaultInstance } #if swift(>=4.2) extension Proto3ArenaUnittest_TestAllTypes.NestedEnum: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. static var allCases: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [ .zero, .foo, .bar, .baz, .neg, ] } #endif // swift(>=4.2) struct Proto3ArenaUnittest_TestPackedTypes { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var packedInt32: [Int32] = [] var packedInt64: [Int64] = [] var packedUint32: [UInt32] = [] var packedUint64: [UInt64] = [] var packedSint32: [Int32] = [] var packedSint64: [Int64] = [] var packedFixed32: [UInt32] = [] var packedFixed64: [UInt64] = [] var packedSfixed32: [Int32] = [] var packedSfixed64: [Int64] = [] var packedFloat: [Float] = [] var packedDouble: [Double] = [] var packedBool: [Bool] = [] var packedEnum: [Proto3ArenaUnittest_ForeignEnum] = [] var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } /// Explicitly set packed to false struct Proto3ArenaUnittest_TestUnpackedTypes { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var repeatedInt32: [Int32] = [] var repeatedInt64: [Int64] = [] var repeatedUint32: [UInt32] = [] var repeatedUint64: [UInt64] = [] var repeatedSint32: [Int32] = [] var repeatedSint64: [Int64] = [] var repeatedFixed32: [UInt32] = [] var repeatedFixed64: [UInt64] = [] var repeatedSfixed32: [Int32] = [] var repeatedSfixed64: [Int64] = [] var repeatedFloat: [Float] = [] var repeatedDouble: [Double] = [] var repeatedBool: [Bool] = [] var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [] var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } /// This proto includes a recusively nested message. struct Proto3ArenaUnittest_NestedTestAllTypes { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var child: Proto3ArenaUnittest_NestedTestAllTypes { get {return _storage._child ?? Proto3ArenaUnittest_NestedTestAllTypes()} set {_uniqueStorage()._child = newValue} } /// Returns true if `child` has been explicitly set. var hasChild: Bool {return _storage._child != nil} /// Clears the value of `child`. Subsequent reads from it will return its default value. mutating func clearChild() {_uniqueStorage()._child = nil} var payload: Proto3ArenaUnittest_TestAllTypes { get {return _storage._payload ?? Proto3ArenaUnittest_TestAllTypes()} set {_uniqueStorage()._payload = newValue} } /// Returns true if `payload` has been explicitly set. var hasPayload: Bool {return _storage._payload != nil} /// Clears the value of `payload`. Subsequent reads from it will return its default value. mutating func clearPayload() {_uniqueStorage()._payload = nil} var repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] { get {return _storage._repeatedChild} set {_uniqueStorage()._repeatedChild = newValue} } var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _storage = _StorageClass.defaultInstance } /// Define these after TestAllTypes to make sure the compiler can handle /// that. struct Proto3ArenaUnittest_ForeignMessage { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var c: Int32 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } /// TestEmptyMessage is used to test behavior of unknown fields. struct Proto3ArenaUnittest_TestEmptyMessage { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "proto3_arena_unittest" extension Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "FOREIGN_ZERO"), 4: .same(proto: "FOREIGN_FOO"), 5: .same(proto: "FOREIGN_BAR"), 6: .same(proto: "FOREIGN_BAZ"), ] } extension Proto3ArenaUnittest_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".TestAllTypes" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "optional_int32"), 2: .standard(proto: "optional_int64"), 3: .standard(proto: "optional_uint32"), 4: .standard(proto: "optional_uint64"), 5: .standard(proto: "optional_sint32"), 6: .standard(proto: "optional_sint64"), 7: .standard(proto: "optional_fixed32"), 8: .standard(proto: "optional_fixed64"), 9: .standard(proto: "optional_sfixed32"), 10: .standard(proto: "optional_sfixed64"), 11: .standard(proto: "optional_float"), 12: .standard(proto: "optional_double"), 13: .standard(proto: "optional_bool"), 14: .standard(proto: "optional_string"), 15: .standard(proto: "optional_bytes"), 18: .standard(proto: "optional_nested_message"), 19: .standard(proto: "optional_foreign_message"), 20: .standard(proto: "optional_import_message"), 21: .standard(proto: "optional_nested_enum"), 22: .standard(proto: "optional_foreign_enum"), 24: .standard(proto: "optional_string_piece"), 25: .standard(proto: "optional_cord"), 26: .standard(proto: "optional_public_import_message"), 27: .standard(proto: "optional_lazy_message"), 115: .standard(proto: "optional_lazy_import_message"), 31: .standard(proto: "repeated_int32"), 32: .standard(proto: "repeated_int64"), 33: .standard(proto: "repeated_uint32"), 34: .standard(proto: "repeated_uint64"), 35: .standard(proto: "repeated_sint32"), 36: .standard(proto: "repeated_sint64"), 37: .standard(proto: "repeated_fixed32"), 38: .standard(proto: "repeated_fixed64"), 39: .standard(proto: "repeated_sfixed32"), 40: .standard(proto: "repeated_sfixed64"), 41: .standard(proto: "repeated_float"), 42: .standard(proto: "repeated_double"), 43: .standard(proto: "repeated_bool"), 44: .standard(proto: "repeated_string"), 45: .standard(proto: "repeated_bytes"), 48: .standard(proto: "repeated_nested_message"), 49: .standard(proto: "repeated_foreign_message"), 50: .standard(proto: "repeated_import_message"), 51: .standard(proto: "repeated_nested_enum"), 52: .standard(proto: "repeated_foreign_enum"), 54: .standard(proto: "repeated_string_piece"), 55: .standard(proto: "repeated_cord"), 57: .standard(proto: "repeated_lazy_message"), 111: .standard(proto: "oneof_uint32"), 112: .standard(proto: "oneof_nested_message"), 113: .standard(proto: "oneof_string"), 114: .standard(proto: "oneof_bytes"), ] fileprivate class _StorageClass { var _optionalInt32: Int32 = 0 var _optionalInt64: Int64 = 0 var _optionalUint32: UInt32 = 0 var _optionalUint64: UInt64 = 0 var _optionalSint32: Int32 = 0 var _optionalSint64: Int64 = 0 var _optionalFixed32: UInt32 = 0 var _optionalFixed64: UInt64 = 0 var _optionalSfixed32: Int32 = 0 var _optionalSfixed64: Int64 = 0 var _optionalFloat: Float = 0 var _optionalDouble: Double = 0 var _optionalBool: Bool = false var _optionalString: String = String() var _optionalBytes: Data = SwiftProtobuf.Internal.emptyData var _optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil var _optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage? = nil var _optionalImportMessage: ProtobufUnittestImport_ImportMessage? = nil var _optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum = .zero var _optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum = .foreignZero var _optionalStringPiece: String = String() var _optionalCord: String = String() var _optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage? = nil var _optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil var _optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage? = nil var _repeatedInt32: [Int32] = [] var _repeatedInt64: [Int64] = [] var _repeatedUint32: [UInt32] = [] var _repeatedUint64: [UInt64] = [] var _repeatedSint32: [Int32] = [] var _repeatedSint64: [Int64] = [] var _repeatedFixed32: [UInt32] = [] var _repeatedFixed64: [UInt64] = [] var _repeatedSfixed32: [Int32] = [] var _repeatedSfixed64: [Int64] = [] var _repeatedFloat: [Float] = [] var _repeatedDouble: [Double] = [] var _repeatedBool: [Bool] = [] var _repeatedString: [String] = [] var _repeatedBytes: [Data] = [] var _repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = [] var _repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] = [] var _repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] = [] var _repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [] var _repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] = [] var _repeatedStringPiece: [String] = [] var _repeatedCord: [String] = [] var _repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = [] var _oneofField: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField? static let defaultInstance = _StorageClass() private init() {} init(copying source: _StorageClass) { _optionalInt32 = source._optionalInt32 _optionalInt64 = source._optionalInt64 _optionalUint32 = source._optionalUint32 _optionalUint64 = source._optionalUint64 _optionalSint32 = source._optionalSint32 _optionalSint64 = source._optionalSint64 _optionalFixed32 = source._optionalFixed32 _optionalFixed64 = source._optionalFixed64 _optionalSfixed32 = source._optionalSfixed32 _optionalSfixed64 = source._optionalSfixed64 _optionalFloat = source._optionalFloat _optionalDouble = source._optionalDouble _optionalBool = source._optionalBool _optionalString = source._optionalString _optionalBytes = source._optionalBytes _optionalNestedMessage = source._optionalNestedMessage _optionalForeignMessage = source._optionalForeignMessage _optionalImportMessage = source._optionalImportMessage _optionalNestedEnum = source._optionalNestedEnum _optionalForeignEnum = source._optionalForeignEnum _optionalStringPiece = source._optionalStringPiece _optionalCord = source._optionalCord _optionalPublicImportMessage = source._optionalPublicImportMessage _optionalLazyMessage = source._optionalLazyMessage _optionalLazyImportMessage = source._optionalLazyImportMessage _repeatedInt32 = source._repeatedInt32 _repeatedInt64 = source._repeatedInt64 _repeatedUint32 = source._repeatedUint32 _repeatedUint64 = source._repeatedUint64 _repeatedSint32 = source._repeatedSint32 _repeatedSint64 = source._repeatedSint64 _repeatedFixed32 = source._repeatedFixed32 _repeatedFixed64 = source._repeatedFixed64 _repeatedSfixed32 = source._repeatedSfixed32 _repeatedSfixed64 = source._repeatedSfixed64 _repeatedFloat = source._repeatedFloat _repeatedDouble = source._repeatedDouble _repeatedBool = source._repeatedBool _repeatedString = source._repeatedString _repeatedBytes = source._repeatedBytes _repeatedNestedMessage = source._repeatedNestedMessage _repeatedForeignMessage = source._repeatedForeignMessage _repeatedImportMessage = source._repeatedImportMessage _repeatedNestedEnum = source._repeatedNestedEnum _repeatedForeignEnum = source._repeatedForeignEnum _repeatedStringPiece = source._repeatedStringPiece _repeatedCord = source._repeatedCord _repeatedLazyMessage = source._repeatedLazyMessage _oneofField = source._oneofField } } fileprivate mutating func _uniqueStorage() -> _StorageClass { if !isKnownUniquelyReferenced(&_storage) { _storage = _StorageClass(copying: _storage) } return _storage } mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { _ = _uniqueStorage() try withExtendedLifetime(_storage) { (_storage: _StorageClass) in while let fieldNumber = try decoder.nextFieldNumber() { switch fieldNumber { case 1: try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) case 2: try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) case 3: try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) case 4: try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) case 5: try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) case 6: try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) case 7: try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) case 8: try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) case 9: try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) case 10: try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) case 11: try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) case 12: try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) case 13: try decoder.decodeSingularBoolField(value: &_storage._optionalBool) case 14: try decoder.decodeSingularStringField(value: &_storage._optionalString) case 15: try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) case 18: try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) case 19: try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) case 20: try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage) case 21: try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) case 22: try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) case 24: try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) case 25: try decoder.decodeSingularStringField(value: &_storage._optionalCord) case 26: try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage) case 27: try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) case 31: try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) case 32: try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) case 33: try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) case 34: try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) case 35: try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) case 36: try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) case 37: try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) case 38: try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) case 39: try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) case 40: try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) case 41: try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) case 42: try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) case 43: try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) case 44: try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) case 45: try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) case 48: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) case 49: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) case 50: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage) case 51: try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) case 52: try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) case 54: try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) case 55: try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) case 57: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) case 111: if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} var v: UInt32? try decoder.decodeSingularUInt32Field(value: &v) if let v = v {_storage._oneofField = .oneofUint32(v)} case 112: var v: Proto3ArenaUnittest_TestAllTypes.NestedMessage? if let current = _storage._oneofField { try decoder.handleConflictingOneOf() if case .oneofNestedMessage(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) if let v = v {_storage._oneofField = .oneofNestedMessage(v)} case 113: if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} var v: String? try decoder.decodeSingularStringField(value: &v) if let v = v {_storage._oneofField = .oneofString(v)} case 114: if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} var v: Data? try decoder.decodeSingularBytesField(value: &v) if let v = v {_storage._oneofField = .oneofBytes(v)} case 115: try decoder.decodeSingularMessageField(value: &_storage._optionalLazyImportMessage) default: break } } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in if _storage._optionalInt32 != 0 { try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1) } if _storage._optionalInt64 != 0 { try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2) } if _storage._optionalUint32 != 0 { try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3) } if _storage._optionalUint64 != 0 { try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4) } if _storage._optionalSint32 != 0 { try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5) } if _storage._optionalSint64 != 0 { try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6) } if _storage._optionalFixed32 != 0 { try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7) } if _storage._optionalFixed64 != 0 { try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8) } if _storage._optionalSfixed32 != 0 { try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9) } if _storage._optionalSfixed64 != 0 { try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10) } if _storage._optionalFloat != 0 { try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11) } if _storage._optionalDouble != 0 { try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12) } if _storage._optionalBool != false { try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13) } if !_storage._optionalString.isEmpty { try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14) } if !_storage._optionalBytes.isEmpty { try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15) } if let v = _storage._optionalNestedMessage { try visitor.visitSingularMessageField(value: v, fieldNumber: 18) } if let v = _storage._optionalForeignMessage { try visitor.visitSingularMessageField(value: v, fieldNumber: 19) } if let v = _storage._optionalImportMessage { try visitor.visitSingularMessageField(value: v, fieldNumber: 20) } if _storage._optionalNestedEnum != .zero { try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21) } if _storage._optionalForeignEnum != .foreignZero { try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22) } if !_storage._optionalStringPiece.isEmpty { try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24) } if !_storage._optionalCord.isEmpty { try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25) } if let v = _storage._optionalPublicImportMessage { try visitor.visitSingularMessageField(value: v, fieldNumber: 26) } if let v = _storage._optionalLazyMessage { try visitor.visitSingularMessageField(value: v, fieldNumber: 27) } if !_storage._repeatedInt32.isEmpty { try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) } if !_storage._repeatedInt64.isEmpty { try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) } if !_storage._repeatedUint32.isEmpty { try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) } if !_storage._repeatedUint64.isEmpty { try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) } if !_storage._repeatedSint32.isEmpty { try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) } if !_storage._repeatedSint64.isEmpty { try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) } if !_storage._repeatedFixed32.isEmpty { try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) } if !_storage._repeatedFixed64.isEmpty { try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) } if !_storage._repeatedSfixed32.isEmpty { try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) } if !_storage._repeatedSfixed64.isEmpty { try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) } if !_storage._repeatedFloat.isEmpty { try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) } if !_storage._repeatedDouble.isEmpty { try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) } if !_storage._repeatedBool.isEmpty { try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43) } if !_storage._repeatedString.isEmpty { try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) } if !_storage._repeatedBytes.isEmpty { try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) } if !_storage._repeatedNestedMessage.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) } if !_storage._repeatedForeignMessage.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) } if !_storage._repeatedImportMessage.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50) } if !_storage._repeatedNestedEnum.isEmpty { try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) } if !_storage._repeatedForeignEnum.isEmpty { try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) } if !_storage._repeatedStringPiece.isEmpty { try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) } if !_storage._repeatedCord.isEmpty { try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) } if !_storage._repeatedLazyMessage.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57) } switch _storage._oneofField { case .oneofUint32(let v)?: try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) case .oneofNestedMessage(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 112) case .oneofString(let v)?: try visitor.visitSingularStringField(value: v, fieldNumber: 113) case .oneofBytes(let v)?: try visitor.visitSingularBytesField(value: v, fieldNumber: 114) case nil: break } if let v = _storage._optionalLazyImportMessage { try visitor.visitSingularMessageField(value: v, fieldNumber: 115) } } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Proto3ArenaUnittest_TestAllTypes, rhs: Proto3ArenaUnittest_TestAllTypes) -> Bool { if lhs._storage !== rhs._storage { let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in let _storage = _args.0 let rhs_storage = _args.1 if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} if _storage._optionalFloat != rhs_storage._optionalFloat {return false} if _storage._optionalDouble != rhs_storage._optionalDouble {return false} if _storage._optionalBool != rhs_storage._optionalBool {return false} if _storage._optionalString != rhs_storage._optionalString {return false} if _storage._optionalBytes != rhs_storage._optionalBytes {return false} if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false} if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} if _storage._optionalCord != rhs_storage._optionalCord {return false} if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false} if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false} if _storage._optionalLazyImportMessage != rhs_storage._optionalLazyImportMessage {return false} if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} if _storage._repeatedBool != rhs_storage._repeatedBool {return false} if _storage._repeatedString != rhs_storage._repeatedString {return false} if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false} if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} if _storage._repeatedCord != rhs_storage._repeatedCord {return false} if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false} if _storage._oneofField != rhs_storage._oneofField {return false} return true } if !storagesAreEqual {return false} } if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Proto3ArenaUnittest_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ -1: .same(proto: "NEG"), 0: .same(proto: "ZERO"), 1: .same(proto: "FOO"), 2: .same(proto: "BAR"), 3: .same(proto: "BAZ"), ] } extension Proto3ArenaUnittest_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Proto3ArenaUnittest_TestAllTypes.protoMessageName + ".NestedMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "bb"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { switch fieldNumber { case 1: try decoder.decodeSingularInt32Field(value: &self.bb) default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if self.bb != 0 { try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage, rhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage) -> Bool { if lhs.bb != rhs.bb {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Proto3ArenaUnittest_TestPackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".TestPackedTypes" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 90: .standard(proto: "packed_int32"), 91: .standard(proto: "packed_int64"), 92: .standard(proto: "packed_uint32"), 93: .standard(proto: "packed_uint64"), 94: .standard(proto: "packed_sint32"), 95: .standard(proto: "packed_sint64"), 96: .standard(proto: "packed_fixed32"), 97: .standard(proto: "packed_fixed64"), 98: .standard(proto: "packed_sfixed32"), 99: .standard(proto: "packed_sfixed64"), 100: .standard(proto: "packed_float"), 101: .standard(proto: "packed_double"), 102: .standard(proto: "packed_bool"), 103: .standard(proto: "packed_enum"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { switch fieldNumber { case 90: try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) case 91: try decoder.decodeRepeatedInt64Field(value: &self.packedInt64) case 92: try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32) case 93: try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64) case 94: try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32) case 95: try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64) case 96: try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32) case 97: try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64) case 98: try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32) case 99: try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64) case 100: try decoder.decodeRepeatedFloatField(value: &self.packedFloat) case 101: try decoder.decodeRepeatedDoubleField(value: &self.packedDouble) case 102: try decoder.decodeRepeatedBoolField(value: &self.packedBool) case 103: try decoder.decodeRepeatedEnumField(value: &self.packedEnum) default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if !self.packedInt32.isEmpty { try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90) } if !self.packedInt64.isEmpty { try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91) } if !self.packedUint32.isEmpty { try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92) } if !self.packedUint64.isEmpty { try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93) } if !self.packedSint32.isEmpty { try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94) } if !self.packedSint64.isEmpty { try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95) } if !self.packedFixed32.isEmpty { try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96) } if !self.packedFixed64.isEmpty { try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97) } if !self.packedSfixed32.isEmpty { try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98) } if !self.packedSfixed64.isEmpty { try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99) } if !self.packedFloat.isEmpty { try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100) } if !self.packedDouble.isEmpty { try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101) } if !self.packedBool.isEmpty { try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102) } if !self.packedEnum.isEmpty { try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Proto3ArenaUnittest_TestPackedTypes, rhs: Proto3ArenaUnittest_TestPackedTypes) -> Bool { if lhs.packedInt32 != rhs.packedInt32 {return false} if lhs.packedInt64 != rhs.packedInt64 {return false} if lhs.packedUint32 != rhs.packedUint32 {return false} if lhs.packedUint64 != rhs.packedUint64 {return false} if lhs.packedSint32 != rhs.packedSint32 {return false} if lhs.packedSint64 != rhs.packedSint64 {return false} if lhs.packedFixed32 != rhs.packedFixed32 {return false} if lhs.packedFixed64 != rhs.packedFixed64 {return false} if lhs.packedSfixed32 != rhs.packedSfixed32 {return false} if lhs.packedSfixed64 != rhs.packedSfixed64 {return false} if lhs.packedFloat != rhs.packedFloat {return false} if lhs.packedDouble != rhs.packedDouble {return false} if lhs.packedBool != rhs.packedBool {return false} if lhs.packedEnum != rhs.packedEnum {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Proto3ArenaUnittest_TestUnpackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".TestUnpackedTypes" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "repeated_int32"), 2: .standard(proto: "repeated_int64"), 3: .standard(proto: "repeated_uint32"), 4: .standard(proto: "repeated_uint64"), 5: .standard(proto: "repeated_sint32"), 6: .standard(proto: "repeated_sint64"), 7: .standard(proto: "repeated_fixed32"), 8: .standard(proto: "repeated_fixed64"), 9: .standard(proto: "repeated_sfixed32"), 10: .standard(proto: "repeated_sfixed64"), 11: .standard(proto: "repeated_float"), 12: .standard(proto: "repeated_double"), 13: .standard(proto: "repeated_bool"), 14: .standard(proto: "repeated_nested_enum"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { switch fieldNumber { case 1: try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) case 2: try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64) case 3: try decoder.decodeRepeatedUInt32Field(value: &self.repeatedUint32) case 4: try decoder.decodeRepeatedUInt64Field(value: &self.repeatedUint64) case 5: try decoder.decodeRepeatedSInt32Field(value: &self.repeatedSint32) case 6: try decoder.decodeRepeatedSInt64Field(value: &self.repeatedSint64) case 7: try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) case 8: try decoder.decodeRepeatedFixed64Field(value: &self.repeatedFixed64) case 9: try decoder.decodeRepeatedSFixed32Field(value: &self.repeatedSfixed32) case 10: try decoder.decodeRepeatedSFixed64Field(value: &self.repeatedSfixed64) case 11: try decoder.decodeRepeatedFloatField(value: &self.repeatedFloat) case 12: try decoder.decodeRepeatedDoubleField(value: &self.repeatedDouble) case 13: try decoder.decodeRepeatedBoolField(value: &self.repeatedBool) case 14: try decoder.decodeRepeatedEnumField(value: &self.repeatedNestedEnum) default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if !self.repeatedInt32.isEmpty { try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 1) } if !self.repeatedInt64.isEmpty { try visitor.visitRepeatedInt64Field(value: self.repeatedInt64, fieldNumber: 2) } if !self.repeatedUint32.isEmpty { try visitor.visitRepeatedUInt32Field(value: self.repeatedUint32, fieldNumber: 3) } if !self.repeatedUint64.isEmpty { try visitor.visitRepeatedUInt64Field(value: self.repeatedUint64, fieldNumber: 4) } if !self.repeatedSint32.isEmpty { try visitor.visitRepeatedSInt32Field(value: self.repeatedSint32, fieldNumber: 5) } if !self.repeatedSint64.isEmpty { try visitor.visitRepeatedSInt64Field(value: self.repeatedSint64, fieldNumber: 6) } if !self.repeatedFixed32.isEmpty { try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 7) } if !self.repeatedFixed64.isEmpty { try visitor.visitRepeatedFixed64Field(value: self.repeatedFixed64, fieldNumber: 8) } if !self.repeatedSfixed32.isEmpty { try visitor.visitRepeatedSFixed32Field(value: self.repeatedSfixed32, fieldNumber: 9) } if !self.repeatedSfixed64.isEmpty { try visitor.visitRepeatedSFixed64Field(value: self.repeatedSfixed64, fieldNumber: 10) } if !self.repeatedFloat.isEmpty { try visitor.visitRepeatedFloatField(value: self.repeatedFloat, fieldNumber: 11) } if !self.repeatedDouble.isEmpty { try visitor.visitRepeatedDoubleField(value: self.repeatedDouble, fieldNumber: 12) } if !self.repeatedBool.isEmpty { try visitor.visitRepeatedBoolField(value: self.repeatedBool, fieldNumber: 13) } if !self.repeatedNestedEnum.isEmpty { try visitor.visitRepeatedEnumField(value: self.repeatedNestedEnum, fieldNumber: 14) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Proto3ArenaUnittest_TestUnpackedTypes, rhs: Proto3ArenaUnittest_TestUnpackedTypes) -> Bool { if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} if lhs.repeatedInt64 != rhs.repeatedInt64 {return false} if lhs.repeatedUint32 != rhs.repeatedUint32 {return false} if lhs.repeatedUint64 != rhs.repeatedUint64 {return false} if lhs.repeatedSint32 != rhs.repeatedSint32 {return false} if lhs.repeatedSint64 != rhs.repeatedSint64 {return false} if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false} if lhs.repeatedFixed64 != rhs.repeatedFixed64 {return false} if lhs.repeatedSfixed32 != rhs.repeatedSfixed32 {return false} if lhs.repeatedSfixed64 != rhs.repeatedSfixed64 {return false} if lhs.repeatedFloat != rhs.repeatedFloat {return false} if lhs.repeatedDouble != rhs.repeatedDouble {return false} if lhs.repeatedBool != rhs.repeatedBool {return false} if lhs.repeatedNestedEnum != rhs.repeatedNestedEnum {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Proto3ArenaUnittest_NestedTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".NestedTestAllTypes" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "child"), 2: .same(proto: "payload"), 3: .standard(proto: "repeated_child"), ] fileprivate class _StorageClass { var _child: Proto3ArenaUnittest_NestedTestAllTypes? = nil var _payload: Proto3ArenaUnittest_TestAllTypes? = nil var _repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] = [] static let defaultInstance = _StorageClass() private init() {} init(copying source: _StorageClass) { _child = source._child _payload = source._payload _repeatedChild = source._repeatedChild } } fileprivate mutating func _uniqueStorage() -> _StorageClass { if !isKnownUniquelyReferenced(&_storage) { _storage = _StorageClass(copying: _storage) } return _storage } mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { _ = _uniqueStorage() try withExtendedLifetime(_storage) { (_storage: _StorageClass) in while let fieldNumber = try decoder.nextFieldNumber() { switch fieldNumber { case 1: try decoder.decodeSingularMessageField(value: &_storage._child) case 2: try decoder.decodeSingularMessageField(value: &_storage._payload) case 3: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedChild) default: break } } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in if let v = _storage._child { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } if let v = _storage._payload { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } if !_storage._repeatedChild.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._repeatedChild, fieldNumber: 3) } } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Proto3ArenaUnittest_NestedTestAllTypes, rhs: Proto3ArenaUnittest_NestedTestAllTypes) -> Bool { if lhs._storage !== rhs._storage { let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in let _storage = _args.0 let rhs_storage = _args.1 if _storage._child != rhs_storage._child {return false} if _storage._payload != rhs_storage._payload {return false} if _storage._repeatedChild != rhs_storage._repeatedChild {return false} return true } if !storagesAreEqual {return false} } if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Proto3ArenaUnittest_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ForeignMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "c"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { switch fieldNumber { case 1: try decoder.decodeSingularInt32Field(value: &self.c) default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if self.c != 0 { try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Proto3ArenaUnittest_ForeignMessage, rhs: Proto3ArenaUnittest_ForeignMessage) -> Bool { if lhs.c != rhs.c {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Proto3ArenaUnittest_TestEmptyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".TestEmptyMessage" static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let _ = try decoder.nextFieldNumber() { } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Proto3ArenaUnittest_TestEmptyMessage, rhs: Proto3ArenaUnittest_TestEmptyMessage) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } }
{ "pile_set_name": "Github" }
/* Copyright 2018 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. */ // +k8s:deepcopy-gen=package // +k8s:protobuf-gen=package // +k8s:openapi-gen=true // +groupName=coordination.k8s.io package v1 // import "k8s.io/api/coordination/v1"
{ "pile_set_name": "Github" }
/** * 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 org.activiti.designer.validation.bpmn20.bundle; /** * Plugin constants for the org.activiti.designer.validation.bpmn20 bundle. * * @author Tiese Barrell * @version 1 * @since 5.6 * */ public final class PluginConstants { public static final String VALIDATOR_ID = "com.atosorigin.esuite.editor.process.validation.ESuiteProcessValidator"; public static final String VALIDATOR_NAME = "E-Suite Process Validator"; public static final String FORMAT_NAME = "E-Suite ZaakType jPDL"; public static final String MARKER_MESSAGE_PATTERN = "[%s] %s"; public static final int WORK_CLEAR_MARKERS = 5; public static final int WORK_EXTRACT_CONSTRUCTS = 20; public static final int WORK_USER_TASK = 10; public static final int WORK_SCRIPT_TASK = 10; public static final int WORK_SERVICE_TASK = 10; public static final int WORK_SEQUENCE_FLOW = 10; public static final int WORK_SUB_PROCESS = 10; public static final int WORK_TOTAL = WORK_CLEAR_MARKERS + WORK_EXTRACT_CONSTRUCTS + WORK_USER_TASK + WORK_SCRIPT_TASK + WORK_SERVICE_TASK + WORK_SEQUENCE_FLOW + WORK_SUB_PROCESS; }
{ "pile_set_name": "Github" }
; ; Definition file of CRYPTCATSVC.dll ; Automatic generated by gendef ; written by Kai Tietz 2008-2014 ; LIBRARY "CRYPTCATSVC.dll" EXPORTS CryptsvcDllCtrl
{ "pile_set_name": "Github" }
/* * Copyright (C) 2014 Saravan Pantham * * 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 com.psaravan.filebrowserview.lib.AsyncTasks; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.AsyncTask; import android.widget.Toast; import com.psaravan.filebrowserview.lib.Interfaces.MoveInterface; import com.psaravan.filebrowserview.lib.R; import org.apache.commons.io.FileUtils; import java.io.File; /** * AsyncTask that moves the specified file/folder recursively to a new location. * * @author Saravan Pantham */ public class AsyncMoveTask extends AsyncTask<String, Void, Boolean> { private Context mContext; private ProgressDialog pd; private File mSourceFile; private File mDestDirFile; private boolean mShowProgress = true; private MoveInterface mMoveInterface; public AsyncMoveTask(Context context, File source, File destDir, boolean showProgress) { mContext = context; mSourceFile = source; mShowProgress = showProgress; mDestDirFile = destDir; } @Override protected void onPreExecute() { if (mSourceFile==null) return; //Skip the rest of this method if the user doesn't want a progress dialog. if (!mShowProgress) return; pd = new ProgressDialog(mContext); pd.setCancelable(false); pd.setIndeterminate(false); pd.setTitle(R.string.move); pd.setMessage(mContext.getResources().getString(R.string.moving) + " " + mSourceFile.getName()); pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources() .getString(R.string.run_in_background), new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { pd.dismiss(); } }); pd.show(); if (mMoveInterface!=null) mMoveInterface.preMoveStartSync(); } @Override protected Boolean doInBackground(String... params) { if (mMoveInterface!=null) mMoveInterface.preMoveStartAsync(); if (mSourceFile==null || mDestDirFile==null) { if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(false); return false; } if (mSourceFile.isDirectory()) { try { FileUtils.moveDirectory(mSourceFile, mDestDirFile); } catch (Exception e) { if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(false); return false; } } else { try { FileUtils.moveFile(mSourceFile, mDestDirFile); } catch (Exception e) { if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(false); return false; } } if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(true); return true; } @Override protected void onPostExecute(Boolean result) { super.onPostExecute(result); if (mMoveInterface!=null) mMoveInterface.onMoveCompleteSync(result); if (pd!=null) pd.dismiss(); if (result==true) { String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.moved); Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show(); } else { String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.could_not_be_moved); Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show(); } } /** * @param moveInterface The move interface instance to attach to this * AsyncTask. */ public void setMoveInterface(MoveInterface moveInterface) { mMoveInterface = moveInterface; } }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF 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. */ drop dataverse test if exists; create dataverse test; use test; create type test.MyRecord as { id : bigint, point : point, kwds : string }; create external dataset MyData(MyRecord) using localfs((`path`=`asterix_nc1://data/spatial/spatialData.json`),(`format`=`adm`));
{ "pile_set_name": "Github" }
<!-- ~ Copyright 2019. Google LLC ~ ~ 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 ~ ~ https://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. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/bg_blue" android:orientation="vertical" android:padding="20dp" tools:context="com.google.android.apps.santatracker.dasherdancer.CharacterActivity" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" > <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageButton android:id="@+id/btn_character_santa" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="bottom" android:src="@drawable/santa" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" > <ImageButton android:id="@+id/btn_character_elf" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="center" android:src="@drawable/elf" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageButton android:id="@+id/btn_character_reindeer" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="center" android:src="@drawable/reindeer" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" > <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageButton android:id="@+id/btn_character_snowman" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="top" android:src="@drawable/snowman" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> </LinearLayout> </LinearLayout>
{ "pile_set_name": "Github" }
# 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. # -------------------------------------------------------------------------- from msrest.serialization import Model class StorageProfile(Model): """Storage Profile properties of a server. :param backup_retention_days: Backup retention days for the server. :type backup_retention_days: int :param geo_redundant_backup: Enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled' :type geo_redundant_backup: str or ~azure.mgmt.rdbms.mariadb.models.GeoRedundantBackup :param storage_mb: Max storage allowed for a server. :type storage_mb: int """ _attribute_map = { 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, 'storage_mb': {'key': 'storageMB', 'type': 'int'}, } def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None: super(StorageProfile, self).__init__(**kwargs) self.backup_retention_days = backup_retention_days self.geo_redundant_backup = geo_redundant_backup self.storage_mb = storage_mb
{ "pile_set_name": "Github" }
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
7