scalapb / ScalaPB

Protocol buffer compiler for Scala.
https://scalapb.github.io/
Apache License 2.0
1.31k stars 285 forks source link

Nested class for generated wrapper can not be found. #103

Closed zekefast closed 8 years ago

zekefast commented 8 years ago

Overview

I tried to google and investigate this issues by myself, but that not lead me to anything reasonable. Also I quite new to Scala and Spark, so it could be something dummy, but very appreciate any help!

I tried to generate wrappers using ScalaPB for cake protobuf definitions.

Everything seems working perfectly except one thing. When I tried to access data using cakeproto.affiliates.Affiliate class for affiliate it gives me follow error.

info]     java.lang.ClassNotFoundException: cakeproto.affiliates.Affiliate.PaymentType
[info]     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[info]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[info]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[info]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[info]     at java.lang.Class.forName0(Native Method)
[info]     at java.lang.Class.forName(Class.java:348)
[info]     at org.apache.spark.util.Utils$.classForName(Utils.scala:174)
[info]     at org.apache.spark.sql.catalyst.ScalaReflection$.org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor(ScalaReflection.scala:477)
[info]     at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$9.apply(ScalaReflection.scala:494)
[info]     at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$9.apply(ScalaReflection.scala:490)

In a short it can not find nested cakeproto.affiliates.Affiliate.PaymentType somehow.

Details

Here is generated Affiliate wrapper .

// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2

package cakeproto.affiliates

@SerialVersionUID(0L)
final case class Affiliate(
    id: Option[Long] = None,
    name: Option[String] = None,
    tier: Option[cakeproto.common.IdName] = None,
    accountManager: Option[cakeproto.common.IdName] = None,
    accountStatus: Option[cakeproto.common.IdName] = None,
    street1: Option[String] = None,
    street2: Option[String] = None,
    city: Option[String] = None,
    state: Option[String] = None,
    zipCode: Option[String] = None,
    country: Option[String] = None,
    website: Option[String] = None,
    paymentType: Option[cakeproto.affiliates.Affiliate.PaymentType] = None,
    contacts: Seq[cakeproto.common.Contact] = Nil,
    tags: Seq[cakeproto.common.IdName] = Nil,
    trafficPriceFormats: Seq[cakeproto.common.IdName] = Nil,
    trafficMediaTypes: Seq[cakeproto.common.MediaType] = Nil,
    trafficVerticalCategories: Seq[cakeproto.common.IdName] = Nil,
    trafficCountries: Seq[cakeproto.common.Country] = Nil,
    minimumPaymentThreshold: Option[Double] = None,
    autoPaymentFee: Option[Double] = None,
    paymentTo: Option[String] = None,
    taxClass: Option[String] = None,
    ssnTaxId: Option[String] = None,
    payVat: Option[Boolean] = None,
    swiftIban: Option[String] = None,
    referralsEnabled: Option[Boolean] = None,
    referredByAffiliate: Option[cakeproto.common.IdName] = None,
    referralInfo: Option[String] = None,
    billingCycle: Option[cakeproto.common.IdName] = None,
    currency: Option[cakeproto.common.Currency] = None,
    currencyPaymentSetting: Option[cakeproto.common.IdName] = None,
    onlineSignup: Option[Boolean] = None,
    payForConversions: Option[Boolean] = None,
    review: Option[Boolean] = None,
    reviewNewSubaffiliates: Option[Boolean] = None,
    suppression: Option[Boolean] = None,
    pixelInfo: Option[cakeproto.common.PixelInfo] = None,
    fireGlobalPixel: Option[Boolean] = None,
    blacklists: Seq[cakeproto.common.Blacklist] = Nil,
    redirectDomainOverride: Option[String] = None,
    autoApproveCampaigns: Option[Boolean] = None,
    autoApprovePixels: Option[Boolean] = None,
    hideOffers: Option[Boolean] = None,
    dateCreated: Option[cakeproto.common.TimeWithZone] = None,
    notes: Option[String] = None
    ) extends com.trueaccord.scalapb.GeneratedMessage with com.trueaccord.scalapb.Message[Affiliate] with com.trueaccord.lenses.Updatable[Affiliate] {
    @transient
    lazy val serializedSize: Int = {
      var __size = 0
      if (id.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id.get) }
      if (name.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(2, name.get) }
      if (tier.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(tier.get.serializedSize) + tier.get.serializedSize }
      if (accountManager.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(accountManager.get.serializedSize) + accountManager.get.serializedSize }
      if (accountStatus.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(accountStatus.get.serializedSize) + accountStatus.get.serializedSize }
      if (street1.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(6, street1.get) }
      if (street2.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(7, street2.get) }
      if (city.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(8, city.get) }
      if (state.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(9, state.get) }
      if (zipCode.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(10, zipCode.get) }
      if (country.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(11, country.get) }
      if (website.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(12, website.get) }
      if (paymentType.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(paymentType.get.serializedSize) + paymentType.get.serializedSize }
      contacts.foreach(contacts => __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(contacts.serializedSize) + contacts.serializedSize)
      tags.foreach(tags => __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(tags.serializedSize) + tags.serializedSize)
      trafficPriceFormats.foreach(trafficPriceFormats => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficPriceFormats.serializedSize) + trafficPriceFormats.serializedSize)
      trafficMediaTypes.foreach(trafficMediaTypes => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficMediaTypes.serializedSize) + trafficMediaTypes.serializedSize)
      trafficVerticalCategories.foreach(trafficVerticalCategories => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficVerticalCategories.serializedSize) + trafficVerticalCategories.serializedSize)
      trafficCountries.foreach(trafficCountries => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficCountries.serializedSize) + trafficCountries.serializedSize)
      if (minimumPaymentThreshold.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeDoubleSize(20, minimumPaymentThreshold.get) }
      if (autoPaymentFee.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeDoubleSize(21, autoPaymentFee.get) }
      if (paymentTo.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(22, paymentTo.get) }
      if (taxClass.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(23, taxClass.get) }
      if (ssnTaxId.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(24, ssnTaxId.get) }
      if (payVat.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(25, payVat.get) }
      if (swiftIban.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(26, swiftIban.get) }
      if (referralsEnabled.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(27, referralsEnabled.get) }
      if (referredByAffiliate.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(referredByAffiliate.get.serializedSize) + referredByAffiliate.get.serializedSize }
      if (referralInfo.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(29, referralInfo.get) }
      if (billingCycle.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(billingCycle.get.serializedSize) + billingCycle.get.serializedSize }
      if (currency.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(currency.get.serializedSize) + currency.get.serializedSize }
      if (currencyPaymentSetting.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(currencyPaymentSetting.get.serializedSize) + currencyPaymentSetting.get.serializedSize }
      if (onlineSignup.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(33, onlineSignup.get) }
      if (payForConversions.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(34, payForConversions.get) }
      if (review.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(35, review.get) }
      if (reviewNewSubaffiliates.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(36, reviewNewSubaffiliates.get) }
      if (suppression.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(37, suppression.get) }
      if (pixelInfo.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(pixelInfo.get.serializedSize) + pixelInfo.get.serializedSize }
      if (fireGlobalPixel.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(39, fireGlobalPixel.get) }
      blacklists.foreach(blacklists => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(blacklists.serializedSize) + blacklists.serializedSize)
      if (redirectDomainOverride.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(41, redirectDomainOverride.get) }
      if (autoApproveCampaigns.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(42, autoApproveCampaigns.get) }
      if (autoApprovePixels.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(43, autoApprovePixels.get) }
      if (hideOffers.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(44, hideOffers.get) }
      if (dateCreated.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(dateCreated.get.serializedSize) + dateCreated.get.serializedSize }
      if (notes.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(46, notes.get) }
      __size
    }
    def writeTo(output: com.google.protobuf.CodedOutputStream): Unit = {
      id.foreach { __v => 
        output.writeInt64(1, __v)
      };
      name.foreach { __v => 
        output.writeString(2, __v)
      };
      tier.foreach { __v => 
        output.writeTag(3, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      accountManager.foreach { __v => 
        output.writeTag(4, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      accountStatus.foreach { __v => 
        output.writeTag(5, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      street1.foreach { __v => 
        output.writeString(6, __v)
      };
      street2.foreach { __v => 
        output.writeString(7, __v)
      };
      city.foreach { __v => 
        output.writeString(8, __v)
      };
      state.foreach { __v => 
        output.writeString(9, __v)
      };
      zipCode.foreach { __v => 
        output.writeString(10, __v)
      };
      country.foreach { __v => 
        output.writeString(11, __v)
      };
      website.foreach { __v => 
        output.writeString(12, __v)
      };
      paymentType.foreach { __v => 
        output.writeTag(13, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      contacts.foreach { __v => 
        output.writeTag(14, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      tags.foreach { __v => 
        output.writeTag(15, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficPriceFormats.foreach { __v => 
        output.writeTag(16, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficMediaTypes.foreach { __v => 
        output.writeTag(17, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficVerticalCategories.foreach { __v => 
        output.writeTag(18, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficCountries.foreach { __v => 
        output.writeTag(19, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      minimumPaymentThreshold.foreach { __v => 
        output.writeDouble(20, __v)
      };
      autoPaymentFee.foreach { __v => 
        output.writeDouble(21, __v)
      };
      paymentTo.foreach { __v => 
        output.writeString(22, __v)
      };
      taxClass.foreach { __v => 
        output.writeString(23, __v)
      };
      ssnTaxId.foreach { __v => 
        output.writeString(24, __v)
      };
      payVat.foreach { __v => 
        output.writeBool(25, __v)
      };
      swiftIban.foreach { __v => 
        output.writeString(26, __v)
      };
      referralsEnabled.foreach { __v => 
        output.writeBool(27, __v)
      };
      referredByAffiliate.foreach { __v => 
        output.writeTag(28, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      referralInfo.foreach { __v => 
        output.writeString(29, __v)
      };
      billingCycle.foreach { __v => 
        output.writeTag(30, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      currency.foreach { __v => 
        output.writeTag(31, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      currencyPaymentSetting.foreach { __v => 
        output.writeTag(32, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      onlineSignup.foreach { __v => 
        output.writeBool(33, __v)
      };
      payForConversions.foreach { __v => 
        output.writeBool(34, __v)
      };
      review.foreach { __v => 
        output.writeBool(35, __v)
      };
      reviewNewSubaffiliates.foreach { __v => 
        output.writeBool(36, __v)
      };
      suppression.foreach { __v => 
        output.writeBool(37, __v)
      };
      pixelInfo.foreach { __v => 
        output.writeTag(38, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      fireGlobalPixel.foreach { __v => 
        output.writeBool(39, __v)
      };
      blacklists.foreach { __v => 
        output.writeTag(40, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      redirectDomainOverride.foreach { __v => 
        output.writeString(41, __v)
      };
      autoApproveCampaigns.foreach { __v => 
        output.writeBool(42, __v)
      };
      autoApprovePixels.foreach { __v => 
        output.writeBool(43, __v)
      };
      hideOffers.foreach { __v => 
        output.writeBool(44, __v)
      };
      dateCreated.foreach { __v => 
        output.writeTag(45, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      notes.foreach { __v => 
        output.writeString(46, __v)
      };
    }
    def mergeFrom(__input: com.google.protobuf.CodedInputStream): cakeproto.affiliates.Affiliate = {
      var __id = this.id
      var __name = this.name
      var __tier = this.tier
      var __accountManager = this.accountManager
      var __accountStatus = this.accountStatus
      var __street1 = this.street1
      var __street2 = this.street2
      var __city = this.city
      var __state = this.state
      var __zipCode = this.zipCode
      var __country = this.country
      var __website = this.website
      var __paymentType = this.paymentType
      val __contacts = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Contact] ++= this.contacts)
      val __tags = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.tags)
      val __trafficPriceFormats = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.trafficPriceFormats)
      val __trafficMediaTypes = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.MediaType] ++= this.trafficMediaTypes)
      val __trafficVerticalCategories = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.trafficVerticalCategories)
      val __trafficCountries = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Country] ++= this.trafficCountries)
      var __minimumPaymentThreshold = this.minimumPaymentThreshold
      var __autoPaymentFee = this.autoPaymentFee
      var __paymentTo = this.paymentTo
      var __taxClass = this.taxClass
      var __ssnTaxId = this.ssnTaxId
      var __payVat = this.payVat
      var __swiftIban = this.swiftIban
      var __referralsEnabled = this.referralsEnabled
      var __referredByAffiliate = this.referredByAffiliate
      var __referralInfo = this.referralInfo
      var __billingCycle = this.billingCycle
      var __currency = this.currency
      var __currencyPaymentSetting = this.currencyPaymentSetting
      var __onlineSignup = this.onlineSignup
      var __payForConversions = this.payForConversions
      var __review = this.review
      var __reviewNewSubaffiliates = this.reviewNewSubaffiliates
      var __suppression = this.suppression
      var __pixelInfo = this.pixelInfo
      var __fireGlobalPixel = this.fireGlobalPixel
      val __blacklists = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Blacklist] ++= this.blacklists)
      var __redirectDomainOverride = this.redirectDomainOverride
      var __autoApproveCampaigns = this.autoApproveCampaigns
      var __autoApprovePixels = this.autoApprovePixels
      var __hideOffers = this.hideOffers
      var __dateCreated = this.dateCreated
      var __notes = this.notes
      var _done__ = false
      while (!_done__) {
        val _tag__ = __input.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 8 =>
            __id = Some(__input.readInt64())
          case 18 =>
            __name = Some(__input.readString())
          case 26 =>
            __tier = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __tier.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 34 =>
            __accountManager = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __accountManager.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 42 =>
            __accountStatus = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __accountStatus.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 50 =>
            __street1 = Some(__input.readString())
          case 58 =>
            __street2 = Some(__input.readString())
          case 66 =>
            __city = Some(__input.readString())
          case 74 =>
            __state = Some(__input.readString())
          case 82 =>
            __zipCode = Some(__input.readString())
          case 90 =>
            __country = Some(__input.readString())
          case 98 =>
            __website = Some(__input.readString())
          case 106 =>
            __paymentType = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __paymentType.getOrElse(cakeproto.affiliates.Affiliate.PaymentType.defaultInstance)))
          case 114 =>
            __contacts += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.Contact.defaultInstance)
          case 122 =>
            __tags += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.IdName.defaultInstance)
          case 130 =>
            __trafficPriceFormats += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.IdName.defaultInstance)
          case 138 =>
            __trafficMediaTypes += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.MediaType.defaultInstance)
          case 146 =>
            __trafficVerticalCategories += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.IdName.defaultInstance)
          case 154 =>
            __trafficCountries += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.Country.defaultInstance)
          case 161 =>
            __minimumPaymentThreshold = Some(__input.readDouble())
          case 169 =>
            __autoPaymentFee = Some(__input.readDouble())
          case 178 =>
            __paymentTo = Some(__input.readString())
          case 186 =>
            __taxClass = Some(__input.readString())
          case 194 =>
            __ssnTaxId = Some(__input.readString())
          case 200 =>
            __payVat = Some(__input.readBool())
          case 210 =>
            __swiftIban = Some(__input.readString())
          case 216 =>
            __referralsEnabled = Some(__input.readBool())
          case 226 =>
            __referredByAffiliate = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __referredByAffiliate.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 234 =>
            __referralInfo = Some(__input.readString())
          case 242 =>
            __billingCycle = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __billingCycle.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 250 =>
            __currency = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __currency.getOrElse(cakeproto.common.Currency.defaultInstance)))
          case 258 =>
            __currencyPaymentSetting = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __currencyPaymentSetting.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 264 =>
            __onlineSignup = Some(__input.readBool())
          case 272 =>
            __payForConversions = Some(__input.readBool())
          case 280 =>
            __review = Some(__input.readBool())
          case 288 =>
            __reviewNewSubaffiliates = Some(__input.readBool())
          case 296 =>
            __suppression = Some(__input.readBool())
          case 306 =>
            __pixelInfo = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __pixelInfo.getOrElse(cakeproto.common.PixelInfo.defaultInstance)))
          case 312 =>
            __fireGlobalPixel = Some(__input.readBool())
          case 322 =>
            __blacklists += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.Blacklist.defaultInstance)
          case 330 =>
            __redirectDomainOverride = Some(__input.readString())
          case 336 =>
            __autoApproveCampaigns = Some(__input.readBool())
          case 344 =>
            __autoApprovePixels = Some(__input.readBool())
          case 352 =>
            __hideOffers = Some(__input.readBool())
          case 362 =>
            __dateCreated = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __dateCreated.getOrElse(cakeproto.common.TimeWithZone.defaultInstance)))
          case 370 =>
            __notes = Some(__input.readString())
          case tag => __input.skipField(tag)
        }
      }
      cakeproto.affiliates.Affiliate(
          id = __id,
          name = __name,
          tier = __tier,
          accountManager = __accountManager,
          accountStatus = __accountStatus,
          street1 = __street1,
          street2 = __street2,
          city = __city,
          state = __state,
          zipCode = __zipCode,
          country = __country,
          website = __website,
          paymentType = __paymentType,
          contacts = __contacts.result(),
          tags = __tags.result(),
          trafficPriceFormats = __trafficPriceFormats.result(),
          trafficMediaTypes = __trafficMediaTypes.result(),
          trafficVerticalCategories = __trafficVerticalCategories.result(),
          trafficCountries = __trafficCountries.result(),
          minimumPaymentThreshold = __minimumPaymentThreshold,
          autoPaymentFee = __autoPaymentFee,
          paymentTo = __paymentTo,
          taxClass = __taxClass,
          ssnTaxId = __ssnTaxId,
          payVat = __payVat,
          swiftIban = __swiftIban,
          referralsEnabled = __referralsEnabled,
          referredByAffiliate = __referredByAffiliate,
          referralInfo = __referralInfo,
          billingCycle = __billingCycle,
          currency = __currency,
          currencyPaymentSetting = __currencyPaymentSetting,
          onlineSignup = __onlineSignup,
          payForConversions = __payForConversions,
          review = __review,
          reviewNewSubaffiliates = __reviewNewSubaffiliates,
          suppression = __suppression,
          pixelInfo = __pixelInfo,
          fireGlobalPixel = __fireGlobalPixel,
          blacklists = __blacklists.result(),
          redirectDomainOverride = __redirectDomainOverride,
          autoApproveCampaigns = __autoApproveCampaigns,
          autoApprovePixels = __autoApprovePixels,
          hideOffers = __hideOffers,
          dateCreated = __dateCreated,
          notes = __notes
      )
    }
    def getId: Long = id.getOrElse(0L)
    def clearId: Affiliate = copy(id = None)
    def withId(__v: Long): Affiliate = copy(id = Some(__v))
    def getName: String = name.getOrElse("")
    def clearName: Affiliate = copy(name = None)
    def withName(__v: String): Affiliate = copy(name = Some(__v))
    def getTier: cakeproto.common.IdName = tier.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearTier: Affiliate = copy(tier = None)
    def withTier(__v: cakeproto.common.IdName): Affiliate = copy(tier = Some(__v))
    def getAccountManager: cakeproto.common.IdName = accountManager.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearAccountManager: Affiliate = copy(accountManager = None)
    def withAccountManager(__v: cakeproto.common.IdName): Affiliate = copy(accountManager = Some(__v))
    def getAccountStatus: cakeproto.common.IdName = accountStatus.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearAccountStatus: Affiliate = copy(accountStatus = None)
    def withAccountStatus(__v: cakeproto.common.IdName): Affiliate = copy(accountStatus = Some(__v))
    def getStreet1: String = street1.getOrElse("")
    def clearStreet1: Affiliate = copy(street1 = None)
    def withStreet1(__v: String): Affiliate = copy(street1 = Some(__v))
    def getStreet2: String = street2.getOrElse("")
    def clearStreet2: Affiliate = copy(street2 = None)
    def withStreet2(__v: String): Affiliate = copy(street2 = Some(__v))
    def getCity: String = city.getOrElse("")
    def clearCity: Affiliate = copy(city = None)
    def withCity(__v: String): Affiliate = copy(city = Some(__v))
    def getState: String = state.getOrElse("")
    def clearState: Affiliate = copy(state = None)
    def withState(__v: String): Affiliate = copy(state = Some(__v))
    def getZipCode: String = zipCode.getOrElse("")
    def clearZipCode: Affiliate = copy(zipCode = None)
    def withZipCode(__v: String): Affiliate = copy(zipCode = Some(__v))
    def getCountry: String = country.getOrElse("")
    def clearCountry: Affiliate = copy(country = None)
    def withCountry(__v: String): Affiliate = copy(country = Some(__v))
    def getWebsite: String = website.getOrElse("")
    def clearWebsite: Affiliate = copy(website = None)
    def withWebsite(__v: String): Affiliate = copy(website = Some(__v))
    def getPaymentType: cakeproto.affiliates.Affiliate.PaymentType = paymentType.getOrElse(cakeproto.affiliates.Affiliate.PaymentType.defaultInstance)
    def clearPaymentType: Affiliate = copy(paymentType = None)
    def withPaymentType(__v: cakeproto.affiliates.Affiliate.PaymentType): Affiliate = copy(paymentType = Some(__v))
    def clearContacts = copy(contacts = Seq.empty)
    def addContacts(__vs: cakeproto.common.Contact*): Affiliate = addAllContacts(__vs)
    def addAllContacts(__vs: TraversableOnce[cakeproto.common.Contact]): Affiliate = copy(contacts = contacts ++ __vs)
    def withContacts(__v: Seq[cakeproto.common.Contact]): Affiliate = copy(contacts = __v)
    def clearTags = copy(tags = Seq.empty)
    def addTags(__vs: cakeproto.common.IdName*): Affiliate = addAllTags(__vs)
    def addAllTags(__vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(tags = tags ++ __vs)
    def withTags(__v: Seq[cakeproto.common.IdName]): Affiliate = copy(tags = __v)
    def clearTrafficPriceFormats = copy(trafficPriceFormats = Seq.empty)
    def addTrafficPriceFormats(__vs: cakeproto.common.IdName*): Affiliate = addAllTrafficPriceFormats(__vs)
    def addAllTrafficPriceFormats(__vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(trafficPriceFormats = trafficPriceFormats ++ __vs)
    def withTrafficPriceFormats(__v: Seq[cakeproto.common.IdName]): Affiliate = copy(trafficPriceFormats = __v)
    def clearTrafficMediaTypes = copy(trafficMediaTypes = Seq.empty)
    def addTrafficMediaTypes(__vs: cakeproto.common.MediaType*): Affiliate = addAllTrafficMediaTypes(__vs)
    def addAllTrafficMediaTypes(__vs: TraversableOnce[cakeproto.common.MediaType]): Affiliate = copy(trafficMediaTypes = trafficMediaTypes ++ __vs)
    def withTrafficMediaTypes(__v: Seq[cakeproto.common.MediaType]): Affiliate = copy(trafficMediaTypes = __v)
    def clearTrafficVerticalCategories = copy(trafficVerticalCategories = Seq.empty)
    def addTrafficVerticalCategories(__vs: cakeproto.common.IdName*): Affiliate = addAllTrafficVerticalCategories(__vs)
    def addAllTrafficVerticalCategories(__vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(trafficVerticalCategories = trafficVerticalCategories ++ __vs)
    def withTrafficVerticalCategories(__v: Seq[cakeproto.common.IdName]): Affiliate = copy(trafficVerticalCategories = __v)
    def clearTrafficCountries = copy(trafficCountries = Seq.empty)
    def addTrafficCountries(__vs: cakeproto.common.Country*): Affiliate = addAllTrafficCountries(__vs)
    def addAllTrafficCountries(__vs: TraversableOnce[cakeproto.common.Country]): Affiliate = copy(trafficCountries = trafficCountries ++ __vs)
    def withTrafficCountries(__v: Seq[cakeproto.common.Country]): Affiliate = copy(trafficCountries = __v)
    def getMinimumPaymentThreshold: Double = minimumPaymentThreshold.getOrElse(0.0)
    def clearMinimumPaymentThreshold: Affiliate = copy(minimumPaymentThreshold = None)
    def withMinimumPaymentThreshold(__v: Double): Affiliate = copy(minimumPaymentThreshold = Some(__v))
    def getAutoPaymentFee: Double = autoPaymentFee.getOrElse(0.0)
    def clearAutoPaymentFee: Affiliate = copy(autoPaymentFee = None)
    def withAutoPaymentFee(__v: Double): Affiliate = copy(autoPaymentFee = Some(__v))
    def getPaymentTo: String = paymentTo.getOrElse("")
    def clearPaymentTo: Affiliate = copy(paymentTo = None)
    def withPaymentTo(__v: String): Affiliate = copy(paymentTo = Some(__v))
    def getTaxClass: String = taxClass.getOrElse("")
    def clearTaxClass: Affiliate = copy(taxClass = None)
    def withTaxClass(__v: String): Affiliate = copy(taxClass = Some(__v))
    def getSsnTaxId: String = ssnTaxId.getOrElse("")
    def clearSsnTaxId: Affiliate = copy(ssnTaxId = None)
    def withSsnTaxId(__v: String): Affiliate = copy(ssnTaxId = Some(__v))
    def getPayVat: Boolean = payVat.getOrElse(false)
    def clearPayVat: Affiliate = copy(payVat = None)
    def withPayVat(__v: Boolean): Affiliate = copy(payVat = Some(__v))
    def getSwiftIban: String = swiftIban.getOrElse("")
    def clearSwiftIban: Affiliate = copy(swiftIban = None)
    def withSwiftIban(__v: String): Affiliate = copy(swiftIban = Some(__v))
    def getReferralsEnabled: Boolean = referralsEnabled.getOrElse(false)
    def clearReferralsEnabled: Affiliate = copy(referralsEnabled = None)
    def withReferralsEnabled(__v: Boolean): Affiliate = copy(referralsEnabled = Some(__v))
    def getReferredByAffiliate: cakeproto.common.IdName = referredByAffiliate.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearReferredByAffiliate: Affiliate = copy(referredByAffiliate = None)
    def withReferredByAffiliate(__v: cakeproto.common.IdName): Affiliate = copy(referredByAffiliate = Some(__v))
    def getReferralInfo: String = referralInfo.getOrElse("")
    def clearReferralInfo: Affiliate = copy(referralInfo = None)
    def withReferralInfo(__v: String): Affiliate = copy(referralInfo = Some(__v))
    def getBillingCycle: cakeproto.common.IdName = billingCycle.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearBillingCycle: Affiliate = copy(billingCycle = None)
    def withBillingCycle(__v: cakeproto.common.IdName): Affiliate = copy(billingCycle = Some(__v))
    def getCurrency: cakeproto.common.Currency = currency.getOrElse(cakeproto.common.Currency.defaultInstance)
    def clearCurrency: Affiliate = copy(currency = None)
    def withCurrency(__v: cakeproto.common.Currency): Affiliate = copy(currency = Some(__v))
    def getCurrencyPaymentSetting: cakeproto.common.IdName = currencyPaymentSetting.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearCurrencyPaymentSetting: Affiliate = copy(currencyPaymentSetting = None)
    def withCurrencyPaymentSetting(__v: cakeproto.common.IdName): Affiliate = copy(currencyPaymentSetting = Some(__v))
    def getOnlineSignup: Boolean = onlineSignup.getOrElse(false)
    def clearOnlineSignup: Affiliate = copy(onlineSignup = None)
    def withOnlineSignup(__v: Boolean): Affiliate = copy(onlineSignup = Some(__v))
    def getPayForConversions: Boolean = payForConversions.getOrElse(false)
    def clearPayForConversions: Affiliate = copy(payForConversions = None)
    def withPayForConversions(__v: Boolean): Affiliate = copy(payForConversions = Some(__v))
    def getReview: Boolean = review.getOrElse(false)
    def clearReview: Affiliate = copy(review = None)
    def withReview(__v: Boolean): Affiliate = copy(review = Some(__v))
    def getReviewNewSubaffiliates: Boolean = reviewNewSubaffiliates.getOrElse(false)
    def clearReviewNewSubaffiliates: Affiliate = copy(reviewNewSubaffiliates = None)
    def withReviewNewSubaffiliates(__v: Boolean): Affiliate = copy(reviewNewSubaffiliates = Some(__v))
    def getSuppression: Boolean = suppression.getOrElse(false)
    def clearSuppression: Affiliate = copy(suppression = None)
    def withSuppression(__v: Boolean): Affiliate = copy(suppression = Some(__v))
    def getPixelInfo: cakeproto.common.PixelInfo = pixelInfo.getOrElse(cakeproto.common.PixelInfo.defaultInstance)
    def clearPixelInfo: Affiliate = copy(pixelInfo = None)
    def withPixelInfo(__v: cakeproto.common.PixelInfo): Affiliate = copy(pixelInfo = Some(__v))
    def getFireGlobalPixel: Boolean = fireGlobalPixel.getOrElse(false)
    def clearFireGlobalPixel: Affiliate = copy(fireGlobalPixel = None)
    def withFireGlobalPixel(__v: Boolean): Affiliate = copy(fireGlobalPixel = Some(__v))
    def clearBlacklists = copy(blacklists = Seq.empty)
    def addBlacklists(__vs: cakeproto.common.Blacklist*): Affiliate = addAllBlacklists(__vs)
    def addAllBlacklists(__vs: TraversableOnce[cakeproto.common.Blacklist]): Affiliate = copy(blacklists = blacklists ++ __vs)
    def withBlacklists(__v: Seq[cakeproto.common.Blacklist]): Affiliate = copy(blacklists = __v)
    def getRedirectDomainOverride: String = redirectDomainOverride.getOrElse("")
    def clearRedirectDomainOverride: Affiliate = copy(redirectDomainOverride = None)
    def withRedirectDomainOverride(__v: String): Affiliate = copy(redirectDomainOverride = Some(__v))
    def getAutoApproveCampaigns: Boolean = autoApproveCampaigns.getOrElse(false)
    def clearAutoApproveCampaigns: Affiliate = copy(autoApproveCampaigns = None)
    def withAutoApproveCampaigns(__v: Boolean): Affiliate = copy(autoApproveCampaigns = Some(__v))
    def getAutoApprovePixels: Boolean = autoApprovePixels.getOrElse(false)
    def clearAutoApprovePixels: Affiliate = copy(autoApprovePixels = None)
    def withAutoApprovePixels(__v: Boolean): Affiliate = copy(autoApprovePixels = Some(__v))
    def getHideOffers: Boolean = hideOffers.getOrElse(false)
    def clearHideOffers: Affiliate = copy(hideOffers = None)
    def withHideOffers(__v: Boolean): Affiliate = copy(hideOffers = Some(__v))
    def getDateCreated: cakeproto.common.TimeWithZone = dateCreated.getOrElse(cakeproto.common.TimeWithZone.defaultInstance)
    def clearDateCreated: Affiliate = copy(dateCreated = None)
    def withDateCreated(__v: cakeproto.common.TimeWithZone): Affiliate = copy(dateCreated = Some(__v))
    def getNotes: String = notes.getOrElse("")
    def clearNotes: Affiliate = copy(notes = None)
    def withNotes(__v: String): Affiliate = copy(notes = Some(__v))
    def getField(__field: com.google.protobuf.Descriptors.FieldDescriptor): scala.Any = {
      __field.getNumber match {
        case 1 => id.getOrElse(null)
        case 2 => name.getOrElse(null)
        case 3 => tier.getOrElse(null)
        case 4 => accountManager.getOrElse(null)
        case 5 => accountStatus.getOrElse(null)
        case 6 => street1.getOrElse(null)
        case 7 => street2.getOrElse(null)
        case 8 => city.getOrElse(null)
        case 9 => state.getOrElse(null)
        case 10 => zipCode.getOrElse(null)
        case 11 => country.getOrElse(null)
        case 12 => website.getOrElse(null)
        case 13 => paymentType.getOrElse(null)
        case 14 => contacts
        case 15 => tags
        case 16 => trafficPriceFormats
        case 17 => trafficMediaTypes
        case 18 => trafficVerticalCategories
        case 19 => trafficCountries
        case 20 => minimumPaymentThreshold.getOrElse(null)
        case 21 => autoPaymentFee.getOrElse(null)
        case 22 => paymentTo.getOrElse(null)
        case 23 => taxClass.getOrElse(null)
        case 24 => ssnTaxId.getOrElse(null)
        case 25 => payVat.getOrElse(null)
        case 26 => swiftIban.getOrElse(null)
        case 27 => referralsEnabled.getOrElse(null)
        case 28 => referredByAffiliate.getOrElse(null)
        case 29 => referralInfo.getOrElse(null)
        case 30 => billingCycle.getOrElse(null)
        case 31 => currency.getOrElse(null)
        case 32 => currencyPaymentSetting.getOrElse(null)
        case 33 => onlineSignup.getOrElse(null)
        case 34 => payForConversions.getOrElse(null)
        case 35 => review.getOrElse(null)
        case 36 => reviewNewSubaffiliates.getOrElse(null)
        case 37 => suppression.getOrElse(null)
        case 38 => pixelInfo.getOrElse(null)
        case 39 => fireGlobalPixel.getOrElse(null)
        case 40 => blacklists
        case 41 => redirectDomainOverride.getOrElse(null)
        case 42 => autoApproveCampaigns.getOrElse(null)
        case 43 => autoApprovePixels.getOrElse(null)
        case 44 => hideOffers.getOrElse(null)
        case 45 => dateCreated.getOrElse(null)
        case 46 => notes.getOrElse(null)
      }
    }
    override def toString: String = com.trueaccord.scalapb.TextFormat.printToUnicodeString(this)
    def companion = cakeproto.affiliates.Affiliate
}

object Affiliate extends com.trueaccord.scalapb.GeneratedMessageCompanion[Affiliate]  {
  implicit def messageCompanion: com.trueaccord.scalapb.GeneratedMessageCompanion[Affiliate]  = this
  def fromFieldsMap(__fieldsMap: Map[com.google.protobuf.Descriptors.FieldDescriptor, scala.Any]): cakeproto.affiliates.Affiliate = {
    require(__fieldsMap.keys.forall(_.getContainingType() == descriptor), "FieldDescriptor does not match message type.")
    val __fields = descriptor.getFields
    cakeproto.affiliates.Affiliate(
      __fieldsMap.get(__fields.get(0)).asInstanceOf[Option[Long]],
      __fieldsMap.get(__fields.get(1)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(2)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(3)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(4)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(5)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(6)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(7)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(8)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(9)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(10)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(11)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(12)).asInstanceOf[Option[cakeproto.affiliates.Affiliate.PaymentType]],
      __fieldsMap.getOrElse(__fields.get(13), Nil).asInstanceOf[Seq[cakeproto.common.Contact]],
      __fieldsMap.getOrElse(__fields.get(14), Nil).asInstanceOf[Seq[cakeproto.common.IdName]],
      __fieldsMap.getOrElse(__fields.get(15), Nil).asInstanceOf[Seq[cakeproto.common.IdName]],
      __fieldsMap.getOrElse(__fields.get(16), Nil).asInstanceOf[Seq[cakeproto.common.MediaType]],
      __fieldsMap.getOrElse(__fields.get(17), Nil).asInstanceOf[Seq[cakeproto.common.IdName]],
      __fieldsMap.getOrElse(__fields.get(18), Nil).asInstanceOf[Seq[cakeproto.common.Country]],
      __fieldsMap.get(__fields.get(19)).asInstanceOf[Option[Double]],
      __fieldsMap.get(__fields.get(20)).asInstanceOf[Option[Double]],
      __fieldsMap.get(__fields.get(21)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(22)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(23)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(24)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(25)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(26)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(27)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(28)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(29)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(30)).asInstanceOf[Option[cakeproto.common.Currency]],
      __fieldsMap.get(__fields.get(31)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(32)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(33)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(34)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(35)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(36)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(37)).asInstanceOf[Option[cakeproto.common.PixelInfo]],
      __fieldsMap.get(__fields.get(38)).asInstanceOf[Option[Boolean]],
      __fieldsMap.getOrElse(__fields.get(39), Nil).asInstanceOf[Seq[cakeproto.common.Blacklist]],
      __fieldsMap.get(__fields.get(40)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(41)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(42)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(43)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(44)).asInstanceOf[Option[cakeproto.common.TimeWithZone]],
      __fieldsMap.get(__fields.get(45)).asInstanceOf[Option[String]]
    )
  }
  def descriptor: com.google.protobuf.Descriptors.Descriptor = AffiliatesProto.descriptor.getMessageTypes.get(0)
  def messageCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedMessageCompanion[_] = {
    require(__field.getContainingType() == descriptor, "FieldDescriptor does not match message type.")
    var __out: com.trueaccord.scalapb.GeneratedMessageCompanion[_] = null
    __field.getNumber match {
      case 3 => __out = cakeproto.common.IdName
      case 4 => __out = cakeproto.common.IdName
      case 5 => __out = cakeproto.common.IdName
      case 13 => __out = cakeproto.affiliates.Affiliate.PaymentType
      case 14 => __out = cakeproto.common.Contact
      case 15 => __out = cakeproto.common.IdName
      case 16 => __out = cakeproto.common.IdName
      case 17 => __out = cakeproto.common.MediaType
      case 18 => __out = cakeproto.common.IdName
      case 19 => __out = cakeproto.common.Country
      case 28 => __out = cakeproto.common.IdName
      case 30 => __out = cakeproto.common.IdName
      case 31 => __out = cakeproto.common.Currency
      case 32 => __out = cakeproto.common.IdName
      case 38 => __out = cakeproto.common.PixelInfo
      case 40 => __out = cakeproto.common.Blacklist
      case 45 => __out = cakeproto.common.TimeWithZone
    }
  __out
  }
  def enumCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__field)
  lazy val defaultInstance = cakeproto.affiliates.Affiliate(
  )
  @SerialVersionUID(0L)
  final case class PaymentType(
      id: Option[Long] = None,
      name: Option[String] = None,
      info: Option[String] = None
      ) extends com.trueaccord.scalapb.GeneratedMessage with com.trueaccord.scalapb.Message[PaymentType] with com.trueaccord.lenses.Updatable[PaymentType] {
      @transient
      lazy val serializedSize: Int = {
        var __size = 0
        if (id.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id.get) }
        if (name.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(2, name.get) }
        if (info.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(3, info.get) }
        __size
      }
      def writeTo(output: com.google.protobuf.CodedOutputStream): Unit = {
        id.foreach { __v => 
          output.writeInt64(1, __v)
        };
        name.foreach { __v => 
          output.writeString(2, __v)
        };
        info.foreach { __v => 
          output.writeString(3, __v)
        };
      }
      def mergeFrom(__input: com.google.protobuf.CodedInputStream): cakeproto.affiliates.Affiliate.PaymentType = {
        var __id = this.id
        var __name = this.name
        var __info = this.info
        var _done__ = false
        while (!_done__) {
          val _tag__ = __input.readTag()
          _tag__ match {
            case 0 => _done__ = true
            case 8 =>
              __id = Some(__input.readInt64())
            case 18 =>
              __name = Some(__input.readString())
            case 26 =>
              __info = Some(__input.readString())
            case tag => __input.skipField(tag)
          }
        }
        cakeproto.affiliates.Affiliate.PaymentType(
            id = __id,
            name = __name,
            info = __info
        )
      }
      def getId: Long = id.getOrElse(0L)
      def clearId: PaymentType = copy(id = None)
      def withId(__v: Long): PaymentType = copy(id = Some(__v))
      def getName: String = name.getOrElse("")
      def clearName: PaymentType = copy(name = None)
      def withName(__v: String): PaymentType = copy(name = Some(__v))
      def getInfo: String = info.getOrElse("")
      def clearInfo: PaymentType = copy(info = None)
      def withInfo(__v: String): PaymentType = copy(info = Some(__v))
      def getField(__field: com.google.protobuf.Descriptors.FieldDescriptor): scala.Any = {
        __field.getNumber match {
          case 1 => id.getOrElse(null)
          case 2 => name.getOrElse(null)
          case 3 => info.getOrElse(null)
        }
      }
      override def toString: String = com.trueaccord.scalapb.TextFormat.printToUnicodeString(this)
      def companion = cakeproto.affiliates.Affiliate.PaymentType
  }

  object PaymentType extends com.trueaccord.scalapb.GeneratedMessageCompanion[PaymentType]  {
    implicit def messageCompanion: com.trueaccord.scalapb.GeneratedMessageCompanion[PaymentType]  = this
    def fromFieldsMap(__fieldsMap: Map[com.google.protobuf.Descriptors.FieldDescriptor, scala.Any]): cakeproto.affiliates.Affiliate.PaymentType = {
      require(__fieldsMap.keys.forall(_.getContainingType() == descriptor), "FieldDescriptor does not match message type.")
      val __fields = descriptor.getFields
      cakeproto.affiliates.Affiliate.PaymentType(
        __fieldsMap.get(__fields.get(0)).asInstanceOf[Option[Long]],
        __fieldsMap.get(__fields.get(1)).asInstanceOf[Option[String]],
        __fieldsMap.get(__fields.get(2)).asInstanceOf[Option[String]]
      )
    }
    def descriptor: com.google.protobuf.Descriptors.Descriptor = cakeproto.affiliates.Affiliate.descriptor.getNestedTypes.get(0)
    def messageCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__field)
    def enumCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__field)
    lazy val defaultInstance = cakeproto.affiliates.Affiliate.PaymentType(
    )
    implicit class PaymentTypeLens[UpperPB](_l: com.trueaccord.lenses.Lens[UpperPB, PaymentType]) extends com.trueaccord.lenses.ObjectLens[UpperPB, PaymentType](_l) {
      def id: com.trueaccord.lenses.Lens[UpperPB, Long] = field(_.getId)((c_, f_) => c_.copy(id = Some(f_)))
      def optionalId: com.trueaccord.lenses.Lens[UpperPB, Option[Long]] = field(_.id)((c_, f_) => c_.copy(id = f_))
      def name: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getName)((c_, f_) => c_.copy(name = Some(f_)))
      def optionalName: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.name)((c_, f_) => c_.copy(name = f_))
      def info: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getInfo)((c_, f_) => c_.copy(info = Some(f_)))
      def optionalInfo: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.info)((c_, f_) => c_.copy(info = f_))
    }
    final val ID_FIELD_NUMBER = 1
    final val NAME_FIELD_NUMBER = 2
    final val INFO_FIELD_NUMBER = 3
  }

  implicit class AffiliateLens[UpperPB](_l: com.trueaccord.lenses.Lens[UpperPB, Affiliate]) extends com.trueaccord.lenses.ObjectLens[UpperPB, Affiliate](_l) {
    def id: com.trueaccord.lenses.Lens[UpperPB, Long] = field(_.getId)((c_, f_) => c_.copy(id = Some(f_)))
    def optionalId: com.trueaccord.lenses.Lens[UpperPB, Option[Long]] = field(_.id)((c_, f_) => c_.copy(id = f_))
    def name: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getName)((c_, f_) => c_.copy(name = Some(f_)))
    def optionalName: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.name)((c_, f_) => c_.copy(name = f_))
    def tier: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getTier)((c_, f_) => c_.copy(tier = Some(f_)))
    def optionalTier: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.tier)((c_, f_) => c_.copy(tier = f_))
    def accountManager: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getAccountManager)((c_, f_) => c_.copy(accountManager = Some(f_)))
    def optionalAccountManager: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.accountManager)((c_, f_) => c_.copy(accountManager = f_))
    def accountStatus: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getAccountStatus)((c_, f_) => c_.copy(accountStatus = Some(f_)))
    def optionalAccountStatus: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.accountStatus)((c_, f_) => c_.copy(accountStatus = f_))
    def street1: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getStreet1)((c_, f_) => c_.copy(street1 = Some(f_)))
    def optionalStreet1: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.street1)((c_, f_) => c_.copy(street1 = f_))
    def street2: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getStreet2)((c_, f_) => c_.copy(street2 = Some(f_)))
    def optionalStreet2: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.street2)((c_, f_) => c_.copy(street2 = f_))
    def city: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getCity)((c_, f_) => c_.copy(city = Some(f_)))
    def optionalCity: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.city)((c_, f_) => c_.copy(city = f_))
    def state: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getState)((c_, f_) => c_.copy(state = Some(f_)))
    def optionalState: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.state)((c_, f_) => c_.copy(state = f_))
    def zipCode: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getZipCode)((c_, f_) => c_.copy(zipCode = Some(f_)))
    def optionalZipCode: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.zipCode)((c_, f_) => c_.copy(zipCode = f_))
    def country: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getCountry)((c_, f_) => c_.copy(country = Some(f_)))
    def optionalCountry: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.country)((c_, f_) => c_.copy(country = f_))
    def website: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getWebsite)((c_, f_) => c_.copy(website = Some(f_)))
    def optionalWebsite: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.website)((c_, f_) => c_.copy(website = f_))
    def paymentType: com.trueaccord.lenses.Lens[UpperPB, cakeproto.affiliates.Affiliate.PaymentType] = field(_.getPaymentType)((c_, f_) => c_.copy(paymentType = Some(f_)))
    def optionalPaymentType: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.affiliates.Affiliate.PaymentType]] = field(_.paymentType)((c_, f_) => c_.copy(paymentType = f_))
    def contacts: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.Contact]] = field(_.contacts)((c_, f_) => c_.copy(contacts = f_))
    def tags: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.IdName]] = field(_.tags)((c_, f_) => c_.copy(tags = f_))
    def trafficPriceFormats: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.IdName]] = field(_.trafficPriceFormats)((c_, f_) => c_.copy(trafficPriceFormats = f_))
    def trafficMediaTypes: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.MediaType]] = field(_.trafficMediaTypes)((c_, f_) => c_.copy(trafficMediaTypes = f_))
    def trafficVerticalCategories: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.IdName]] = field(_.trafficVerticalCategories)((c_, f_) => c_.copy(trafficVerticalCategories = f_))
    def trafficCountries: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.Country]] = field(_.trafficCountries)((c_, f_) => c_.copy(trafficCountries = f_))
    def minimumPaymentThreshold: com.trueaccord.lenses.Lens[UpperPB, Double] = field(_.getMinimumPaymentThreshold)((c_, f_) => c_.copy(minimumPaymentThreshold = Some(f_)))
    def optionalMinimumPaymentThreshold: com.trueaccord.lenses.Lens[UpperPB, Option[Double]] = field(_.minimumPaymentThreshold)((c_, f_) => c_.copy(minimumPaymentThreshold = f_))
    def autoPaymentFee: com.trueaccord.lenses.Lens[UpperPB, Double] = field(_.getAutoPaymentFee)((c_, f_) => c_.copy(autoPaymentFee = Some(f_)))
    def optionalAutoPaymentFee: com.trueaccord.lenses.Lens[UpperPB, Option[Double]] = field(_.autoPaymentFee)((c_, f_) => c_.copy(autoPaymentFee = f_))
    def paymentTo: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getPaymentTo)((c_, f_) => c_.copy(paymentTo = Some(f_)))
    def optionalPaymentTo: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.paymentTo)((c_, f_) => c_.copy(paymentTo = f_))
    def taxClass: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getTaxClass)((c_, f_) => c_.copy(taxClass = Some(f_)))
    def optionalTaxClass: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.taxClass)((c_, f_) => c_.copy(taxClass = f_))
    def ssnTaxId: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getSsnTaxId)((c_, f_) => c_.copy(ssnTaxId = Some(f_)))
    def optionalSsnTaxId: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.ssnTaxId)((c_, f_) => c_.copy(ssnTaxId = f_))
    def payVat: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getPayVat)((c_, f_) => c_.copy(payVat = Some(f_)))
    def optionalPayVat: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.payVat)((c_, f_) => c_.copy(payVat = f_))
    def swiftIban: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getSwiftIban)((c_, f_) => c_.copy(swiftIban = Some(f_)))
    def optionalSwiftIban: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.swiftIban)((c_, f_) => c_.copy(swiftIban = f_))
    def referralsEnabled: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getReferralsEnabled)((c_, f_) => c_.copy(referralsEnabled = Some(f_)))
    def optionalReferralsEnabled: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.referralsEnabled)((c_, f_) => c_.copy(referralsEnabled = f_))
    def referredByAffiliate: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getReferredByAffiliate)((c_, f_) => c_.copy(referredByAffiliate = Some(f_)))
    def optionalReferredByAffiliate: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.referredByAffiliate)((c_, f_) => c_.copy(referredByAffiliate = f_))
    def referralInfo: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getReferralInfo)((c_, f_) => c_.copy(referralInfo = Some(f_)))
    def optionalReferralInfo: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.referralInfo)((c_, f_) => c_.copy(referralInfo = f_))
    def billingCycle: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getBillingCycle)((c_, f_) => c_.copy(billingCycle = Some(f_)))
    def optionalBillingCycle: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.billingCycle)((c_, f_) => c_.copy(billingCycle = f_))
    def currency: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.Currency] = field(_.getCurrency)((c_, f_) => c_.copy(currency = Some(f_)))
    def optionalCurrency: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.Currency]] = field(_.currency)((c_, f_) => c_.copy(currency = f_))
    def currencyPaymentSetting: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getCurrencyPaymentSetting)((c_, f_) => c_.copy(currencyPaymentSetting = Some(f_)))
    def optionalCurrencyPaymentSetting: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.currencyPaymentSetting)((c_, f_) => c_.copy(currencyPaymentSetting = f_))
    def onlineSignup: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getOnlineSignup)((c_, f_) => c_.copy(onlineSignup = Some(f_)))
    def optionalOnlineSignup: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.onlineSignup)((c_, f_) => c_.copy(onlineSignup = f_))
    def payForConversions: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getPayForConversions)((c_, f_) => c_.copy(payForConversions = Some(f_)))
    def optionalPayForConversions: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.payForConversions)((c_, f_) => c_.copy(payForConversions = f_))
    def review: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getReview)((c_, f_) => c_.copy(review = Some(f_)))
    def optionalReview: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.review)((c_, f_) => c_.copy(review = f_))
    def reviewNewSubaffiliates: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getReviewNewSubaffiliates)((c_, f_) => c_.copy(reviewNewSubaffiliates = Some(f_)))
    def optionalReviewNewSubaffiliates: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.reviewNewSubaffiliates)((c_, f_) => c_.copy(reviewNewSubaffiliates = f_))
    def suppression: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getSuppression)((c_, f_) => c_.copy(suppression = Some(f_)))
    def optionalSuppression: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.suppression)((c_, f_) => c_.copy(suppression = f_))
    def pixelInfo: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.PixelInfo] = field(_.getPixelInfo)((c_, f_) => c_.copy(pixelInfo = Some(f_)))
    def optionalPixelInfo: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.PixelInfo]] = field(_.pixelInfo)((c_, f_) => c_.copy(pixelInfo = f_))
    def fireGlobalPixel: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getFireGlobalPixel)((c_, f_) => c_.copy(fireGlobalPixel = Some(f_)))
    def optionalFireGlobalPixel: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.fireGlobalPixel)((c_, f_) => c_.copy(fireGlobalPixel = f_))
    def blacklists: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.Blacklist]] = field(_.blacklists)((c_, f_) => c_.copy(blacklists = f_))
    def redirectDomainOverride: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getRedirectDomainOverride)((c_, f_) => c_.copy(redirectDomainOverride = Some(f_)))
    def optionalRedirectDomainOverride: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.redirectDomainOverride)((c_, f_) => c_.copy(redirectDomainOverride = f_))
    def autoApproveCampaigns: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getAutoApproveCampaigns)((c_, f_) => c_.copy(autoApproveCampaigns = Some(f_)))
    def optionalAutoApproveCampaigns: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.autoApproveCampaigns)((c_, f_) => c_.copy(autoApproveCampaigns = f_))
    def autoApprovePixels: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getAutoApprovePixels)((c_, f_) => c_.copy(autoApprovePixels = Some(f_)))
    def optionalAutoApprovePixels: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.autoApprovePixels)((c_, f_) => c_.copy(autoApprovePixels = f_))
    def hideOffers: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getHideOffers)((c_, f_) => c_.copy(hideOffers = Some(f_)))
    def optionalHideOffers: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.hideOffers)((c_, f_) => c_.copy(hideOffers = f_))
    def dateCreated: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.TimeWithZone] = field(_.getDateCreated)((c_, f_) => c_.copy(dateCreated = Some(f_)))
    def optionalDateCreated: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.TimeWithZone]] = field(_.dateCreated)((c_, f_) => c_.copy(dateCreated = f_))
    def notes: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getNotes)((c_, f_) => c_.copy(notes = Some(f_)))
    def optionalNotes: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.notes)((c_, f_) => c_.copy(notes = f_))
  }
  final val ID_FIELD_NUMBER = 1
  final val NAME_FIELD_NUMBER = 2
  final val TIER_FIELD_NUMBER = 3
  final val ACCOUNT_MANAGER_FIELD_NUMBER = 4
  final val ACCOUNT_STATUS_FIELD_NUMBER = 5
  final val STREET1_FIELD_NUMBER = 6
  final val STREET2_FIELD_NUMBER = 7
  final val CITY_FIELD_NUMBER = 8
  final val STATE_FIELD_NUMBER = 9
  final val ZIP_CODE_FIELD_NUMBER = 10
  final val COUNTRY_FIELD_NUMBER = 11
  final val WEBSITE_FIELD_NUMBER = 12
  final val PAYMENT_TYPE_FIELD_NUMBER = 13
  final val CONTACTS_FIELD_NUMBER = 14
  final val TAGS_FIELD_NUMBER = 15
  final val TRAFFIC_PRICE_FORMATS_FIELD_NUMBER = 16
  final val TRAFFIC_MEDIA_TYPES_FIELD_NUMBER = 17
  final val TRAFFIC_VERTICAL_CATEGORIES_FIELD_NUMBER = 18
  final val TRAFFIC_COUNTRIES_FIELD_NUMBER = 19
  final val MINIMUM_PAYMENT_THRESHOLD_FIELD_NUMBER = 20
  final val AUTO_PAYMENT_FEE_FIELD_NUMBER = 21
  final val PAYMENT_TO_FIELD_NUMBER = 22
  final val TAX_CLASS_FIELD_NUMBER = 23
  final val SSN_TAX_ID_FIELD_NUMBER = 24
  final val PAY_VAT_FIELD_NUMBER = 25
  final val SWIFT_IBAN_FIELD_NUMBER = 26
  final val REFERRALS_ENABLED_FIELD_NUMBER = 27
  final val REFERRED_BY_AFFILIATE_FIELD_NUMBER = 28
  final val REFERRAL_INFO_FIELD_NUMBER = 29
  final val BILLING_CYCLE_FIELD_NUMBER = 30
  final val CURRENCY_FIELD_NUMBER = 31
  final val CURRENCY_PAYMENT_SETTING_FIELD_NUMBER = 32
  final val ONLINE_SIGNUP_FIELD_NUMBER = 33
  final val PAY_FOR_CONVERSIONS_FIELD_NUMBER = 34
  final val REVIEW_FIELD_NUMBER = 35
  final val REVIEW_NEW_SUBAFFILIATES_FIELD_NUMBER = 36
  final val SUPPRESSION_FIELD_NUMBER = 37
  final val PIXEL_INFO_FIELD_NUMBER = 38
  final val FIRE_GLOBAL_PIXEL_FIELD_NUMBER = 39
  final val BLACKLISTS_FIELD_NUMBER = 40
  final val REDIRECT_DOMAIN_OVERRIDE_FIELD_NUMBER = 41
  final val AUTO_APPROVE_CAMPAIGNS_FIELD_NUMBER = 42
  final val AUTO_APPROVE_PIXELS_FIELD_NUMBER = 43
  final val HIDE_OFFERS_FIELD_NUMBER = 44
  final val DATE_CREATED_FIELD_NUMBER = 45
  final val NOTES_FIELD_NUMBER = 46
}

I found a workaround to that problem. When I edit that definition and move nested PaymentType class out of Affiliate the error is gone.

Modified version of Affiliate.scala file.

// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2

package cakeproto.affiliates

@SerialVersionUID(0L)
final case class Affiliate(
    id: Option[Long] = None,
    name: Option[String] = None,
    tier: Option[cakeproto.common.IdName] = None,
    accountManager: Option[cakeproto.common.IdName] = None,
    accountStatus: Option[cakeproto.common.IdName] = None,
    street1: Option[String] = None,
    street2: Option[String] = None,
    city: Option[String] = None,
    state: Option[String] = None,
    zipCode: Option[String] = None,
    country: Option[String] = None,
    website: Option[String] = None,
    paymentType: Option[cakeproto.affiliates.PaymentType] = None,
    contacts: Seq[cakeproto.common.Contact] = Nil,
    tags: Seq[cakeproto.common.IdName] = Nil,
    trafficPriceFormats: Seq[cakeproto.common.IdName] = Nil,
    trafficMediaTypes: Seq[cakeproto.common.MediaType] = Nil,
    trafficVerticalCategories: Seq[cakeproto.common.IdName] = Nil,
    trafficCountries: Seq[cakeproto.common.Country] = Nil,
    minimumPaymentThreshold: Option[Double] = None,
    autoPaymentFee: Option[Double] = None,
    paymentTo: Option[String] = None,
    taxClass: Option[String] = None,
    ssnTaxId: Option[String] = None,
    payVat: Option[Boolean] = None,
    swiftIban: Option[String] = None,
    referralsEnabled: Option[Boolean] = None,
    referredByAffiliate: Option[cakeproto.common.IdName] = None,
    referralInfo: Option[String] = None,
    billingCycle: Option[cakeproto.common.IdName] = None,
    currency: Option[cakeproto.common.Currency] = None,
    currencyPaymentSetting: Option[cakeproto.common.IdName] = None,
    onlineSignup: Option[Boolean] = None,
    payForConversions: Option[Boolean] = None,
    review: Option[Boolean] = None,
    reviewNewSubaffiliates: Option[Boolean] = None,
    suppression: Option[Boolean] = None,
    pixelInfo: Option[cakeproto.common.PixelInfo] = None,
    fireGlobalPixel: Option[Boolean] = None,
    blacklists: Seq[cakeproto.common.Blacklist] = Nil,
    redirectDomainOverride: Option[String] = None,
    autoApproveCampaigns: Option[Boolean] = None,
    autoApprovePixels: Option[Boolean] = None,
    hideOffers: Option[Boolean] = None,
    dateCreated: Option[cakeproto.common.TimeWithZone] = None,
    notes: Option[String] = None
    ) extends com.trueaccord.scalapb.GeneratedMessage with com.trueaccord.scalapb.Message[Affiliate] with com.trueaccord.lenses.Updatable[Affiliate] {
    @transient
    lazy val serializedSize: Int = {
      var __size = 0
      if (id.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id.get) }
      if (name.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(2, name.get) }
      if (tier.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(tier.get.serializedSize) + tier.get.serializedSize }
      if (accountManager.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(accountManager.get.serializedSize) + accountManager.get.serializedSize }
      if (accountStatus.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(accountStatus.get.serializedSize) + accountStatus.get.serializedSize }
      if (street1.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(6, street1.get) }
      if (street2.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(7, street2.get) }
      if (city.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(8, city.get) }
      if (state.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(9, state.get) }
      if (zipCode.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(10, zipCode.get) }
      if (country.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(11, country.get) }
      if (website.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(12, website.get) }
      if (paymentType.isDefined) { __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(paymentType.get.serializedSize) + paymentType.get.serializedSize }
      contacts.foreach(contacts => __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(contacts.serializedSize) + contacts.serializedSize)
      tags.foreach(tags => __size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(tags.serializedSize) + tags.serializedSize)
      trafficPriceFormats.foreach(trafficPriceFormats => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficPriceFormats.serializedSize) + trafficPriceFormats.serializedSize)
      trafficMediaTypes.foreach(trafficMediaTypes => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficMediaTypes.serializedSize) + trafficMediaTypes.serializedSize)
      trafficVerticalCategories.foreach(trafficVerticalCategories => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficVerticalCategories.serializedSize) + trafficVerticalCategories.serializedSize)
      trafficCountries.foreach(trafficCountries => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficCountries.serializedSize) + trafficCountries.serializedSize)
      if (minimumPaymentThreshold.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeDoubleSize(20, minimumPaymentThreshold.get) }
      if (autoPaymentFee.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeDoubleSize(21, autoPaymentFee.get) }
      if (paymentTo.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(22, paymentTo.get) }
      if (taxClass.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(23, taxClass.get) }
      if (ssnTaxId.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(24, ssnTaxId.get) }
      if (payVat.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(25, payVat.get) }
      if (swiftIban.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(26, swiftIban.get) }
      if (referralsEnabled.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(27, referralsEnabled.get) }
      if (referredByAffiliate.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(referredByAffiliate.get.serializedSize) + referredByAffiliate.get.serializedSize }
      if (referralInfo.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(29, referralInfo.get) }
      if (billingCycle.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(billingCycle.get.serializedSize) + billingCycle.get.serializedSize }
      if (currency.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(currency.get.serializedSize) + currency.get.serializedSize }
      if (currencyPaymentSetting.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(currencyPaymentSetting.get.serializedSize) + currencyPaymentSetting.get.serializedSize }
      if (onlineSignup.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(33, onlineSignup.get) }
      if (payForConversions.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(34, payForConversions.get) }
      if (review.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(35, review.get) }
      if (reviewNewSubaffiliates.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(36, reviewNewSubaffiliates.get) }
      if (suppression.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(37, suppression.get) }
      if (pixelInfo.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(pixelInfo.get.serializedSize) + pixelInfo.get.serializedSize }
      if (fireGlobalPixel.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(39, fireGlobalPixel.get) }
      blacklists.foreach(blacklists => __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(blacklists.serializedSize) + blacklists.serializedSize)
      if (redirectDomainOverride.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(41, redirectDomainOverride.get) }
      if (autoApproveCampaigns.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(42, autoApproveCampaigns.get) }
      if (autoApprovePixels.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(43, autoApprovePixels.get) }
      if (hideOffers.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeBoolSize(44, hideOffers.get) }
      if (dateCreated.isDefined) { __size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(dateCreated.get.serializedSize) + dateCreated.get.serializedSize }
      if (notes.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(46, notes.get) }
      __size
    }
    def writeTo(output: com.google.protobuf.CodedOutputStream): Unit = {
      id.foreach { __v => 
        output.writeInt64(1, __v)
      };
      name.foreach { __v => 
        output.writeString(2, __v)
      };
      tier.foreach { __v => 
        output.writeTag(3, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      accountManager.foreach { __v => 
        output.writeTag(4, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      accountStatus.foreach { __v => 
        output.writeTag(5, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      street1.foreach { __v => 
        output.writeString(6, __v)
      };
      street2.foreach { __v => 
        output.writeString(7, __v)
      };
      city.foreach { __v => 
        output.writeString(8, __v)
      };
      state.foreach { __v => 
        output.writeString(9, __v)
      };
      zipCode.foreach { __v => 
        output.writeString(10, __v)
      };
      country.foreach { __v => 
        output.writeString(11, __v)
      };
      website.foreach { __v => 
        output.writeString(12, __v)
      };
      paymentType.foreach { __v => 
        output.writeTag(13, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      contacts.foreach { __v => 
        output.writeTag(14, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      tags.foreach { __v => 
        output.writeTag(15, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficPriceFormats.foreach { __v => 
        output.writeTag(16, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficMediaTypes.foreach { __v => 
        output.writeTag(17, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficVerticalCategories.foreach { __v => 
        output.writeTag(18, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      trafficCountries.foreach { __v => 
        output.writeTag(19, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      minimumPaymentThreshold.foreach { __v => 
        output.writeDouble(20, __v)
      };
      autoPaymentFee.foreach { __v => 
        output.writeDouble(21, __v)
      };
      paymentTo.foreach { __v => 
        output.writeString(22, __v)
      };
      taxClass.foreach { __v => 
        output.writeString(23, __v)
      };
      ssnTaxId.foreach { __v => 
        output.writeString(24, __v)
      };
      payVat.foreach { __v => 
        output.writeBool(25, __v)
      };
      swiftIban.foreach { __v => 
        output.writeString(26, __v)
      };
      referralsEnabled.foreach { __v => 
        output.writeBool(27, __v)
      };
      referredByAffiliate.foreach { __v => 
        output.writeTag(28, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      referralInfo.foreach { __v => 
        output.writeString(29, __v)
      };
      billingCycle.foreach { __v => 
        output.writeTag(30, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      currency.foreach { __v => 
        output.writeTag(31, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      currencyPaymentSetting.foreach { __v => 
        output.writeTag(32, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      onlineSignup.foreach { __v => 
        output.writeBool(33, __v)
      };
      payForConversions.foreach { __v => 
        output.writeBool(34, __v)
      };
      review.foreach { __v => 
        output.writeBool(35, __v)
      };
      reviewNewSubaffiliates.foreach { __v => 
        output.writeBool(36, __v)
      };
      suppression.foreach { __v => 
        output.writeBool(37, __v)
      };
      pixelInfo.foreach { __v => 
        output.writeTag(38, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      fireGlobalPixel.foreach { __v => 
        output.writeBool(39, __v)
      };
      blacklists.foreach { __v => 
        output.writeTag(40, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      redirectDomainOverride.foreach { __v => 
        output.writeString(41, __v)
      };
      autoApproveCampaigns.foreach { __v => 
        output.writeBool(42, __v)
      };
      autoApprovePixels.foreach { __v => 
        output.writeBool(43, __v)
      };
      hideOffers.foreach { __v => 
        output.writeBool(44, __v)
      };
      dateCreated.foreach { __v => 
        output.writeTag(45, 2)
        output.writeRawVarint32(__v.serializedSize)
        __v.writeTo(output)
      };
      notes.foreach { __v => 
        output.writeString(46, __v)
      };
    }
    def mergeFrom(__input: com.google.protobuf.CodedInputStream): cakeproto.affiliates.Affiliate = {
      var __id = this.id
      var __name = this.name
      var __tier = this.tier
      var __accountManager = this.accountManager
      var __accountStatus = this.accountStatus
      var __street1 = this.street1
      var __street2 = this.street2
      var __city = this.city
      var __state = this.state
      var __zipCode = this.zipCode
      var __country = this.country
      var __website = this.website
      var __paymentType = this.paymentType
      val __contacts = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Contact] ++= this.contacts)
      val __tags = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.tags)
      val __trafficPriceFormats = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.trafficPriceFormats)
      val __trafficMediaTypes = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.MediaType] ++= this.trafficMediaTypes)
      val __trafficVerticalCategories = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.trafficVerticalCategories)
      val __trafficCountries = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Country] ++= this.trafficCountries)
      var __minimumPaymentThreshold = this.minimumPaymentThreshold
      var __autoPaymentFee = this.autoPaymentFee
      var __paymentTo = this.paymentTo
      var __taxClass = this.taxClass
      var __ssnTaxId = this.ssnTaxId
      var __payVat = this.payVat
      var __swiftIban = this.swiftIban
      var __referralsEnabled = this.referralsEnabled
      var __referredByAffiliate = this.referredByAffiliate
      var __referralInfo = this.referralInfo
      var __billingCycle = this.billingCycle
      var __currency = this.currency
      var __currencyPaymentSetting = this.currencyPaymentSetting
      var __onlineSignup = this.onlineSignup
      var __payForConversions = this.payForConversions
      var __review = this.review
      var __reviewNewSubaffiliates = this.reviewNewSubaffiliates
      var __suppression = this.suppression
      var __pixelInfo = this.pixelInfo
      var __fireGlobalPixel = this.fireGlobalPixel
      val __blacklists = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Blacklist] ++= this.blacklists)
      var __redirectDomainOverride = this.redirectDomainOverride
      var __autoApproveCampaigns = this.autoApproveCampaigns
      var __autoApprovePixels = this.autoApprovePixels
      var __hideOffers = this.hideOffers
      var __dateCreated = this.dateCreated
      var __notes = this.notes
      var _done__ = false
      while (!_done__) {
        val _tag__ = __input.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 8 =>
            __id = Some(__input.readInt64())
          case 18 =>
            __name = Some(__input.readString())
          case 26 =>
            __tier = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __tier.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 34 =>
            __accountManager = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __accountManager.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 42 =>
            __accountStatus = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __accountStatus.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 50 =>
            __street1 = Some(__input.readString())
          case 58 =>
            __street2 = Some(__input.readString())
          case 66 =>
            __city = Some(__input.readString())
          case 74 =>
            __state = Some(__input.readString())
          case 82 =>
            __zipCode = Some(__input.readString())
          case 90 =>
            __country = Some(__input.readString())
          case 98 =>
            __website = Some(__input.readString())
          case 106 =>
            __paymentType = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __paymentType.getOrElse(cakeproto.affiliates.PaymentType.defaultInstance)))
          case 114 =>
            __contacts += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.Contact.defaultInstance)
          case 122 =>
            __tags += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.IdName.defaultInstance)
          case 130 =>
            __trafficPriceFormats += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.IdName.defaultInstance)
          case 138 =>
            __trafficMediaTypes += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.MediaType.defaultInstance)
          case 146 =>
            __trafficVerticalCategories += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.IdName.defaultInstance)
          case 154 =>
            __trafficCountries += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.Country.defaultInstance)
          case 161 =>
            __minimumPaymentThreshold = Some(__input.readDouble())
          case 169 =>
            __autoPaymentFee = Some(__input.readDouble())
          case 178 =>
            __paymentTo = Some(__input.readString())
          case 186 =>
            __taxClass = Some(__input.readString())
          case 194 =>
            __ssnTaxId = Some(__input.readString())
          case 200 =>
            __payVat = Some(__input.readBool())
          case 210 =>
            __swiftIban = Some(__input.readString())
          case 216 =>
            __referralsEnabled = Some(__input.readBool())
          case 226 =>
            __referredByAffiliate = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __referredByAffiliate.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 234 =>
            __referralInfo = Some(__input.readString())
          case 242 =>
            __billingCycle = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __billingCycle.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 250 =>
            __currency = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __currency.getOrElse(cakeproto.common.Currency.defaultInstance)))
          case 258 =>
            __currencyPaymentSetting = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __currencyPaymentSetting.getOrElse(cakeproto.common.IdName.defaultInstance)))
          case 264 =>
            __onlineSignup = Some(__input.readBool())
          case 272 =>
            __payForConversions = Some(__input.readBool())
          case 280 =>
            __review = Some(__input.readBool())
          case 288 =>
            __reviewNewSubaffiliates = Some(__input.readBool())
          case 296 =>
            __suppression = Some(__input.readBool())
          case 306 =>
            __pixelInfo = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __pixelInfo.getOrElse(cakeproto.common.PixelInfo.defaultInstance)))
          case 312 =>
            __fireGlobalPixel = Some(__input.readBool())
          case 322 =>
            __blacklists += com.trueaccord.scalapb.LiteParser.readMessage(__input, cakeproto.common.Blacklist.defaultInstance)
          case 330 =>
            __redirectDomainOverride = Some(__input.readString())
          case 336 =>
            __autoApproveCampaigns = Some(__input.readBool())
          case 344 =>
            __autoApprovePixels = Some(__input.readBool())
          case 352 =>
            __hideOffers = Some(__input.readBool())
          case 362 =>
            __dateCreated = Some(com.trueaccord.scalapb.LiteParser.readMessage(__input, __dateCreated.getOrElse(cakeproto.common.TimeWithZone.defaultInstance)))
          case 370 =>
            __notes = Some(__input.readString())
          case tag => __input.skipField(tag)
        }
      }
      cakeproto.affiliates.Affiliate(
          id = __id,
          name = __name,
          tier = __tier,
          accountManager = __accountManager,
          accountStatus = __accountStatus,
          street1 = __street1,
          street2 = __street2,
          city = __city,
          state = __state,
          zipCode = __zipCode,
          country = __country,
          website = __website,
          paymentType = __paymentType,
          contacts = __contacts.result(),
          tags = __tags.result(),
          trafficPriceFormats = __trafficPriceFormats.result(),
          trafficMediaTypes = __trafficMediaTypes.result(),
          trafficVerticalCategories = __trafficVerticalCategories.result(),
          trafficCountries = __trafficCountries.result(),
          minimumPaymentThreshold = __minimumPaymentThreshold,
          autoPaymentFee = __autoPaymentFee,
          paymentTo = __paymentTo,
          taxClass = __taxClass,
          ssnTaxId = __ssnTaxId,
          payVat = __payVat,
          swiftIban = __swiftIban,
          referralsEnabled = __referralsEnabled,
          referredByAffiliate = __referredByAffiliate,
          referralInfo = __referralInfo,
          billingCycle = __billingCycle,
          currency = __currency,
          currencyPaymentSetting = __currencyPaymentSetting,
          onlineSignup = __onlineSignup,
          payForConversions = __payForConversions,
          review = __review,
          reviewNewSubaffiliates = __reviewNewSubaffiliates,
          suppression = __suppression,
          pixelInfo = __pixelInfo,
          fireGlobalPixel = __fireGlobalPixel,
          blacklists = __blacklists.result(),
          redirectDomainOverride = __redirectDomainOverride,
          autoApproveCampaigns = __autoApproveCampaigns,
          autoApprovePixels = __autoApprovePixels,
          hideOffers = __hideOffers,
          dateCreated = __dateCreated,
          notes = __notes
      )
    }
    def getId: Long = id.getOrElse(0L)
    def clearId: Affiliate = copy(id = None)
    def withId(__v: Long): Affiliate = copy(id = Some(__v))
    def getName: String = name.getOrElse("")
    def clearName: Affiliate = copy(name = None)
    def withName(__v: String): Affiliate = copy(name = Some(__v))
    def getTier: cakeproto.common.IdName = tier.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearTier: Affiliate = copy(tier = None)
    def withTier(__v: cakeproto.common.IdName): Affiliate = copy(tier = Some(__v))
    def getAccountManager: cakeproto.common.IdName = accountManager.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearAccountManager: Affiliate = copy(accountManager = None)
    def withAccountManager(__v: cakeproto.common.IdName): Affiliate = copy(accountManager = Some(__v))
    def getAccountStatus: cakeproto.common.IdName = accountStatus.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearAccountStatus: Affiliate = copy(accountStatus = None)
    def withAccountStatus(__v: cakeproto.common.IdName): Affiliate = copy(accountStatus = Some(__v))
    def getStreet1: String = street1.getOrElse("")
    def clearStreet1: Affiliate = copy(street1 = None)
    def withStreet1(__v: String): Affiliate = copy(street1 = Some(__v))
    def getStreet2: String = street2.getOrElse("")
    def clearStreet2: Affiliate = copy(street2 = None)
    def withStreet2(__v: String): Affiliate = copy(street2 = Some(__v))
    def getCity: String = city.getOrElse("")
    def clearCity: Affiliate = copy(city = None)
    def withCity(__v: String): Affiliate = copy(city = Some(__v))
    def getState: String = state.getOrElse("")
    def clearState: Affiliate = copy(state = None)
    def withState(__v: String): Affiliate = copy(state = Some(__v))
    def getZipCode: String = zipCode.getOrElse("")
    def clearZipCode: Affiliate = copy(zipCode = None)
    def withZipCode(__v: String): Affiliate = copy(zipCode = Some(__v))
    def getCountry: String = country.getOrElse("")
    def clearCountry: Affiliate = copy(country = None)
    def withCountry(__v: String): Affiliate = copy(country = Some(__v))
    def getWebsite: String = website.getOrElse("")
    def clearWebsite: Affiliate = copy(website = None)
    def withWebsite(__v: String): Affiliate = copy(website = Some(__v))
    def getPaymentType: cakeproto.affiliates.PaymentType = paymentType.getOrElse(cakeproto.affiliates.PaymentType.defaultInstance)
    def clearPaymentType: Affiliate = copy(paymentType = None)
    def withPaymentType(__v: cakeproto.affiliates.PaymentType): Affiliate = copy(paymentType = Some(__v))
    def clearContacts = copy(contacts = Seq.empty)
    def addContacts(__vs: cakeproto.common.Contact*): Affiliate = addAllContacts(__vs)
    def addAllContacts(__vs: TraversableOnce[cakeproto.common.Contact]): Affiliate = copy(contacts = contacts ++ __vs)
    def withContacts(__v: Seq[cakeproto.common.Contact]): Affiliate = copy(contacts = __v)
    def clearTags = copy(tags = Seq.empty)
    def addTags(__vs: cakeproto.common.IdName*): Affiliate = addAllTags(__vs)
    def addAllTags(__vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(tags = tags ++ __vs)
    def withTags(__v: Seq[cakeproto.common.IdName]): Affiliate = copy(tags = __v)
    def clearTrafficPriceFormats = copy(trafficPriceFormats = Seq.empty)
    def addTrafficPriceFormats(__vs: cakeproto.common.IdName*): Affiliate = addAllTrafficPriceFormats(__vs)
    def addAllTrafficPriceFormats(__vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(trafficPriceFormats = trafficPriceFormats ++ __vs)
    def withTrafficPriceFormats(__v: Seq[cakeproto.common.IdName]): Affiliate = copy(trafficPriceFormats = __v)
    def clearTrafficMediaTypes = copy(trafficMediaTypes = Seq.empty)
    def addTrafficMediaTypes(__vs: cakeproto.common.MediaType*): Affiliate = addAllTrafficMediaTypes(__vs)
    def addAllTrafficMediaTypes(__vs: TraversableOnce[cakeproto.common.MediaType]): Affiliate = copy(trafficMediaTypes = trafficMediaTypes ++ __vs)
    def withTrafficMediaTypes(__v: Seq[cakeproto.common.MediaType]): Affiliate = copy(trafficMediaTypes = __v)
    def clearTrafficVerticalCategories = copy(trafficVerticalCategories = Seq.empty)
    def addTrafficVerticalCategories(__vs: cakeproto.common.IdName*): Affiliate = addAllTrafficVerticalCategories(__vs)
    def addAllTrafficVerticalCategories(__vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(trafficVerticalCategories = trafficVerticalCategories ++ __vs)
    def withTrafficVerticalCategories(__v: Seq[cakeproto.common.IdName]): Affiliate = copy(trafficVerticalCategories = __v)
    def clearTrafficCountries = copy(trafficCountries = Seq.empty)
    def addTrafficCountries(__vs: cakeproto.common.Country*): Affiliate = addAllTrafficCountries(__vs)
    def addAllTrafficCountries(__vs: TraversableOnce[cakeproto.common.Country]): Affiliate = copy(trafficCountries = trafficCountries ++ __vs)
    def withTrafficCountries(__v: Seq[cakeproto.common.Country]): Affiliate = copy(trafficCountries = __v)
    def getMinimumPaymentThreshold: Double = minimumPaymentThreshold.getOrElse(0.0)
    def clearMinimumPaymentThreshold: Affiliate = copy(minimumPaymentThreshold = None)
    def withMinimumPaymentThreshold(__v: Double): Affiliate = copy(minimumPaymentThreshold = Some(__v))
    def getAutoPaymentFee: Double = autoPaymentFee.getOrElse(0.0)
    def clearAutoPaymentFee: Affiliate = copy(autoPaymentFee = None)
    def withAutoPaymentFee(__v: Double): Affiliate = copy(autoPaymentFee = Some(__v))
    def getPaymentTo: String = paymentTo.getOrElse("")
    def clearPaymentTo: Affiliate = copy(paymentTo = None)
    def withPaymentTo(__v: String): Affiliate = copy(paymentTo = Some(__v))
    def getTaxClass: String = taxClass.getOrElse("")
    def clearTaxClass: Affiliate = copy(taxClass = None)
    def withTaxClass(__v: String): Affiliate = copy(taxClass = Some(__v))
    def getSsnTaxId: String = ssnTaxId.getOrElse("")
    def clearSsnTaxId: Affiliate = copy(ssnTaxId = None)
    def withSsnTaxId(__v: String): Affiliate = copy(ssnTaxId = Some(__v))
    def getPayVat: Boolean = payVat.getOrElse(false)
    def clearPayVat: Affiliate = copy(payVat = None)
    def withPayVat(__v: Boolean): Affiliate = copy(payVat = Some(__v))
    def getSwiftIban: String = swiftIban.getOrElse("")
    def clearSwiftIban: Affiliate = copy(swiftIban = None)
    def withSwiftIban(__v: String): Affiliate = copy(swiftIban = Some(__v))
    def getReferralsEnabled: Boolean = referralsEnabled.getOrElse(false)
    def clearReferralsEnabled: Affiliate = copy(referralsEnabled = None)
    def withReferralsEnabled(__v: Boolean): Affiliate = copy(referralsEnabled = Some(__v))
    def getReferredByAffiliate: cakeproto.common.IdName = referredByAffiliate.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearReferredByAffiliate: Affiliate = copy(referredByAffiliate = None)
    def withReferredByAffiliate(__v: cakeproto.common.IdName): Affiliate = copy(referredByAffiliate = Some(__v))
    def getReferralInfo: String = referralInfo.getOrElse("")
    def clearReferralInfo: Affiliate = copy(referralInfo = None)
    def withReferralInfo(__v: String): Affiliate = copy(referralInfo = Some(__v))
    def getBillingCycle: cakeproto.common.IdName = billingCycle.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearBillingCycle: Affiliate = copy(billingCycle = None)
    def withBillingCycle(__v: cakeproto.common.IdName): Affiliate = copy(billingCycle = Some(__v))
    def getCurrency: cakeproto.common.Currency = currency.getOrElse(cakeproto.common.Currency.defaultInstance)
    def clearCurrency: Affiliate = copy(currency = None)
    def withCurrency(__v: cakeproto.common.Currency): Affiliate = copy(currency = Some(__v))
    def getCurrencyPaymentSetting: cakeproto.common.IdName = currencyPaymentSetting.getOrElse(cakeproto.common.IdName.defaultInstance)
    def clearCurrencyPaymentSetting: Affiliate = copy(currencyPaymentSetting = None)
    def withCurrencyPaymentSetting(__v: cakeproto.common.IdName): Affiliate = copy(currencyPaymentSetting = Some(__v))
    def getOnlineSignup: Boolean = onlineSignup.getOrElse(false)
    def clearOnlineSignup: Affiliate = copy(onlineSignup = None)
    def withOnlineSignup(__v: Boolean): Affiliate = copy(onlineSignup = Some(__v))
    def getPayForConversions: Boolean = payForConversions.getOrElse(false)
    def clearPayForConversions: Affiliate = copy(payForConversions = None)
    def withPayForConversions(__v: Boolean): Affiliate = copy(payForConversions = Some(__v))
    def getReview: Boolean = review.getOrElse(false)
    def clearReview: Affiliate = copy(review = None)
    def withReview(__v: Boolean): Affiliate = copy(review = Some(__v))
    def getReviewNewSubaffiliates: Boolean = reviewNewSubaffiliates.getOrElse(false)
    def clearReviewNewSubaffiliates: Affiliate = copy(reviewNewSubaffiliates = None)
    def withReviewNewSubaffiliates(__v: Boolean): Affiliate = copy(reviewNewSubaffiliates = Some(__v))
    def getSuppression: Boolean = suppression.getOrElse(false)
    def clearSuppression: Affiliate = copy(suppression = None)
    def withSuppression(__v: Boolean): Affiliate = copy(suppression = Some(__v))
    def getPixelInfo: cakeproto.common.PixelInfo = pixelInfo.getOrElse(cakeproto.common.PixelInfo.defaultInstance)
    def clearPixelInfo: Affiliate = copy(pixelInfo = None)
    def withPixelInfo(__v: cakeproto.common.PixelInfo): Affiliate = copy(pixelInfo = Some(__v))
    def getFireGlobalPixel: Boolean = fireGlobalPixel.getOrElse(false)
    def clearFireGlobalPixel: Affiliate = copy(fireGlobalPixel = None)
    def withFireGlobalPixel(__v: Boolean): Affiliate = copy(fireGlobalPixel = Some(__v))
    def clearBlacklists = copy(blacklists = Seq.empty)
    def addBlacklists(__vs: cakeproto.common.Blacklist*): Affiliate = addAllBlacklists(__vs)
    def addAllBlacklists(__vs: TraversableOnce[cakeproto.common.Blacklist]): Affiliate = copy(blacklists = blacklists ++ __vs)
    def withBlacklists(__v: Seq[cakeproto.common.Blacklist]): Affiliate = copy(blacklists = __v)
    def getRedirectDomainOverride: String = redirectDomainOverride.getOrElse("")
    def clearRedirectDomainOverride: Affiliate = copy(redirectDomainOverride = None)
    def withRedirectDomainOverride(__v: String): Affiliate = copy(redirectDomainOverride = Some(__v))
    def getAutoApproveCampaigns: Boolean = autoApproveCampaigns.getOrElse(false)
    def clearAutoApproveCampaigns: Affiliate = copy(autoApproveCampaigns = None)
    def withAutoApproveCampaigns(__v: Boolean): Affiliate = copy(autoApproveCampaigns = Some(__v))
    def getAutoApprovePixels: Boolean = autoApprovePixels.getOrElse(false)
    def clearAutoApprovePixels: Affiliate = copy(autoApprovePixels = None)
    def withAutoApprovePixels(__v: Boolean): Affiliate = copy(autoApprovePixels = Some(__v))
    def getHideOffers: Boolean = hideOffers.getOrElse(false)
    def clearHideOffers: Affiliate = copy(hideOffers = None)
    def withHideOffers(__v: Boolean): Affiliate = copy(hideOffers = Some(__v))
    def getDateCreated: cakeproto.common.TimeWithZone = dateCreated.getOrElse(cakeproto.common.TimeWithZone.defaultInstance)
    def clearDateCreated: Affiliate = copy(dateCreated = None)
    def withDateCreated(__v: cakeproto.common.TimeWithZone): Affiliate = copy(dateCreated = Some(__v))
    def getNotes: String = notes.getOrElse("")
    def clearNotes: Affiliate = copy(notes = None)
    def withNotes(__v: String): Affiliate = copy(notes = Some(__v))
    def getField(__field: com.google.protobuf.Descriptors.FieldDescriptor): scala.Any = {
      __field.getNumber match {
        case 1 => id.getOrElse(null)
        case 2 => name.getOrElse(null)
        case 3 => tier.getOrElse(null)
        case 4 => accountManager.getOrElse(null)
        case 5 => accountStatus.getOrElse(null)
        case 6 => street1.getOrElse(null)
        case 7 => street2.getOrElse(null)
        case 8 => city.getOrElse(null)
        case 9 => state.getOrElse(null)
        case 10 => zipCode.getOrElse(null)
        case 11 => country.getOrElse(null)
        case 12 => website.getOrElse(null)
        case 13 => paymentType.getOrElse(null)
        case 14 => contacts
        case 15 => tags
        case 16 => trafficPriceFormats
        case 17 => trafficMediaTypes
        case 18 => trafficVerticalCategories
        case 19 => trafficCountries
        case 20 => minimumPaymentThreshold.getOrElse(null)
        case 21 => autoPaymentFee.getOrElse(null)
        case 22 => paymentTo.getOrElse(null)
        case 23 => taxClass.getOrElse(null)
        case 24 => ssnTaxId.getOrElse(null)
        case 25 => payVat.getOrElse(null)
        case 26 => swiftIban.getOrElse(null)
        case 27 => referralsEnabled.getOrElse(null)
        case 28 => referredByAffiliate.getOrElse(null)
        case 29 => referralInfo.getOrElse(null)
        case 30 => billingCycle.getOrElse(null)
        case 31 => currency.getOrElse(null)
        case 32 => currencyPaymentSetting.getOrElse(null)
        case 33 => onlineSignup.getOrElse(null)
        case 34 => payForConversions.getOrElse(null)
        case 35 => review.getOrElse(null)
        case 36 => reviewNewSubaffiliates.getOrElse(null)
        case 37 => suppression.getOrElse(null)
        case 38 => pixelInfo.getOrElse(null)
        case 39 => fireGlobalPixel.getOrElse(null)
        case 40 => blacklists
        case 41 => redirectDomainOverride.getOrElse(null)
        case 42 => autoApproveCampaigns.getOrElse(null)
        case 43 => autoApprovePixels.getOrElse(null)
        case 44 => hideOffers.getOrElse(null)
        case 45 => dateCreated.getOrElse(null)
        case 46 => notes.getOrElse(null)
      }
    }
    override def toString: String = com.trueaccord.scalapb.TextFormat.printToUnicodeString(this)
    def companion = cakeproto.affiliates.Affiliate
}

object Affiliate extends com.trueaccord.scalapb.GeneratedMessageCompanion[Affiliate]  {
  implicit def messageCompanion: com.trueaccord.scalapb.GeneratedMessageCompanion[Affiliate]  = this
  def fromFieldsMap(__fieldsMap: Map[com.google.protobuf.Descriptors.FieldDescriptor, scala.Any]): cakeproto.affiliates.Affiliate = {
    require(__fieldsMap.keys.forall(_.getContainingType() == descriptor), "FieldDescriptor does not match message type.")
    val __fields = descriptor.getFields
    cakeproto.affiliates.Affiliate(
      __fieldsMap.get(__fields.get(0)).asInstanceOf[Option[Long]],
      __fieldsMap.get(__fields.get(1)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(2)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(3)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(4)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(5)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(6)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(7)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(8)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(9)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(10)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(11)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(12)).asInstanceOf[Option[cakeproto.affiliates.PaymentType]],
      __fieldsMap.getOrElse(__fields.get(13), Nil).asInstanceOf[Seq[cakeproto.common.Contact]],
      __fieldsMap.getOrElse(__fields.get(14), Nil).asInstanceOf[Seq[cakeproto.common.IdName]],
      __fieldsMap.getOrElse(__fields.get(15), Nil).asInstanceOf[Seq[cakeproto.common.IdName]],
      __fieldsMap.getOrElse(__fields.get(16), Nil).asInstanceOf[Seq[cakeproto.common.MediaType]],
      __fieldsMap.getOrElse(__fields.get(17), Nil).asInstanceOf[Seq[cakeproto.common.IdName]],
      __fieldsMap.getOrElse(__fields.get(18), Nil).asInstanceOf[Seq[cakeproto.common.Country]],
      __fieldsMap.get(__fields.get(19)).asInstanceOf[Option[Double]],
      __fieldsMap.get(__fields.get(20)).asInstanceOf[Option[Double]],
      __fieldsMap.get(__fields.get(21)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(22)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(23)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(24)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(25)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(26)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(27)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(28)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(29)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(30)).asInstanceOf[Option[cakeproto.common.Currency]],
      __fieldsMap.get(__fields.get(31)).asInstanceOf[Option[cakeproto.common.IdName]],
      __fieldsMap.get(__fields.get(32)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(33)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(34)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(35)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(36)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(37)).asInstanceOf[Option[cakeproto.common.PixelInfo]],
      __fieldsMap.get(__fields.get(38)).asInstanceOf[Option[Boolean]],
      __fieldsMap.getOrElse(__fields.get(39), Nil).asInstanceOf[Seq[cakeproto.common.Blacklist]],
      __fieldsMap.get(__fields.get(40)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(41)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(42)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(43)).asInstanceOf[Option[Boolean]],
      __fieldsMap.get(__fields.get(44)).asInstanceOf[Option[cakeproto.common.TimeWithZone]],
      __fieldsMap.get(__fields.get(45)).asInstanceOf[Option[String]]
    )
  }
  def descriptor: com.google.protobuf.Descriptors.Descriptor = AffiliatesProto.descriptor.getMessageTypes.get(0)
  def messageCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedMessageCompanion[_] = {
    require(__field.getContainingType() == descriptor, "FieldDescriptor does not match message type.")
    var __out: com.trueaccord.scalapb.GeneratedMessageCompanion[_] = null
    __field.getNumber match {
      case 3 => __out = cakeproto.common.IdName
      case 4 => __out = cakeproto.common.IdName
      case 5 => __out = cakeproto.common.IdName
      case 13 => __out = cakeproto.affiliates.PaymentType
      case 14 => __out = cakeproto.common.Contact
      case 15 => __out = cakeproto.common.IdName
      case 16 => __out = cakeproto.common.IdName
      case 17 => __out = cakeproto.common.MediaType
      case 18 => __out = cakeproto.common.IdName
      case 19 => __out = cakeproto.common.Country
      case 28 => __out = cakeproto.common.IdName
      case 30 => __out = cakeproto.common.IdName
      case 31 => __out = cakeproto.common.Currency
      case 32 => __out = cakeproto.common.IdName
      case 38 => __out = cakeproto.common.PixelInfo
      case 40 => __out = cakeproto.common.Blacklist
      case 45 => __out = cakeproto.common.TimeWithZone
    }
  __out
  }
  def enumCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__field)
  lazy val defaultInstance = cakeproto.affiliates.Affiliate(
  )

  implicit class AffiliateLens[UpperPB](_l: com.trueaccord.lenses.Lens[UpperPB, Affiliate]) extends com.trueaccord.lenses.ObjectLens[UpperPB, Affiliate](_l) {
    def id: com.trueaccord.lenses.Lens[UpperPB, Long] = field(_.getId)((c_, f_) => c_.copy(id = Some(f_)))
    def optionalId: com.trueaccord.lenses.Lens[UpperPB, Option[Long]] = field(_.id)((c_, f_) => c_.copy(id = f_))
    def name: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getName)((c_, f_) => c_.copy(name = Some(f_)))
    def optionalName: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.name)((c_, f_) => c_.copy(name = f_))
    def tier: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getTier)((c_, f_) => c_.copy(tier = Some(f_)))
    def optionalTier: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.tier)((c_, f_) => c_.copy(tier = f_))
    def accountManager: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getAccountManager)((c_, f_) => c_.copy(accountManager = Some(f_)))
    def optionalAccountManager: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.accountManager)((c_, f_) => c_.copy(accountManager = f_))
    def accountStatus: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getAccountStatus)((c_, f_) => c_.copy(accountStatus = Some(f_)))
    def optionalAccountStatus: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.accountStatus)((c_, f_) => c_.copy(accountStatus = f_))
    def street1: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getStreet1)((c_, f_) => c_.copy(street1 = Some(f_)))
    def optionalStreet1: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.street1)((c_, f_) => c_.copy(street1 = f_))
    def street2: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getStreet2)((c_, f_) => c_.copy(street2 = Some(f_)))
    def optionalStreet2: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.street2)((c_, f_) => c_.copy(street2 = f_))
    def city: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getCity)((c_, f_) => c_.copy(city = Some(f_)))
    def optionalCity: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.city)((c_, f_) => c_.copy(city = f_))
    def state: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getState)((c_, f_) => c_.copy(state = Some(f_)))
    def optionalState: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.state)((c_, f_) => c_.copy(state = f_))
    def zipCode: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getZipCode)((c_, f_) => c_.copy(zipCode = Some(f_)))
    def optionalZipCode: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.zipCode)((c_, f_) => c_.copy(zipCode = f_))
    def country: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getCountry)((c_, f_) => c_.copy(country = Some(f_)))
    def optionalCountry: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.country)((c_, f_) => c_.copy(country = f_))
    def website: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getWebsite)((c_, f_) => c_.copy(website = Some(f_)))
    def optionalWebsite: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.website)((c_, f_) => c_.copy(website = f_))
    def paymentType: com.trueaccord.lenses.Lens[UpperPB, cakeproto.affiliates.PaymentType] = field(_.getPaymentType)((c_, f_) => c_.copy(paymentType = Some(f_)))
    def optionalPaymentType: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.affiliates.PaymentType]] = field(_.paymentType)((c_, f_) => c_.copy(paymentType = f_))
    def contacts: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.Contact]] = field(_.contacts)((c_, f_) => c_.copy(contacts = f_))
    def tags: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.IdName]] = field(_.tags)((c_, f_) => c_.copy(tags = f_))
    def trafficPriceFormats: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.IdName]] = field(_.trafficPriceFormats)((c_, f_) => c_.copy(trafficPriceFormats = f_))
    def trafficMediaTypes: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.MediaType]] = field(_.trafficMediaTypes)((c_, f_) => c_.copy(trafficMediaTypes = f_))
    def trafficVerticalCategories: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.IdName]] = field(_.trafficVerticalCategories)((c_, f_) => c_.copy(trafficVerticalCategories = f_))
    def trafficCountries: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.Country]] = field(_.trafficCountries)((c_, f_) => c_.copy(trafficCountries = f_))
    def minimumPaymentThreshold: com.trueaccord.lenses.Lens[UpperPB, Double] = field(_.getMinimumPaymentThreshold)((c_, f_) => c_.copy(minimumPaymentThreshold = Some(f_)))
    def optionalMinimumPaymentThreshold: com.trueaccord.lenses.Lens[UpperPB, Option[Double]] = field(_.minimumPaymentThreshold)((c_, f_) => c_.copy(minimumPaymentThreshold = f_))
    def autoPaymentFee: com.trueaccord.lenses.Lens[UpperPB, Double] = field(_.getAutoPaymentFee)((c_, f_) => c_.copy(autoPaymentFee = Some(f_)))
    def optionalAutoPaymentFee: com.trueaccord.lenses.Lens[UpperPB, Option[Double]] = field(_.autoPaymentFee)((c_, f_) => c_.copy(autoPaymentFee = f_))
    def paymentTo: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getPaymentTo)((c_, f_) => c_.copy(paymentTo = Some(f_)))
    def optionalPaymentTo: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.paymentTo)((c_, f_) => c_.copy(paymentTo = f_))
    def taxClass: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getTaxClass)((c_, f_) => c_.copy(taxClass = Some(f_)))
    def optionalTaxClass: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.taxClass)((c_, f_) => c_.copy(taxClass = f_))
    def ssnTaxId: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getSsnTaxId)((c_, f_) => c_.copy(ssnTaxId = Some(f_)))
    def optionalSsnTaxId: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.ssnTaxId)((c_, f_) => c_.copy(ssnTaxId = f_))
    def payVat: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getPayVat)((c_, f_) => c_.copy(payVat = Some(f_)))
    def optionalPayVat: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.payVat)((c_, f_) => c_.copy(payVat = f_))
    def swiftIban: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getSwiftIban)((c_, f_) => c_.copy(swiftIban = Some(f_)))
    def optionalSwiftIban: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.swiftIban)((c_, f_) => c_.copy(swiftIban = f_))
    def referralsEnabled: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getReferralsEnabled)((c_, f_) => c_.copy(referralsEnabled = Some(f_)))
    def optionalReferralsEnabled: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.referralsEnabled)((c_, f_) => c_.copy(referralsEnabled = f_))
    def referredByAffiliate: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getReferredByAffiliate)((c_, f_) => c_.copy(referredByAffiliate = Some(f_)))
    def optionalReferredByAffiliate: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.referredByAffiliate)((c_, f_) => c_.copy(referredByAffiliate = f_))
    def referralInfo: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getReferralInfo)((c_, f_) => c_.copy(referralInfo = Some(f_)))
    def optionalReferralInfo: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.referralInfo)((c_, f_) => c_.copy(referralInfo = f_))
    def billingCycle: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getBillingCycle)((c_, f_) => c_.copy(billingCycle = Some(f_)))
    def optionalBillingCycle: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.billingCycle)((c_, f_) => c_.copy(billingCycle = f_))
    def currency: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.Currency] = field(_.getCurrency)((c_, f_) => c_.copy(currency = Some(f_)))
    def optionalCurrency: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.Currency]] = field(_.currency)((c_, f_) => c_.copy(currency = f_))
    def currencyPaymentSetting: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.IdName] = field(_.getCurrencyPaymentSetting)((c_, f_) => c_.copy(currencyPaymentSetting = Some(f_)))
    def optionalCurrencyPaymentSetting: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.IdName]] = field(_.currencyPaymentSetting)((c_, f_) => c_.copy(currencyPaymentSetting = f_))
    def onlineSignup: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getOnlineSignup)((c_, f_) => c_.copy(onlineSignup = Some(f_)))
    def optionalOnlineSignup: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.onlineSignup)((c_, f_) => c_.copy(onlineSignup = f_))
    def payForConversions: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getPayForConversions)((c_, f_) => c_.copy(payForConversions = Some(f_)))
    def optionalPayForConversions: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.payForConversions)((c_, f_) => c_.copy(payForConversions = f_))
    def review: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getReview)((c_, f_) => c_.copy(review = Some(f_)))
    def optionalReview: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.review)((c_, f_) => c_.copy(review = f_))
    def reviewNewSubaffiliates: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getReviewNewSubaffiliates)((c_, f_) => c_.copy(reviewNewSubaffiliates = Some(f_)))
    def optionalReviewNewSubaffiliates: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.reviewNewSubaffiliates)((c_, f_) => c_.copy(reviewNewSubaffiliates = f_))
    def suppression: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getSuppression)((c_, f_) => c_.copy(suppression = Some(f_)))
    def optionalSuppression: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.suppression)((c_, f_) => c_.copy(suppression = f_))
    def pixelInfo: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.PixelInfo] = field(_.getPixelInfo)((c_, f_) => c_.copy(pixelInfo = Some(f_)))
    def optionalPixelInfo: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.PixelInfo]] = field(_.pixelInfo)((c_, f_) => c_.copy(pixelInfo = f_))
    def fireGlobalPixel: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getFireGlobalPixel)((c_, f_) => c_.copy(fireGlobalPixel = Some(f_)))
    def optionalFireGlobalPixel: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.fireGlobalPixel)((c_, f_) => c_.copy(fireGlobalPixel = f_))
    def blacklists: com.trueaccord.lenses.Lens[UpperPB, Seq[cakeproto.common.Blacklist]] = field(_.blacklists)((c_, f_) => c_.copy(blacklists = f_))
    def redirectDomainOverride: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getRedirectDomainOverride)((c_, f_) => c_.copy(redirectDomainOverride = Some(f_)))
    def optionalRedirectDomainOverride: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.redirectDomainOverride)((c_, f_) => c_.copy(redirectDomainOverride = f_))
    def autoApproveCampaigns: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getAutoApproveCampaigns)((c_, f_) => c_.copy(autoApproveCampaigns = Some(f_)))
    def optionalAutoApproveCampaigns: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.autoApproveCampaigns)((c_, f_) => c_.copy(autoApproveCampaigns = f_))
    def autoApprovePixels: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getAutoApprovePixels)((c_, f_) => c_.copy(autoApprovePixels = Some(f_)))
    def optionalAutoApprovePixels: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.autoApprovePixels)((c_, f_) => c_.copy(autoApprovePixels = f_))
    def hideOffers: com.trueaccord.lenses.Lens[UpperPB, Boolean] = field(_.getHideOffers)((c_, f_) => c_.copy(hideOffers = Some(f_)))
    def optionalHideOffers: com.trueaccord.lenses.Lens[UpperPB, Option[Boolean]] = field(_.hideOffers)((c_, f_) => c_.copy(hideOffers = f_))
    def dateCreated: com.trueaccord.lenses.Lens[UpperPB, cakeproto.common.TimeWithZone] = field(_.getDateCreated)((c_, f_) => c_.copy(dateCreated = Some(f_)))
    def optionalDateCreated: com.trueaccord.lenses.Lens[UpperPB, Option[cakeproto.common.TimeWithZone]] = field(_.dateCreated)((c_, f_) => c_.copy(dateCreated = f_))
    def notes: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getNotes)((c_, f_) => c_.copy(notes = Some(f_)))
    def optionalNotes: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.notes)((c_, f_) => c_.copy(notes = f_))
  }
  final val ID_FIELD_NUMBER = 1
  final val NAME_FIELD_NUMBER = 2
  final val TIER_FIELD_NUMBER = 3
  final val ACCOUNT_MANAGER_FIELD_NUMBER = 4
  final val ACCOUNT_STATUS_FIELD_NUMBER = 5
  final val STREET1_FIELD_NUMBER = 6
  final val STREET2_FIELD_NUMBER = 7
  final val CITY_FIELD_NUMBER = 8
  final val STATE_FIELD_NUMBER = 9
  final val ZIP_CODE_FIELD_NUMBER = 10
  final val COUNTRY_FIELD_NUMBER = 11
  final val WEBSITE_FIELD_NUMBER = 12
  final val PAYMENT_TYPE_FIELD_NUMBER = 13
  final val CONTACTS_FIELD_NUMBER = 14
  final val TAGS_FIELD_NUMBER = 15
  final val TRAFFIC_PRICE_FORMATS_FIELD_NUMBER = 16
  final val TRAFFIC_MEDIA_TYPES_FIELD_NUMBER = 17
  final val TRAFFIC_VERTICAL_CATEGORIES_FIELD_NUMBER = 18
  final val TRAFFIC_COUNTRIES_FIELD_NUMBER = 19
  final val MINIMUM_PAYMENT_THRESHOLD_FIELD_NUMBER = 20
  final val AUTO_PAYMENT_FEE_FIELD_NUMBER = 21
  final val PAYMENT_TO_FIELD_NUMBER = 22
  final val TAX_CLASS_FIELD_NUMBER = 23
  final val SSN_TAX_ID_FIELD_NUMBER = 24
  final val PAY_VAT_FIELD_NUMBER = 25
  final val SWIFT_IBAN_FIELD_NUMBER = 26
  final val REFERRALS_ENABLED_FIELD_NUMBER = 27
  final val REFERRED_BY_AFFILIATE_FIELD_NUMBER = 28
  final val REFERRAL_INFO_FIELD_NUMBER = 29
  final val BILLING_CYCLE_FIELD_NUMBER = 30
  final val CURRENCY_FIELD_NUMBER = 31
  final val CURRENCY_PAYMENT_SETTING_FIELD_NUMBER = 32
  final val ONLINE_SIGNUP_FIELD_NUMBER = 33
  final val PAY_FOR_CONVERSIONS_FIELD_NUMBER = 34
  final val REVIEW_FIELD_NUMBER = 35
  final val REVIEW_NEW_SUBAFFILIATES_FIELD_NUMBER = 36
  final val SUPPRESSION_FIELD_NUMBER = 37
  final val PIXEL_INFO_FIELD_NUMBER = 38
  final val FIRE_GLOBAL_PIXEL_FIELD_NUMBER = 39
  final val BLACKLISTS_FIELD_NUMBER = 40
  final val REDIRECT_DOMAIN_OVERRIDE_FIELD_NUMBER = 41
  final val AUTO_APPROVE_CAMPAIGNS_FIELD_NUMBER = 42
  final val AUTO_APPROVE_PIXELS_FIELD_NUMBER = 43
  final val HIDE_OFFERS_FIELD_NUMBER = 44
  final val DATE_CREATED_FIELD_NUMBER = 45
  final val NOTES_FIELD_NUMBER = 46
}

@SerialVersionUID(0L)
final case class PaymentType(
    id: Option[Long] = None,
    name: Option[String] = None,
    info: Option[String] = None
    ) extends com.trueaccord.scalapb.GeneratedMessage with com.trueaccord.scalapb.Message[PaymentType] with com.trueaccord.lenses.Updatable[PaymentType] {
    @transient
    lazy val serializedSize: Int = {
      var __size = 0
      if (id.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id.get) }
      if (name.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(2, name.get) }
      if (info.isDefined) { __size += com.google.protobuf.CodedOutputStream.computeStringSize(3, info.get) }
      __size
    }
    def writeTo(output: com.google.protobuf.CodedOutputStream): Unit = {
      id.foreach { __v => 
        output.writeInt64(1, __v)
      };
      name.foreach { __v => 
        output.writeString(2, __v)
      };
      info.foreach { __v => 
        output.writeString(3, __v)
      };
    }
    def mergeFrom(__input: com.google.protobuf.CodedInputStream): cakeproto.affiliates.PaymentType = {
      var __id = this.id
      var __name = this.name
      var __info = this.info
      var _done__ = false
      while (!_done__) {
        val _tag__ = __input.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 8 =>
            __id = Some(__input.readInt64())
          case 18 =>
            __name = Some(__input.readString())
          case 26 =>
            __info = Some(__input.readString())
          case tag => __input.skipField(tag)
        }
      }
      cakeproto.affiliates.PaymentType(
          id = __id,
          name = __name,
          info = __info
      )
    }
    def getId: Long = id.getOrElse(0L)
    def clearId: PaymentType = copy(id = None)
    def withId(__v: Long): PaymentType = copy(id = Some(__v))
    def getName: String = name.getOrElse("")
    def clearName: PaymentType = copy(name = None)
    def withName(__v: String): PaymentType = copy(name = Some(__v))
    def getInfo: String = info.getOrElse("")
    def clearInfo: PaymentType = copy(info = None)
    def withInfo(__v: String): PaymentType = copy(info = Some(__v))
    def getField(__field: com.google.protobuf.Descriptors.FieldDescriptor): scala.Any = {
      __field.getNumber match {
        case 1 => id.getOrElse(null)
        case 2 => name.getOrElse(null)
        case 3 => info.getOrElse(null)
      }
    }
    override def toString: String = com.trueaccord.scalapb.TextFormat.printToUnicodeString(this)
    def companion = cakeproto.affiliates.PaymentType
}

object PaymentType extends com.trueaccord.scalapb.GeneratedMessageCompanion[PaymentType]  {
  implicit def messageCompanion: com.trueaccord.scalapb.GeneratedMessageCompanion[PaymentType]  = this
  def fromFieldsMap(__fieldsMap: Map[com.google.protobuf.Descriptors.FieldDescriptor, scala.Any]): cakeproto.affiliates.PaymentType = {
    require(__fieldsMap.keys.forall(_.getContainingType() == descriptor), "FieldDescriptor does not match message type.")
    val __fields = descriptor.getFields
    cakeproto.affiliates.PaymentType(
      __fieldsMap.get(__fields.get(0)).asInstanceOf[Option[Long]],
      __fieldsMap.get(__fields.get(1)).asInstanceOf[Option[String]],
      __fieldsMap.get(__fields.get(2)).asInstanceOf[Option[String]]
    )
  }
  def descriptor: com.google.protobuf.Descriptors.Descriptor = cakeproto.affiliates.Affiliate.descriptor.getNestedTypes.get(0)
  def messageCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__field)
  def enumCompanionForField(__field: com.google.protobuf.Descriptors.FieldDescriptor): com.trueaccord.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__field)
  lazy val defaultInstance = cakeproto.affiliates.PaymentType(
  )
  implicit class PaymentTypeLens[UpperPB](_l: com.trueaccord.lenses.Lens[UpperPB, PaymentType]) extends com.trueaccord.lenses.ObjectLens[UpperPB, PaymentType](_l) {
    def id: com.trueaccord.lenses.Lens[UpperPB, Long] = field(_.getId)((c_, f_) => c_.copy(id = Some(f_)))
    def optionalId: com.trueaccord.lenses.Lens[UpperPB, Option[Long]] = field(_.id)((c_, f_) => c_.copy(id = f_))
    def name: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getName)((c_, f_) => c_.copy(name = Some(f_)))
    def optionalName: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.name)((c_, f_) => c_.copy(name = f_))
    def info: com.trueaccord.lenses.Lens[UpperPB, String] = field(_.getInfo)((c_, f_) => c_.copy(info = Some(f_)))
    def optionalInfo: com.trueaccord.lenses.Lens[UpperPB, Option[String]] = field(_.info)((c_, f_) => c_.copy(info = f_))
  }
  final val ID_FIELD_NUMBER = 1
  final val NAME_FIELD_NUMBER = 2
  final val INFO_FIELD_NUMBER = 3
}

Environment

It would be good to understand the source of this error and have a fix for it. Is there any configuration option to unfold PaymentType in generated code or any other ideas how it could be possible fixed?

thesamet commented 8 years ago

Can you send also the code around where this exception is thrown and also how you deploy your application to spark.

On Thu, Apr 21, 2016, 1:09 PM Zeke Fast notifications@github.com wrote:

Overview

I tried to google and investigate this issues by myself, but that not lead me to anything reasonable. Also I quite new to Scala and Spark, so it could be something dummy, but very appreciate any help!

I tried to generate wrappers using ScalaPB for cake protobuf definitions https://github.com/ad2games/cakeproto.

Everything seems working perfectly except one thing. When I tried to access data using cakeproto.affiliates.Affiliate class for affiliate https://github.com/ad2games/cakeproto/blob/c5844813ea85e7d20195578c353d8232e75a28a5/affiliates.proto it gives me follow error.

info] java.lang.ClassNotFoundException: cakeproto.affiliates.Affiliate.PaymentType [info] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) [info] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [info] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) [info] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [info] at java.lang.Class.forName0(Native Method) [info] at java.lang.Class.forName(Class.java:348) [info] at org.apache.spark.util.Utils$.classForName(Utils.scala:174) [info] at org.apache.spark.sql.catalyst.ScalaReflection$.org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor(ScalaReflection.scala:477) [info] at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$9.apply(ScalaReflection.scala:494) [info] at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$9.apply(ScalaReflection.scala:490)

In a short it can not find nested cakeproto.affiliates.Affiliate.PaymentType somehow. Details

Here is generated Affiliate wrapper .

// Generated by the Scala Plugin for the Protocol Buffer Compiler.// Do not edit!//// Protofile syntax: PROTO2 package cakeproto.affiliates

@SerialVersionUID(0L)final case class Affiliate( id: Option[Long] = None, name: Option[String] = None, tier: Option[cakeproto.common.IdName] = None, accountManager: Option[cakeproto.common.IdName] = None, accountStatus: Option[cakeproto.common.IdName] = None, street1: Option[String] = None, street2: Option[String] = None, city: Option[String] = None, state: Option[String] = None, zipCode: Option[String] = None, country: Option[String] = None, website: Option[String] = None, paymentType: Option[cakeproto.affiliates.Affiliate.PaymentType] = None, contacts: Seq[cakeproto.common.Contact] = Nil, tags: Seq[cakeproto.common.IdName] = Nil, trafficPriceFormats: Seq[cakeproto.common.IdName] = Nil, trafficMediaTypes: Seq[cakeproto.common.MediaType] = Nil, trafficVerticalCategories: Seq[cakeproto.common.IdName] = Nil, trafficCountries: Seq[cakeproto.common.Country] = Nil, minimumPaymentThreshold: Option[Double] = None, autoPaymentFee: Option[Double] = None, paymentTo: Option[String] = None, taxClass: Option[String] = None, ssnTaxId: Option[String] = None, payVat: Option[Boolean] = None, swiftIban: Option[String] = None, referralsEnabled: Option[Boolean] = None, referredByAffiliate: Option[cakeproto.common.IdName] = None, referralInfo: Option[String] = None, billingCycle: Option[cakeproto.common.IdName] = None, currency: Option[cakeproto.common.Currency] = None, currencyPaymentSetting: Option[cakeproto.common.IdName] = None, onlineSignup: Option[Boolean] = None, payForConversions: Option[Boolean] = None, review: Option[Boolean] = None, reviewNewSubaffiliates: Option[Boolean] = None, suppression: Option[Boolean] = None, pixelInfo: Option[cakeproto.common.PixelInfo] = None, fireGlobalPixel: Option[Boolean] = None, blacklists: Seq[cakeproto.common.Blacklist] = Nil, redirectDomainOverride: Option[String] = None, autoApproveCampaigns: Option[Boolean] = None, autoApprovePixels: Option[Boolean] = None, hideOffers: Option[Boolean] = None, dateCreated: Option[cakeproto.common.TimeWithZone] = None, notes: Option[String] = None ) extends com.trueaccord.scalapb.GeneratedMessage with com.trueaccord.scalapb.Message[Affiliate] with com.trueaccord.lenses.Updatable[Affiliate] { @transient lazy val serializedSize: Int = { var **size = 0 if (id.isDefined) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id.get) } if (name.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(2, name.get) } if (tier.isDefined) { size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(tier.get.serializedSize) + tier.get.serializedSize } if (accountManager.isDefined) { size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(accountManager.get.serializedSize) + accountManager.get.serializedSize } if (accountStatus.isDefined) { size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(accountStatus.get.serializedSize) + accountStatus.get.serializedSize } if (street1.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(6, street1.get) } if (street2.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(7, street2.get) } if (city.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(8, city.get) } if (state.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(9, state.get) } if (zipCode.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(10, zipCode.get) } if (country.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(11, country.get) } if (website.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(12, website.get) } if (paymentType.isDefined) { size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(paymentType.get.serializedSize) + paymentType.get.serializedSize } contacts.foreach(contacts => size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(contacts.serializedSize) + contacts.serializedSize) tags.foreach(tags => size += 1 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(tags.serializedSize) + tags.serializedSize) trafficPriceFormats.foreach(trafficPriceFormats => size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficPriceFormats.serializedSize) + trafficPriceFormats.serializedSize) trafficMediaTypes.foreach(trafficMediaTypes => size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficMediaTypes.serializedSize) + trafficMediaTypes.serializedSize) trafficVerticalCategories.foreach(trafficVerticalCategories => size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficVerticalCategories.serializedSize) + trafficVerticalCategories.serializedSize) trafficCountries.foreach(trafficCountries => size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(trafficCountries.serializedSize) + trafficCountries.serializedSize) if (minimumPaymentThreshold.isDefined) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(20, minimumPaymentThreshold.get) } if (autoPaymentFee.isDefined) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(21, autoPaymentFee.get) } if (paymentTo.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(22, paymentTo.get) } if (taxClass.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(23, taxClass.get) } if (ssnTaxId.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(24, ssnTaxId.get) } if (payVat.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(25, payVat.get) } if (swiftIban.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(26, swiftIban.get) } if (referralsEnabled.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(27, referralsEnabled.get) } if (referredByAffiliate.isDefined) { size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(referredByAffiliate.get.serializedSize) + referredByAffiliate.get.serializedSize } if (referralInfo.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(29, referralInfo.get) } if (billingCycle.isDefined) { size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(billingCycle.get.serializedSize) + billingCycle.get.serializedSize } if (currency.isDefined) { size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(currency.get.serializedSize) + currency.get.serializedSize } if (currencyPaymentSetting.isDefined) { size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(currencyPaymentSetting.get.serializedSize) + currencyPaymentSetting.get.serializedSize } if (onlineSignup.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(33, onlineSignup.get) } if (payForConversions.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(34, payForConversions.get) } if (review.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(35, review.get) } if (reviewNewSubaffiliates.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(36, reviewNewSubaffiliates.get) } if (suppression.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(37, suppression.get) } if (pixelInfo.isDefined) { size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(pixelInfo.get.serializedSize) + pixelInfo.get.serializedSize } if (fireGlobalPixel.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(39, fireGlobalPixel.get) } blacklists.foreach(blacklists => size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(blacklists.serializedSize) + blacklists.serializedSize) if (redirectDomainOverride.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(41, redirectDomainOverride.get) } if (autoApproveCampaigns.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(42, autoApproveCampaigns.get) } if (autoApprovePixels.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(43, autoApprovePixels.get) } if (hideOffers.isDefined) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(44, hideOffers.get) } if (dateCreated.isDefined) { size += 2 + com.google.protobuf.CodedOutputStream.computeRawVarint32Size(dateCreated.get.serializedSize) + dateCreated.get.serializedSize } if (notes.isDefined) { size += com.google.protobuf.CodedOutputStream.computeStringSize(46, notes.get) } size } def writeTo(output: com.google.protobuf.CodedOutputStream): Unit = { id.foreach { v => output.writeInt64(1, v) }; name.foreach { v => output.writeString(2, v) }; tier.foreach { v => output.writeTag(3, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; accountManager.foreach { v => output.writeTag(4, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; accountStatus.foreach { v => output.writeTag(5, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; street1.foreach { v => output.writeString(6, v) }; street2.foreach { v => output.writeString(7, v) }; city.foreach { v => output.writeString(8, v) }; state.foreach { v => output.writeString(9, v) }; zipCode.foreach { v => output.writeString(10, v) }; country.foreach { v => output.writeString(11, v) }; website.foreach { v => output.writeString(12, v) }; paymentType.foreach { v => output.writeTag(13, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; contacts.foreach { v => output.writeTag(14, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; tags.foreach { v => output.writeTag(15, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; trafficPriceFormats.foreach { v => output.writeTag(16, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; trafficMediaTypes.foreach { v => output.writeTag(17, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; trafficVerticalCategories.foreach { v => output.writeTag(18, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; trafficCountries.foreach { v => output.writeTag(19, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; minimumPaymentThreshold.foreach { v => output.writeDouble(20, v) }; autoPaymentFee.foreach { v => output.writeDouble(21, v) }; paymentTo.foreach { v => output.writeString(22, v) }; taxClass.foreach { v => output.writeString(23, v) }; ssnTaxId.foreach { v => output.writeString(24, v) }; payVat.foreach { v => output.writeBool(25, v) }; swiftIban.foreach { v => output.writeString(26, v) }; referralsEnabled.foreach { v => output.writeBool(27, v) }; referredByAffiliate.foreach { v => output.writeTag(28, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; referralInfo.foreach { v => output.writeString(29, v) }; billingCycle.foreach { v => output.writeTag(30, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; currency.foreach { v => output.writeTag(31, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; currencyPaymentSetting.foreach { v => output.writeTag(32, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; onlineSignup.foreach { v => output.writeBool(33, v) }; payForConversions.foreach { v => output.writeBool(34, v) }; review.foreach { v => output.writeBool(35, v) }; reviewNewSubaffiliates.foreach { v => output.writeBool(36, v) }; suppression.foreach { v => output.writeBool(37, v) }; pixelInfo.foreach { v => output.writeTag(38, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; fireGlobalPixel.foreach { v => output.writeBool(39, v) }; blacklists.foreach { v => output.writeTag(40, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; redirectDomainOverride.foreach { v => output.writeString(41, v) }; autoApproveCampaigns.foreach { v => output.writeBool(42, v) }; autoApprovePixels.foreach { v => output.writeBool(43, v) }; hideOffers.foreach { v => output.writeBool(44, v) }; dateCreated.foreach { v => output.writeTag(45, 2) output.writeRawVarint32(v.serializedSize) v.writeTo(output) }; notes.foreach { v => output.writeString(46, v) }; } def mergeFrom(input: com.google.protobuf.CodedInputStream): cakeproto.affiliates.Affiliate = { var id = this.id var name = this.name var tier = this.tier var accountManager = this.accountManager var accountStatus = this.accountStatus var street1 = this.street1 var street2 = this.street2 var city = this.city var state = this.state var zipCode = this.zipCode var country = this.country var website = this.website var paymentType = this.paymentType val contacts = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Contact] ++= this.contacts) val tags = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.tags) val trafficPriceFormats = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.trafficPriceFormats) val trafficMediaTypes = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.MediaType] ++= this.trafficMediaTypes) val trafficVerticalCategories = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.IdName] ++= this.trafficVerticalCategories) val trafficCountries = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Country] ++= this.trafficCountries) var minimumPaymentThreshold = this.minimumPaymentThreshold var autoPaymentFee = this.autoPaymentFee var paymentTo = this.paymentTo var taxClass = this.taxClass var ssnTaxId = this.ssnTaxId var payVat = this.payVat var swiftIban = this.swiftIban var referralsEnabled = this.referralsEnabled var referredByAffiliate = this.referredByAffiliate var referralInfo = this.referralInfo var billingCycle = this.billingCycle var currency = this.currency var currencyPaymentSetting = this.currencyPaymentSetting var onlineSignup = this.onlineSignup var payForConversions = this.payForConversions var review = this.review var reviewNewSubaffiliates = this.reviewNewSubaffiliates var suppression = this.suppression var pixelInfo = this.pixelInfo var fireGlobalPixel = this.fireGlobalPixel val blacklists = (scala.collection.immutable.Vector.newBuilder[cakeproto.common.Blacklist] ++= this.blacklists) var redirectDomainOverride = this.redirectDomainOverride var autoApproveCampaigns = this.autoApproveCampaigns var autoApprovePixels = this.autoApprovePixels var hideOffers = this.hideOffers var dateCreated = this.dateCreated var notes = this.notes var _done** = false while (!_done) { val _tag = input.readTag() _tag match { case 0 => _done = true case 8 => id = Some(input.readInt64()) case 18 => name = Some(input.readString()) case 26 => tier = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, tier.getOrElse(cakeproto.common.IdName.defaultInstance))) case 34 => accountManager = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, accountManager.getOrElse(cakeproto.common.IdName.defaultInstance))) case 42 => accountStatus = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, accountStatus.getOrElse(cakeproto.common.IdName.defaultInstance))) case 50 => street1 = Some(input.readString()) case 58 => street2 = Some(input.readString()) case 66 => city = Some(input.readString()) case 74 => state = Some(input.readString()) case 82 => zipCode = Some(input.readString()) case 90 => country = Some(input.readString()) case 98 => website = Some(input.readString()) case 106 => paymentType = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, paymentType.getOrElse(cakeproto.affiliates.Affiliate.PaymentType.defaultInstance))) case 114 => contacts += com.trueaccord.scalapb.LiteParser.readMessage(input, cakeproto.common.Contact.defaultInstance) case 122 => tags += com.trueaccord.scalapb.LiteParser.readMessage(input, cakeproto.common.IdName.defaultInstance) case 130 => trafficPriceFormats += com.trueaccord.scalapb.LiteParser.readMessage(input, cakeproto.common.IdName.defaultInstance) case 138 => trafficMediaTypes += com.trueaccord.scalapb.LiteParser.readMessage(input, cakeproto.common.MediaType.defaultInstance) case 146 => trafficVerticalCategories += com.trueaccord.scalapb.LiteParser.readMessage(input, cakeproto.common.IdName.defaultInstance) case 154 => trafficCountries += com.trueaccord.scalapb.LiteParser.readMessage(input, cakeproto.common.Country.defaultInstance) case 161 => minimumPaymentThreshold = Some(input.readDouble()) case 169 => autoPaymentFee = Some(input.readDouble()) case 178 => paymentTo = Some(input.readString()) case 186 => taxClass = Some(input.readString()) case 194 => ssnTaxId = Some(input.readString()) case 200 => payVat = Some(input.readBool()) case 210 => swiftIban = Some(input.readString()) case 216 => referralsEnabled = Some(input.readBool()) case 226 => referredByAffiliate = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, referredByAffiliate.getOrElse(cakeproto.common.IdName.defaultInstance))) case 234 => referralInfo = Some(input.readString()) case 242 => billingCycle = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, billingCycle.getOrElse(cakeproto.common.IdName.defaultInstance))) case 250 => currency = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, currency.getOrElse(cakeproto.common.Currency.defaultInstance))) case 258 => currencyPaymentSetting = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, currencyPaymentSetting.getOrElse(cakeproto.common.IdName.defaultInstance))) case 264 => onlineSignup = Some(input.readBool()) case 272 => payForConversions = Some(input.readBool()) case 280 => review = Some(input.readBool()) case 288 => reviewNewSubaffiliates = Some(input.readBool()) case 296 => suppression = Some(input.readBool()) case 306 => pixelInfo = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, pixelInfo.getOrElse(cakeproto.common.PixelInfo.defaultInstance))) case 312 => fireGlobalPixel = Some(input.readBool()) case 322 => blacklists += com.trueaccord.scalapb.LiteParser.readMessage(input, cakeproto.common.Blacklist.defaultInstance) case 330 => redirectDomainOverride = Some(input.readString()) case 336 => autoApproveCampaigns = Some(input.readBool()) case 344 => autoApprovePixels = Some(input.readBool()) case 352 => hideOffers = Some(input.readBool()) case 362 => dateCreated = Some(com.trueaccord.scalapb.LiteParser.readMessage(input, dateCreated.getOrElse(cakeproto.common.TimeWithZone.defaultInstance))) case 370 => notes = Some(input.readString()) case tag => input.skipField(tag) } } cakeproto.affiliates.Affiliate( id = id, name = name, tier = tier, accountManager = accountManager, accountStatus = accountStatus, street1 = street1, street2 = street2, city = city, state = state, zipCode = zipCode, country = country, website = website, paymentType = paymentType, contacts = contacts.result(), tags = tags.result(), trafficPriceFormats = trafficPriceFormats.result(), trafficMediaTypes = trafficMediaTypes.result(), trafficVerticalCategories = trafficVerticalCategories.result(), trafficCountries = trafficCountries.result(), minimumPaymentThreshold = minimumPaymentThreshold, autoPaymentFee = autoPaymentFee, paymentTo = paymentTo, taxClass = taxClass, ssnTaxId = ssnTaxId, payVat = payVat, swiftIban = swiftIban, referralsEnabled = referralsEnabled, referredByAffiliate = referredByAffiliate, referralInfo = referralInfo, billingCycle = billingCycle, currency = currency, currencyPaymentSetting = currencyPaymentSetting, onlineSignup = onlineSignup, payForConversions = payForConversions, review = review, reviewNewSubaffiliates = reviewNewSubaffiliates, suppression = suppression, pixelInfo = pixelInfo, fireGlobalPixel = fireGlobalPixel, blacklists = blacklists.result(), redirectDomainOverride = redirectDomainOverride, autoApproveCampaigns = autoApproveCampaigns, autoApprovePixels = autoApprovePixels, hideOffers = hideOffers, dateCreated = dateCreated, notes = notes ) } def getId: Long = id.getOrElse(0L) def clearId: Affiliate = copy(id = None) def withId(v: Long): Affiliate = copy(id = Some(v)) def getName: String = name.getOrElse("") def clearName: Affiliate = copy(name = None) def withName(v: String): Affiliate = copy(name = Some(v)) def getTier: cakeproto.common.IdName = tier.getOrElse(cakeproto.common.IdName.defaultInstance) def clearTier: Affiliate = copy(tier = None) def withTier(v: cakeproto.common.IdName): Affiliate = copy(tier = Some(v)) def getAccountManager: cakeproto.common.IdName = accountManager.getOrElse(cakeproto.common.IdName.defaultInstance) def clearAccountManager: Affiliate = copy(accountManager = None) def withAccountManager(v: cakeproto.common.IdName): Affiliate = copy(accountManager = Some(v)) def getAccountStatus: cakeproto.common.IdName = accountStatus.getOrElse(cakeproto.common.IdName.defaultInstance) def clearAccountStatus: Affiliate = copy(accountStatus = None) def withAccountStatus(v: cakeproto.common.IdName): Affiliate = copy(accountStatus = Some(v)) def getStreet1: String = street1.getOrElse("") def clearStreet1: Affiliate = copy(street1 = None) def withStreet1(v: String): Affiliate = copy(street1 = Some(v)) def getStreet2: String = street2.getOrElse("") def clearStreet2: Affiliate = copy(street2 = None) def withStreet2(v: String): Affiliate = copy(street2 = Some(v)) def getCity: String = city.getOrElse("") def clearCity: Affiliate = copy(city = None) def withCity(v: String): Affiliate = copy(city = Some(v)) def getState: String = state.getOrElse("") def clearState: Affiliate = copy(state = None) def withState(v: String): Affiliate = copy(state = Some(v)) def getZipCode: String = zipCode.getOrElse("") def clearZipCode: Affiliate = copy(zipCode = None) def withZipCode(v: String): Affiliate = copy(zipCode = Some(v)) def getCountry: String = country.getOrElse("") def clearCountry: Affiliate = copy(country = None) def withCountry(v: String): Affiliate = copy(country = Some(v)) def getWebsite: String = website.getOrElse("") def clearWebsite: Affiliate = copy(website = None) def withWebsite(v: String): Affiliate = copy(website = Some(v)) def getPaymentType: cakeproto.affiliates.Affiliate.PaymentType = paymentType.getOrElse(cakeproto.affiliates.Affiliate.PaymentType.defaultInstance) def clearPaymentType: Affiliate = copy(paymentType = None) def withPaymentType(v: cakeproto.affiliates.Affiliate.PaymentType): Affiliate = copy(paymentType = Some(v)) def clearContacts = copy(contacts = Seq.empty) def addContacts(vs: cakeproto.common.Contact): Affiliate = addAllContacts(vs) def addAllContacts(vs: TraversableOnce[cakeproto.common.Contact]): Affiliate = copy(contacts = contacts ++ vs) def withContacts(v: Seq[cakeproto.common.Contact]): Affiliate = copy(contacts = v) def clearTags = copy(tags = Seq.empty) def addTags(vs: cakeproto.common.IdName): Affiliate = addAllTags(vs) def addAllTags(vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(tags = tags ++ vs) def withTags(v: Seq[cakeproto.common.IdName]): Affiliate = copy(tags = v) def clearTrafficPriceFormats = copy(trafficPriceFormats = Seq.empty) def addTrafficPriceFormats(vs: cakeproto.common.IdName): Affiliate = addAllTrafficPriceFormats(vs) def addAllTrafficPriceFormats(vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(trafficPriceFormats = trafficPriceFormats ++ vs) def withTrafficPriceFormats(v: Seq[cakeproto.common.IdName]): Affiliate = copy(trafficPriceFormats = v) def clearTrafficMediaTypes = copy(trafficMediaTypes = Seq.empty) def addTrafficMediaTypes(vs: cakeproto.common.MediaType): Affiliate = addAllTrafficMediaTypes(vs) def addAllTrafficMediaTypes(vs: TraversableOnce[cakeproto.common.MediaType]): Affiliate = copy(trafficMediaTypes = trafficMediaTypes ++ vs) def withTrafficMediaTypes(v: Seq[cakeproto.common.MediaType]): Affiliate = copy(trafficMediaTypes = v) def clearTrafficVerticalCategories = copy(trafficVerticalCategories = Seq.empty) def addTrafficVerticalCategories(vs: cakeproto.common.IdName): Affiliate = addAllTrafficVerticalCategories(vs) def addAllTrafficVerticalCategories(vs: TraversableOnce[cakeproto.common.IdName]): Affiliate = copy(trafficVerticalCategories = trafficVerticalCategories ++ vs) def withTrafficVerticalCategories(v: Seq[cakeproto.common.IdName]): Affiliate = copy(trafficVerticalCategories = v) def clearTrafficCountries = copy(trafficCountries = Seq.empty) def addTrafficCountries(vs: cakeproto.common.Country): Affiliate = addAllTrafficCountries(vs) def addAllTrafficCountries(vs: TraversableOnce[cakeproto.common.Country]): Affiliate = copy(trafficCountries = trafficCountries ++ vs) def withTrafficCountries(v: Seq[cakeproto.common.Country]): Affiliate = copy(trafficCountries = v) def getMinimumPaymentThreshold: Double = minimumPaymentThreshold.getOrElse(0.0) def clearMinimumPaymentThreshold: Affiliate = copy(minimumPaymentThreshold = None) def withMinimumPaymentThreshold(v: Double): Affiliate = copy(minimumPaymentThreshold = Some(v)) def getAutoPaymentFee: Double = autoPaymentFee.getOrElse(0.0) def clearAutoPaymentFee: Affiliate = copy(autoPaymentFee = None) def withAutoPaymentFee(v: Double): Affiliate = copy(autoPaymentFee = Some(v)) def getPaymentTo: String = paymentTo.getOrElse("") def clearPaymentTo: Affiliate = copy(paymentTo = None) def withPaymentTo(v: String): Affiliate = copy(paymentTo = Some(v)) def getTaxClass: String = taxClass.getOrElse("") def clearTaxClass: Affiliate = copy(taxClass = None) def withTaxClass(v: String): Affiliate = copy(taxClass = Some(v)) def getSsnTaxId: String = ssnTaxId.getOrElse("") def clearSsnTaxId: Affiliate = copy(ssnTaxId = None) def withSsnTaxId(v: String): Affiliate = copy(ssnTaxId = Some(v)) def getPayVat: Boolean = payVat.getOrElse(false) def clearPayVat: Affiliate = copy(payVat = None) def withPayVat(v: Boolean): Affiliate = copy(payVat = Some(v)) def getSwiftIban: String = swiftIban.getOrElse("") def clearSwiftIban: Affiliate = copy(swiftIban = None) def withSwiftIban(v: String): Affiliate = copy(swiftIban = Some(v)) def getReferralsEnabled: Boolean = referralsEnabled.getOrElse(false) def clearReferralsEnabled: Affiliate = copy(referralsEnabled = None) def withReferralsEnabled(v: Boolean): Affiliate = copy(referralsEnabled = Some(v)) def getReferredByAffiliate: cakeproto.common.IdName = referredByAffiliate.getOrElse(cakeproto.common.IdName.defaultInstance) def clearReferredByAffiliate: Affiliate = copy(referredByAffiliate = None) def withReferredByAffiliate(v: cakeproto.common.IdName): Affiliate = copy(referredByAffiliate = Some(v)) def getReferralInfo: String = referralInfo.getOrElse("") def clearReferralInfo: Affiliate = copy(referralInfo = None) def withReferralInfo(v: String): Affiliate = copy(referralInfo = Some(v)) def getBillingCycle: cakeproto.common.IdName = billingCycle.getOrElse(cakeproto.common.IdName.defaultInstance) def clearBillingCycle: Affiliate = copy(billingCycle = None) def withBillingCycle(v: cakeproto.common.IdName): Affiliate = copy(billingCycle = Some(v)) def getCurrency: cakeproto.common.Currency = currency.getOrElse(cakeproto.common.Currency.defaultInstance) def clearCurrency: Affiliate = copy(currency = None) def withCurrency(v: cakeproto.common.Currency): Affiliate = copy(currency = Some(v)) def getCurrencyPaymentSetting: cakeproto.common.IdName = currencyPaymentSetting.getOrElse(cakeproto.common.IdName.defaultInstance) def clearCurrencyPaymentSetting: Affiliate = copy(currencyPaymentSetting = None) def withCurrencyPaymentSetting(v: cakeproto.common.IdName): Affiliate = copy(currencyPaymentSetting = Some(v)) def getOnlineSignup: Boolean = onlineSignup.getOrElse(false) def clearOnlineSignup: Affiliate = copy(onlineSignup = None) def withOnlineSignup(v: Boolean): Affiliate = copy(onlineSignup = Some(v)) def getPayForConversions: Boolean = payForConversions.getOrElse(false) def clearPayForConversions: Affiliate = copy(payForConversions = None) def withPayForConversions(v: Boolean): Affiliate = copy(payForConversions = Some(v)) def getReview: Boolean = review.getOrElse(false) def clearReview: Affiliate = copy(review = None) def withReview(v: Boolean): Affiliate = copy(review = Some(v)) def getReviewNewSubaffiliates: Boolean = reviewNewSubaffiliates.getOrElse(false) def clearReviewNewSubaffiliates: Affiliate = copy(reviewNewSubaffiliates = None) def withReviewNewSubaffiliates(v: Boolean): Affiliate = copy(reviewNewSubaffiliates = Some(v)) def getSuppression: Boolean = suppression.getOrElse(false) def clearSuppression: Affiliate = copy(suppression = None) def withSuppression(v: Boolean): Affiliate = copy(suppression = Some(v)) def getPixelInfo: cakeproto.common.PixelInfo = pixelInfo.getOrElse(cakeproto.common.PixelInfo.defaultInstance) def clearPixelInfo: Affiliate = copy(pixelInfo = None) def withPixelInfo(v: cakeproto.common.PixelInfo): Affiliate = copy(pixelInfo = Some(v)) def getFireGlobalPixel: Boolean = fireGlobalPixel.getOrElse(false) def clearFireGlobalPixel: Affiliate = copy(fireGlobalPixel = None) def withFireGlobalPixel(v: Boolean): Affiliate = copy(fireGlobalPixel = Some(v)) def clearBlacklists = copy(blacklists = Seq.empty) def addBlacklists(vs: cakeproto.common.Blacklist*): Affiliate = addAllBlacklists(vs) def addAllBlacklists(vs: TraversableOnce[cakeproto.common.Blacklist]): Affiliate = copy(blacklists = blacklists ++ vs) def withBlacklists(v: Seq[cakeproto.common.Blacklist]): Affiliate = copy(blacklists = v) def getRedirectDomainOverride: String = redirectDomainOverride.getOrElse("") def clearRedirectDomainOverride: Affiliate = copy(redirectDomainOverride = None) def withRedirectDomainOverride(v: String): Affiliate = copy(redirectDomainOverride = Some(v)) def getAutoApproveCampaigns: Boolean = autoApproveCampaigns.getOrElse(false) def clearAutoApproveCampaigns: Affiliate = copy(autoApproveCampaigns = None) def withAutoApproveCampaigns(v: Boolean): Affiliate = copy(autoApproveCampaigns = Some(v)) def getAutoApprovePixels: Boolean = autoApprovePixels.getOrElse(false) def clearAutoApprovePixels: Affiliate = copy(autoApprovePixels = None) def withAutoApprovePixels(v: Boolean): Affiliate = copy(autoApprovePixels = Some(v)) def getHideOffers: Boolean = hideOffers.getOrElse(false) def clearHideOffers: Affiliate = copy(hideOffers = None) def withHideOffers(v: Boolean): Affiliate = copy(hideOffers = Some(v)) def getDateCreated: cakeproto.common.TimeWithZone = dateCreated.getOrElse(cakeproto.common.TimeWithZone.defaultInstance) def clearDateCreated: Affiliate = copy(dateCreated = None) def withDateCreated(v: cakeproto.common.TimeWithZone): Affiliate = copy(dateCreated = Some(v)) def getNotes: String = notes.getOrElse("") def clearNotes: Affiliate = copy(notes = None) def withNotes(v: String): Affiliate = copy(notes = Some(v)) def getField(field: com.google.protobuf.Descriptors.FieldDescriptor): scala.Any = { __field.getNumber match { case 1 => id.getOrElse(null) case 2 => name.getOrElse(null) case 3 => tier.getOrElse(null) case 4 => accountManager.getOrElse(null) case 5 => accountStatus.getOrElse(null) case 6 => street1.getOrElse(null) case 7 => street2.getOrElse(null) case 8 => city.getOrElse(null) case 9 => state.getOrElse(null) case 10 => zipCode.getOrElse(null) case 11 => country.getOrElse(null) case 12 => website.getOrElse(null) case 13 => paymentType.getOrElse(null) case 14 => contacts case 15 => tags case 16 => trafficPriceFormats case 17 => trafficMediaTypes

zekefast commented 8 years ago

Hi @thesamet Thank you for quick response!

In particular, this appears also in tests. Tests bootstrap SparkContext:

    val conf = new SparkConf().setAppName(getClass.getSimpleName).setMaster("local[2]")
    val sc = new SparkContext(conf)
    sc.setLogLevel("WARN")
    sqlContext = new SQLContext(sc)
    val path = getClass().getResource("/cake").toString
    dataStore = new CakeDataStore(path)(sqlContext)

Then method on CakeDataStore is called. Inside CakeDataStore we have data loading like follow

    val df = sqlContext
      .read.format(s"com.ad2games.spark.cakeproto.$tableName")
      .load(fullPath)

This is an exact part which is failing I guess. There is also a bunch of juggling in our cakeproto library around ProviderRelation from spark and reader which unzip protobuf data from S3. Do you want to see them also?

thesamet commented 8 years ago

I am not sure about the .read.format() line. Are you relying somehow on sparksql-scalapb (https://trueaccord.github.io/ScalaPB/sparksql.html) ?

I'll need a minimal project that exhibits this problem. Can you set it up and upload to github?

zekefast commented 8 years ago

We do not use spark-scalapb.

I'll try to prepare test project for that issue.